restrict_nonsystem_relation_kind
Fact — official short description: “Prohibits access to non-system relations of specified kinds.”
Identity
Lifecycle
| Fact | Value |
|---|---|
| First observed | PG12 |
| Present in | PG12–19 Beta 3 |
| Removed in | No |
| Introduction commit | 79c7a7e29695 — Restrict accesses to non-system views and foreign tables during pg_dump. |
| Commit date | 2024-08-05 |
| Discussion | — |
Default history
| Versions | Raw boot_val |
Unit | Human value |
|---|---|---|---|
| PG12–19 Beta 3 | "" |
— | empty string |
How it works
restrict_nonsystem_relation_kind prohibits access to non-system relations of specified kinds. The supported kinds are view and foreign-table; PostgreSQL uses the restriction as a safety boundary for specialized sessions, not as general SQL authorization.
restrict_nonsystem_relation_kind is a USER-context setting. An authorized role can change it for a session, while ALTER ROLE or ALTER DATABASE can establish a default for future sessions.
Because session state can survive in pooled connections, role defaults, SET privilege, RESET behavior, and application checkout hooks are part of the control’s effective boundary.
Tuning advice
Advice. These are workload-specific starting points and must be validated with measurements.
| Workload | Guidance |
|---|---|
| OLTP | Do not tune restrict_nonsystem_relation_kind as a general security policy. Leave it empty unless a PostgreSQL subsystem or tightly scoped maintenance workflow explicitly requires the restriction. |
| OLAP | Do not use it to sandbox arbitrary analytical users; enforce access with privileges, schemas, and row-level policies. |
| Small nodes | Keep the default empty. Enabling relation-kind bans has no capacity benefit and can break ordinary queries unexpectedly. |
Pigsty
Values use the fixed 8-vCPU, 32-GiB, 100-GiB SSD fixture and render the current Pigsty templates for PG19 Beta 3; this does not assert current Pigsty support for that historical or beta release.
| Template | Effective value | Versus upstream boot | Source expression |
|---|---|---|---|
| OLTP | Unmodified | — | — |
| OLAP | Unmodified | — | — |
| CRIT | Unmodified | — | — |
| TINY | Unmodified | — | — |
Advice — pending human review. Fact from the current Pigsty template projection: OLTP: PG12–19 Beta 3 unmodified; OLAP: PG12–19 Beta 3 unmodified; CRIT: PG12–19 Beta 3 unmodified; TINY: PG12–19 Beta 3 unmodified. No Pigsty-specific rationale is inferred from an absent override.
Common pitfalls
- Changing restrict_nonsystem_relation_kind in one session and assuming role defaults, database defaults, or other pooled sessions changed with it.
- Granting broad SET rights to a control that can change correctness, policy enforcement, or name resolution.
- Failing to reset a security-sensitive session value before a pooled connection is reused by another request.
- Changing restrict_nonsystem_relation_kind globally without a rollback plan and a client or operational compatibility test.
Related parameters
search_path · row_security · session_replication_role · event_triggers · createrole_self_grant
References
- PostgreSQL 19 Beta 3 — restrict_nonsystem_relation_kind
- PostgreSQL 19 release notes
- Machine-readable GUC export