diff options
| author | Tom Lane | 2011-10-04 20:13:16 +0000 |
|---|---|---|
| committer | Tom Lane | 2011-10-04 20:13:50 +0000 |
| commit | 9f5836d224e876399dfdd7d6d4343300dbc2f664 (patch) | |
| tree | a0dd0059e615f56af1bdc969399aff085160732c /src/pl | |
| parent | 09e196e4539a70c51e828abcfe48dee3efd312d8 (diff) | |
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.
Diffstat (limited to 'src/pl')
| -rw-r--r-- | src/pl/plperl/expected/plperl_init.out | 2 | ||||
| -rw-r--r-- | src/pl/plperl/expected/plperl_shared.out | 3 | ||||
| -rw-r--r-- | src/pl/plperl/expected/plperlu.out | 2 | ||||
| -rw-r--r-- | src/pl/plperl/sql/plperl_init.sql | 2 | ||||
| -rw-r--r-- | src/pl/plperl/sql/plperl_shared.sql | 3 | ||||
| -rw-r--r-- | src/pl/plperl/sql/plperlu.sql | 2 |
6 files changed, 6 insertions, 8 deletions
diff --git a/src/pl/plperl/expected/plperl_init.out b/src/pl/plperl/expected/plperl_init.out index e8a8e9bd83..a21ea0b621 100644 --- a/src/pl/plperl/expected/plperl_init.out +++ b/src/pl/plperl/expected/plperl_init.out @@ -1,5 +1,5 @@ -- test plperl.on_plperl_init errors are fatal --- Must load plperl before we can set on_plperl_init +-- This test tests setting on_plperl_init after loading plperl LOAD 'plperl'; SET SESSION plperl.on_plperl_init = ' system("/nonesuch") '; SHOW plperl.on_plperl_init; diff --git a/src/pl/plperl/expected/plperl_shared.out b/src/pl/plperl/expected/plperl_shared.out index 67478ab454..464e22090c 100644 --- a/src/pl/plperl/expected/plperl_shared.out +++ b/src/pl/plperl/expected/plperl_shared.out @@ -1,7 +1,6 @@ -- test plperl.on_plperl_init via the shared hash -- (must be done before plperl is first used) --- Must load plperl before we can set on_plperl_init -LOAD 'plperl'; +-- This test tests setting on_plperl_init before loading plperl -- testing on_plperl_init gets run, and that it can alter %_SHARED SET plperl.on_plperl_init = '$_SHARED{on_init} = 42'; -- test the shared hash diff --git a/src/pl/plperl/expected/plperlu.out b/src/pl/plperl/expected/plperlu.out index 1ba07eed9d..3daf4ced86 100644 --- a/src/pl/plperl/expected/plperlu.out +++ b/src/pl/plperl/expected/plperlu.out @@ -1,6 +1,6 @@ -- Use ONLY plperlu tests here. For plperl/plerlu combined tests -- see plperl_plperlu.sql --- Must load plperl before we can set on_plperlu_init +-- This test tests setting on_plperlu_init after loading plperl LOAD 'plperl'; -- Test plperl.on_plperlu_init gets run SET plperl.on_plperlu_init = '$_SHARED{init} = 42'; diff --git a/src/pl/plperl/sql/plperl_init.sql b/src/pl/plperl/sql/plperl_init.sql index 51ac9192bd..d60268d033 100644 --- a/src/pl/plperl/sql/plperl_init.sql +++ b/src/pl/plperl/sql/plperl_init.sql @@ -1,6 +1,6 @@ -- test plperl.on_plperl_init errors are fatal --- Must load plperl before we can set on_plperl_init +-- This test tests setting on_plperl_init after loading plperl LOAD 'plperl'; SET SESSION plperl.on_plperl_init = ' system("/nonesuch") '; diff --git a/src/pl/plperl/sql/plperl_shared.sql b/src/pl/plperl/sql/plperl_shared.sql index d2fa8cbf93..b60e114faf 100644 --- a/src/pl/plperl/sql/plperl_shared.sql +++ b/src/pl/plperl/sql/plperl_shared.sql @@ -1,8 +1,7 @@ -- test plperl.on_plperl_init via the shared hash -- (must be done before plperl is first used) --- Must load plperl before we can set on_plperl_init -LOAD 'plperl'; +-- This test tests setting on_plperl_init before loading plperl -- testing on_plperl_init gets run, and that it can alter %_SHARED SET plperl.on_plperl_init = '$_SHARED{on_init} = 42'; diff --git a/src/pl/plperl/sql/plperlu.sql b/src/pl/plperl/sql/plperlu.sql index 831b8f4460..be43df5d90 100644 --- a/src/pl/plperl/sql/plperlu.sql +++ b/src/pl/plperl/sql/plperlu.sql @@ -1,7 +1,7 @@ -- Use ONLY plperlu tests here. For plperl/plerlu combined tests -- see plperl_plperlu.sql --- Must load plperl before we can set on_plperlu_init +-- This test tests setting on_plperlu_init after loading plperl LOAD 'plperl'; -- Test plperl.on_plperlu_init gets run |
