mirror of
https://github.com/postgres/postgres.git
synced 2025-09-03 15:22:11 +03:00
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.
This commit is contained in:
@@ -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;
|
||||
|
@@ -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
|
||||
|
@@ -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';
|
||||
|
@@ -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") ';
|
||||
|
@@ -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';
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user