42939
Read PG 18 manual ↗reserved_name
- SQLSTATE
- 42939
- Condition name
- reserved_name
- Class
- Syntax Error or Access Rule Violation
- Source macro
- ERRCODE_RESERVED_NAME
- Evidence
- Source path confirmed
English SQLSTATE atlas: authored explanations and source/runtime evidence are separate from the manual definitions. View source ↗
At a glance
42939 (reserved_name) rejects a name under an object-specific PostgreSQL rule. The selected 18.6 paths cover schemas, tablespaces, role creation, and role-specification grammar; the object named in the message determines which rule fired.
Meaning
Schema creation rejects a reserved pg_ prefix with unacceptable schema name "%s" and a system-schema DETAIL. Tablespace creation has the parallel system-tablespace message. CREATE ROLE rejects the pg_ prefix with role name "%s" is reserved. Separately, the grammar's RoleId conversion rejects public, none, SESSION_USER, CURRENT_USER, and CURRENT_ROLE in role-name positions: public and none use the reserved-role-name primary, while the three current/session tokens use %s cannot be used as a role name here. These grammar rules do not make those words reserved in every identifier position.
Diagnosis
Start with the exact primary and DETAIL. unacceptable schema name points to the schema prefix guard; unacceptable tablespace name points to the tablespace guard; role name ... is reserved can be a pg_ role or the grammar's public/none path; and %s cannot be used as a role name here identifies a role-specification token. For a grammar failure, inspect the command's role position rather than searching pg_namespace or pg_authid. Do not infer a role failure from a tablespace message.
Response
Choose an allowed object name after checking migration and ownership. For a role-specification error, replace the role token with an actual allowed role identifier in that grammar position; quoting or changing search_path is not a substitute for fixing the command. Do not rename or drop system objects to force success; update dependent grants and configuration deliberately. If an object-level ERROR occurred inside an explicit transaction, use a savepoint rollback or transaction rollback before retrying.
Messages
The selected paths are explicit ERRORs. Their exact primary/detail roles are:
- schema:
unacceptable schema name "%s"withThe prefix "pg_" is reserved for system schemas. - tablespace:
unacceptable tablespace name "%s"withThe prefix "pg_" is reserved for system tablespaces. - role prefix:
role name "%s" is reservedwithRole names starting with "pg_" are reserved. - role grammar:
role name "%s" is reservedforpublic/none, or%s cannot be used as a role name hereforSESSION_USER,CURRENT_USER, andCURRENT_ROLE.
Versions
From the locked 7.4 lower bound through 18.6 and 19beta3; that catalogue range is a condition bound, not one introduction point for every object-specific rule. The selected mechanisms are source-only and runtime was not run.
Sources
-
src.errcodes.42939.18.6—src/backend/utils/errcodes.txtline 349, fixed at724edf9bde9d356724ad384a2e196edc3c9f80f7; SHA-2566e8de346643ba84aa3c9c6a73360acfc7b2dfb89162c06c08ce9bf5bcd5bbcba(source). -
src.call.42939.baa3c4599e167695f281cfe8—src/backend/commands/schemacmds.clines 107-110, fixed at724edf9bde9d356724ad384a2e196edc3c9f80f7; SHA-2565fd5f43dce5f36f06ed390014c06f244564072227d25a22735f594d2170626b1(source). src.call.42939.aed179efd45a7ca409d59fd6—src/backend/commands/tablespace.clines 281-285, fixed at724edf9bde9d356724ad384a2e196edc3c9f80f7; SHA-256f0369bece6339d18cd7d4a29b5fa3010447c3b8ece235c64b0d4fbf5f96a5317(source).src.call.42939.419595a34cae2a69b2e21624—src/backend/commands/user.clines 352-356, fixed at724edf9bde9d356724ad384a2e196edc3c9f80f7; SHA-256aa8769a2577fff287301d6c82169262cca328515ae940d5a2be4b3e8c21617ed(source).src.call.42939.role-grammar—src/backend/parser/gram.ylines 17460-17542, fixed at724edf9bde9d356724ad384a2e196edc3c9f80f7; SHA-2567e548b673a1e03eb3a56c5eb9ad92d8e11095fac76e14cb258ca851f58274724(source).src.calls.REL_18_6.42939— resolved core call groups; SHA-2569ee8a0e81d8f0825c5c1ae45583439859a26e602bdd4ce2f2a62aa278867ccbf.authored evidence— source claims, message roles, and runtime boundary.
Source evidence
Evidence belongs to the frozen source and runtime versions listed here. It is not a runtime verification of the selected manual version.
42939 is the reserved_name condition in Class 42.
Method: Read fixed REL_18_6 errcodes.txt and locked facts.
Limits: Identity does not enumerate all source branches or client failures.
Schema and tablespace paths reject reserved `pg_` names with object-specific DETAIL. CREATE ROLE reports the reserved `pg_` role path. RoleId grammar rejects `public`, `none`, SESSION_USER, CURRENT_USER, and CURRENT_ROLE in role-name positions, with a reserved-role-name primary for public/none and a `%s cannot be used as a role name here` primary for the current/session tokens.
Method: Read complete resolved REL_18_6 report groups and message roles.
Limits: Representative confirmed core paths only; not exhaustive historical or extension coverage.
src.call.42939.baa3c4599e167695f281cfe8 src.call.42939.aed179efd45a7ca409d59fd6 src.call.42939.419595a34cae2a69b2e21624 src.call.42939.role-grammar
From the locked 7.4 lower bound through 18.6 and 19beta3; multiple branches do not imply one introduction point.
Method: Read locked catalogue facts and definition snapshots.
Limits: First observed release is a lower bound, not precise behavioral introduction.
- src/backend/utils/errcodes.txt · REL_18_6 · line 349
724edf9bde9d356724ad384a2e196edc3c9f80f7 - src/backend/commands/schemacmds.c · REL_18_6 · lines 107-110
724edf9bde9d356724ad384a2e196edc3c9f80f7 - src/backend/commands/tablespace.c · REL_18_6 · lines 281-285
724edf9bde9d356724ad384a2e196edc3c9f80f7 - src/backend/commands/user.c · REL_18_6 · lines 352-356
724edf9bde9d356724ad384a2e196edc3c9f80f7 - src/backend/parser/gram.y · REL_18_6 · lines 17460-17542
724edf9bde9d356724ad384a2e196edc3c9f80f7 raw/calls/REL_18_6.jsonl· ·
Message templates
explicit ERROR · message.variant-1
Primary
unacceptable schema name "%s"
Detail
The prefix "pg_" is reserved for system schemas.
Primary
The prefix "pg_" is reserved for system schemas.
Placeholders remain dynamic source fields; no concrete runtime value is claimed.
explicit ERROR · message.variant-2
Primary
unacceptable tablespace name "%s"
Detail
The prefix "pg_" is reserved for system tablespaces.
Primary
The prefix "pg_" is reserved for system tablespaces.
Placeholders remain dynamic source fields; no concrete runtime value is claimed.
explicit ERROR · message.variant-3
Primary
role name "%s" is reserved
Detail
Role names starting with "pg_" are reserved.
Primary
Role names starting with "pg_" are reserved.
Placeholders remain dynamic source fields; no concrete runtime value is claimed.
explicit ERROR · message.variant-4
Primary
role name "%s" is reserved
The grammar supplies public or none as the dynamic role-name value; no concrete command is claimed.
explicit ERROR · message.variant-5
Primary
%s cannot be used as a role name here
The grammar supplies SESSION_USER, CURRENT_USER, or CURRENT_ROLE as the dynamic token; no concrete command is claimed.
Reproduction & repair cases
No reproduction case is attached to this condition.
Recorded runtime evidence
No runtime observation is attached to this entry.
Definition snapshot: english-manuals:d2bf322b0fd508f1c361f1c99b3… · English manual source