DB Internals AtlasPostgreSQL 18.6 Home About

Parameter · Developer Options

allow_system_table_mods

Allows modifications of the structure of system tables.

  • Default: off
  • Type: bool
  • Applies: Session (superuser)

In plain words

The system catalogs (pg_class, pg_attribute, …) describe every object in the database. PostgreSQL refuses to let anyone, even a superuser, change their structure, because a mistake can make the whole database unreadable.

This switch removes that safety catch. Ordinary UPDATEs on catalogs by superusers are already allowed without it.

For DBAs and operators

Captured on 18.6:

ALTER TABLE pg_class ADD COLUMN foo int;ERROR: permission denied: "pg_class" is a system catalog

With SET allow_system_table_mods = on such DDL is accepted (for example CREATE INDEX on pg_class succeeded in a rolled-back test). It covers structural changes and a few other risky operations, such as creating objects in pg_catalog or changing catalog storage options.

Legitimate uses are rare: PostgreSQL developers, upgrade tooling, or a carefully scripted repair given by someone who knows the catalog code. Hand-edited catalogs are a frequent root cause of "unexplainable" errors and of pg_upgrade/pg_dump failures; when you see strange catalog state in a support case, ask whether this setting (or direct catalog UPDATEs) was ever used.

Danger. Mistakes can corrupt the catalogs beyond repair and lose the whole database. Take a file-level copy of the data directory (or of the affected files) before touching it, and turn it off again as soon as you are done.

How to change it

A superuser (or a role granted SET) can change it per session with SET.

See it in context

Logical structure Roles and privileges

Related parameters

ignore_system_indexes allow_in_place_tablespaces

All Developer Options parameters