quote_all_identifiers
Read PG 18 manual ↗When the database generates SQL, force all identifiers to be quoted, even if they are not (currently) keywords.
- Type
- bool
- Context
- user
- Measured default
- off
- Unit
- —
- Metadata snapshot
- 18
Definition PG 18 manual
When the database generates SQL, force all identifiers to be quoted, even if they are not (currently) keywords. This will affect the output of EXPLAIN as well as the results of functions like pg_get_viewdef. See also the --quote-all-identifiers option of pg_dump and pg_dumpall.
Measured default history
| Version interval | Default |
|---|---|
| 9.1 – 19 | off |
Authored guidance from the GUC source snapshot; the version-specific manual above is the definition reference. View source ↗
How it works
When generating SQL fragments, quote all identifiers. It can be changed at session scope, so different sessions may observe different behavior.
This asks server-side SQL deparsers to double-quote every identifier instead of only those that require quoting. It helps transport SQL across keyword/version differences but does not quote values or make arbitrary string concatenation safe.
Monitor and change quote_all_identifiers together with array_nulls, backslash_quote, escape_string_warning. Validate on the relevant server role and real workload, then use its user context to choose session change, reload, or restart; a historical boot default is not the current effective value.
Operational considerations
Keeping a compatibility switch permanently instead of fixing the client.
Testing in one session and deploying globally to unrelated applications.
Confusing parsing compatibility with data or security compatibility.
Forgetting to remove an override after the upgrade migration is complete.
Workload guidance
OLAP: Regression-test ETL, generated SQL, and old drivers, where parsing/quoting assumptions hide. Performance is rarely a reason to change this switch.
OLTP: Keep the modern default and repair legacy clients/SQL that depend on quote_all_identifiers. Test migration at session scope first; do not make a compatibility switch permanent cluster policy.
SMALL: Keep the default without a legacy requirement. If temporarily enabled, record owner, affected connections, and a removal date.
Version history 1
- PG 9.0 → 9.1added
Related entries
Further reading
Definition snapshot: english-manuals:cb663c591cfed4dae6c56b832dc… · English manual source