reserved name
SQLSTATE 42939 is raised when an object is being created with a name that is reserved by the system — for example, trying to create a schema named "information_schema" or a table in the pg_catalog schema.
- 1Attempting to create an object with a name reserved for system use (e.g., pg_* schemas, information_schema)
- 2Trying to create a schema or table that conflicts with a system-reserved name
Creating a table with a reserved system name.
CREATE TABLE pg_tables (id INT); -- reserved system name
expected output
ERROR: unacceptable schema name "pg_tables" DETAIL: The prefix "pg_" is reserved for system schemas.
Fix
Choose a non-reserved name for the object
WHEN When a naming conflict with system objects is detected.
CREATE TABLE app_tables (id INT); -- non-reserved name
Why this works
Avoid names starting with pg_ (reserved for system use) and avoid names matching system catalogue views and schemas.
✕ Try to create objects in pg_catalog or information_schema
These schemas are reserved for Postgres system objects and cannot be modified.
Class 42 — Syntax Error or Access Rule Violation
Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev