SQLSTATE 42939Severity lowLab verified

Incident brief

Reserved schema name (pg_ prefix)

Schema names beginning with 'pg_' are reserved for system schemas; creating one raises this reserved-name error.

Reproduced on PostgreSQL 18.4Verified 2026-07-24 (isolated lab, PostgreSQL 18.4)Reviewed by Verified against PostgreSQL 18.4 in an isolated lab environment

In 10 seconds

What
Reserved schema name (pg_ prefix)
What triggers it
CREATE SCHEMA with a name that starts with 'pg_'.
The fix
Choose a schema name without the 'pg_' prefix.
Proof
Reproduced on PostgreSQL 18.4 → A CREATE SCHEMA reproduces SQLSTATE 42939; the 'pg_'-prefixed name is rejected with a DETAIL explaining the reservation.

The fix

What to do right now

The immediate, application-level response to this error.

  • Choose a schema name without the 'pg_' prefix.
  • Namespace your schemas with an application-specific prefix instead.
Fix — SQL
-- Avoid the reserved 'pg_' schema-name prefix.
CREATE SCHEMA reports;

Related & next steps

Follow the thread

Everything this error touches — jump straight to the sibling error, term, runbook, or parameter.

Verification

PG 18.4
Last verified
2026-07-24 (isolated lab, PostgreSQL 18.4)
Reviewed by
Verified against PostgreSQL 18.4 in an isolated lab environment
Audit status
reviewed