Remember the source GucContext for each GUC parameter.
Tom Lane <tgl@sss.pgh.pa.us>
Remember the source GucContext for each GUC parameter. We used to just remember the GucSource, but saving GucContext too provides a little more information --- notably, whether a SET was done by a superuser or regular user. This allows us to rip out the fairly dodgy code that define_custom_variable used to use to try to infer the context to re-install a pre-existing setting with. In particular, it now works for a superuser to SET a extension's SUSET custom variable before loading the associated extension, because GUC can remember whether the SET was done as a superuser or not. The plperl regression tests contain an example where this is useful.
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/utils/misc/guc.c | modified | +47 −61 |
| src/backend/utils/misc/guc-file.l | modified | +12 −6 |
| src/include/utils/guc_tables.h | modified | +8 −6 |
| src/pl/plperl/expected/plperl_init.out | modified | +1 −1 |
| src/pl/plperl/expected/plperl_shared.out | modified | +1 −2 |
| src/pl/plperl/expected/plperlu.out | modified | +1 −1 |
| src/pl/plperl/sql/plperl_init.sql | modified | +1 −1 |
| src/pl/plperl/sql/plperl_shared.sql | modified | +1 −2 |
| src/pl/plperl/sql/plperlu.sql | modified | +1 −1 |