PG
PRO
42939ERRORTier 2 — Caution✅ HIGH confidence

reserved name

Category: Syntax Error or Access Rule ViolationVersions: All Postgres versions

What this means

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.

Why it happens

  1. 1Attempting to create an object with a name reserved for system use (e.g., pg_* schemas, information_schema)
  2. 2Trying to create a schema or table that conflicts with a system-reserved name

How to reproduce

Creating a table with a reserved system name.

trigger — this will ERROR
CREATE TABLE pg_tables (id INT); -- reserved system name
ERROR: unacceptable schema name "pg_tables" DETAIL: The prefix "pg_" is reserved for system schemas.

Fix 1: Choose a non-reserved name for the object

When a naming conflict with system objects is detected.

fix
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.

What not to do

Try to create objects in pg_catalog or information_schema

Why it's wrong: These schemas are reserved for Postgres system objects and cannot be modified.

Sources

📚 Official docs: https://www.postgresql.org/docs/current/errcodes-appendix.html

🔧 Source ref: Class 42 — Syntax Error or Access Rule Violation

Confidence assessment

✅ HIGH confidence

Standard SQLSTATE for reserved name conflicts. Stable across versions.

See also

📄 Reference pages

System Schemaspg_cataloginformation_schema
⚙️ This error reference was generated with AI assistance and reviewed for accuracy. Examples are provided to illustrate common scenarios and may not cover every case. Always test fixes in a development environment before applying to production. Spotted an error? Suggest a correction →