diff options
| author | Bruce Momjian | 2002-08-15 02:51:27 +0000 |
|---|---|---|
| committer | Bruce Momjian | 2002-08-15 02:51:27 +0000 |
| commit | 45e25445846e98fe4aac23d1073566c08cd62f0b (patch) | |
| tree | 7db989a91d752dca0a014eaaa6b160cb04b08b1c /src/include | |
| parent | 4c4854c4583f1d7c3d0a28b714304e433f5571e8 (diff) | |
As discussed on several occasions previously, the new anonymous
composite type capability makes it possible to create a system view
based on a table function in a way that is hopefully palatable to
everyone. The attached patch takes advantage of this, moving
show_all_settings() from contrib/tablefunc into the backend (renamed
all_settings(). It is defined as a builtin returning type RECORD. During
initdb a system view is created to expose the same information presently
available through SHOW ALL. For example:
test=# select * from pg_settings where name like '%debug%';
name | setting
-----------------------+---------
debug_assertions | on
debug_pretty_print | off
debug_print_parse | off
debug_print_plan | off
debug_print_query | off
debug_print_rewritten | off
wal_debug | 0
(7 rows)
Additionally during initdb two rules are created which make it possible
to change settings by updating the system view -- a "virtual table" as
Tom put it. Here's an example:
Joe Conway
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/catalog/pg_proc.h | 4 | ||||
| -rw-r--r-- | src/include/utils/builtins.h | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/include/catalog/pg_proc.h b/src/include/catalog/pg_proc.h index c4717e7b511..0c0a1a7bde5 100644 --- a/src/include/catalog/pg_proc.h +++ b/src/include/catalog/pg_proc.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: pg_proc.h,v 1.253 2002/08/09 16:45:15 tgl Exp $ + * $Id: pg_proc.h,v 1.254 2002/08/15 02:51:27 momjian Exp $ * * NOTES * The script catalog/genbki.sh reads this file and generates .bki @@ -2885,6 +2885,8 @@ DATA(insert OID = 2077 ( current_setting PGNSP PGUID 12 f f t f s 1 25 "25" sho DESCR("SHOW X as a function"); DATA(insert OID = 2078 ( set_config PGNSP PGUID 12 f f f f v 3 25 "25 25 16" set_config_by_name - _null_ )); DESCR("SET X as a function"); +DATA(insert OID = 2084 ( pg_show_all_settings PGNSP PGUID 12 f f t t s 0 2249 "" show_all_settings - _null_ )); +DESCR("SHOW ALL as a function"); DATA(insert OID = 2079 ( pg_table_is_visible PGNSP PGUID 12 f f t f s 1 16 "26" pg_table_is_visible - _null_ )); DESCR("is table visible in search path?"); diff --git a/src/include/utils/builtins.h b/src/include/utils/builtins.h index 01d5a4e7306..621ab80315b 100644 --- a/src/include/utils/builtins.h +++ b/src/include/utils/builtins.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: builtins.h,v 1.190 2002/08/09 16:45:16 tgl Exp $ + * $Id: builtins.h,v 1.191 2002/08/15 02:51:27 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -662,6 +662,7 @@ extern Datum quote_literal(PG_FUNCTION_ARGS); /* guc.c */ extern Datum show_config_by_name(PG_FUNCTION_ARGS); extern Datum set_config_by_name(PG_FUNCTION_ARGS); +extern Datum show_all_settings(PG_FUNCTION_ARGS); /* catalog/pg_conversion.c */ extern Datum pg_convert3(PG_FUNCTION_ARGS); |
