-
- Downloads
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
Showing
- contrib/tablefunc/README.tablefunc 98 additions, 41 deletionscontrib/tablefunc/README.tablefunc
- contrib/tablefunc/tablefunc-test.sql 3 additions, 1 deletioncontrib/tablefunc/tablefunc-test.sql
- contrib/tablefunc/tablefunc.c 128 additions, 161 deletionscontrib/tablefunc/tablefunc.c
- contrib/tablefunc/tablefunc.h 0 additions, 1 deletioncontrib/tablefunc/tablefunc.h
- contrib/tablefunc/tablefunc.sql.in 3 additions, 9 deletionscontrib/tablefunc/tablefunc.sql.in
- src/backend/utils/misc/guc.c 113 additions, 1 deletionsrc/backend/utils/misc/guc.c
- src/bin/initdb/initdb.sh 16 additions, 1 deletionsrc/bin/initdb/initdb.sh
- src/include/catalog/pg_proc.h 3 additions, 1 deletionsrc/include/catalog/pg_proc.h
- src/include/utils/builtins.h 2 additions, 1 deletionsrc/include/utils/builtins.h
- src/test/regress/expected/rules.out 5 additions, 2 deletionssrc/test/regress/expected/rules.out
Loading
Please register or sign in to comment