pg_settings_get_flags()
A function returning the flags associated with a GUC
pg_settings_get_flags()
is a system function returning an array of the flags associated with a configuration parameter.
pg_settings_get_flags()
was added in PostgreSQL 15.
Usage
pg_settings_get_flags (guc
text
) →text
[]
If no relevant flags exist for the GUC, an empty array is returned.
If the provided GUC does not exist, NULL
is returned.
Change history
- PostgreSQL 15
- added (commit d10e41d4)
Examples
Basic usage example for pg_settings_get_flags()
:
postgres=# SELECT pg_settings_get_flags('work_mem'); pg_settings_get_flags ----------------------- {EXPLAIN} (1 row)
Many GUCs do not have any flags set, so an empty array is returned:
postgres=# SELECT pg_settings_get_flags('log_directory'); pg_settings_get_flags ----------------------- {} (1 row)
NULL
is returned if a non-existent GUC is provided:
postgres=# SELECT pg_settings_get_flags('foo') IS NULL; ?column? ---------- t (1 row)
References
- PostgreSQL documentation: System Catalog Information Functions
Useful links
- PostgreSQL 15: New function to list flags associated with GUCs - January 2022 blog article by Daniel Westermann / dbi services