pg_settings_get_flags()

A function returning the flags associated with a GUC
This entry relates to a PostgreSQL feature which is part of PostgreSQL 15, due to be released in late 2022.

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

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)

Categories

Configuration, System function

See also

pg_settings