1 -- test plperl.on_plperl_init
2 -- This test tests setting on_plperl_init after loading plperl
4 SET SESSION plperl.on_plperl_init = ' system("/nonesuch"); ';
5 SHOW plperl.on_plperl_init;
7 ------------------------
11 DO $$ warn 42 $$ language plperl;
12 ERROR: 'system' trapped by operation mask at line 1.
13 CONTEXT: while executing plperl.on_plperl_init
14 PL/Perl anonymous code block
16 -- Reconnect (to unload plperl), then test setting on_plperl_init
17 -- as an unprivileged user
20 CREATE ROLE regress_plperl_user;
21 SET ROLE regress_plperl_user;
22 -- this succeeds, since the GUC isn't known yet
23 SET SESSION plperl.on_plperl_init = 'test';
26 WARNING: permission denied to set parameter "plperl.on_plperl_init"
27 SHOW plperl.on_plperl_init;
29 -----------------------
33 DO $$ warn 42 $$ language plperl;
34 WARNING: 42 at line 1.
35 -- now we won't be allowed to set it in the first place
36 SET ROLE regress_plperl_user;
37 SET SESSION plperl.on_plperl_init = 'test';
38 ERROR: permission denied to set parameter "plperl.on_plperl_init"
40 DROP ROLE regress_plperl_user;