diff --git a/doc/src/sgml/catalogs.sgml b/doc/src/sgml/catalogs.sgml index 9ceb96b..43d2774 100644 --- a/doc/src/sgml/catalogs.sgml +++ b/doc/src/sgml/catalogs.sgml @@ -2759,6 +2759,40 @@ + + + The following query provides a more user-friendly interface for browsing + this catalog table. A similar view, without the explosion of the + pg_db_role_setting.setconfig field, + can be executed in psql via the + \drds meta-command. + +SELECT + affected_db, + affected_role, + config_parts[1] AS name, --matches pg_settings + config_parts[2] AS db_role_val, + setdatabase, + setrole, + setconfig +FROM ( + --key=value pairs need to be split on the first equal-sign + SELECT *, (SELECT regexp_matches(config_item, '^([^=]+)=(.*)')) AS config_parts + FROM ( + -- resolve the oid values to names + -- and also unnest the array of configuration key=value pairs + SELECT * + , COALESCE(datname, 'All Databases') || ' (' || setdatabase || ')' AS affected_db + , COALESCE(rolname, 'All Roles') || ' (' || setrole || ')' AS affected_role + , unnest(setconfig) AS config_item + FROM pg_db_role_setting + LEFT JOIN pg_database ON (setdatabase = pg_database.oid) + LEFT JOIN pg_authid ON (setrole = pg_authid.oid) + ) itemize_config +) match_config_parts + + + diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml index 6bcb106..e4519a3 100644 --- a/doc/src/sgml/config.sgml +++ b/doc/src/sgml/config.sgml @@ -213,6 +213,9 @@ shared_buffers = 128MB command line, and constitute defaults for the rest of the session. Note that some settings cannot be changed after server start, and so cannot be set with these commands (or the ones listed below). + To see the current inventory of combinations you can query the + + pg_db_role_setting catalog table.