| 1 |
-- test plperl.on_plperl_init |
| 2 |
|
| 3 |
-- This test tests setting on_plperl_init after loading plperl |
| 4 |
LOAD 'plperl'; |
| 5 |
|
| 6 |
SET SESSION plperl.on_plperl_init = ' system("/nonesuch"); '; |
| 7 |
|
| 8 |
SHOW plperl.on_plperl_init; |
| 9 |
|
| 10 |
DO $$ warn 42 $$ language plperl; |
| 11 |
|
| 12 |
-- |
| 13 |
-- Reconnect (to unload plperl), then test setting on_plperl_init |
| 14 |
-- as an unprivileged user |
| 15 |
-- |
| 16 |
|
| 17 |
\c - |
| 18 |
|
| 19 |
CREATE ROLE regress_plperl_user; |
| 20 |
|
| 21 |
SET ROLE regress_plperl_user; |
| 22 |
|
| 23 |
-- this succeeds, since the GUC isn't known yet |
| 24 |
SET SESSION plperl.on_plperl_init = 'test'; |
| 25 |
|
| 26 |
RESET ROLE; |
| 27 |
|
| 28 |
LOAD 'plperl'; |
| 29 |
|
| 30 |
SHOW plperl.on_plperl_init; |
| 31 |
|
| 32 |
DO $$ warn 42 $$ language plperl; |
| 33 |
|
| 34 |
-- now we won't be allowed to set it in the first place |
| 35 |
SET ROLE regress_plperl_user; |
| 36 |
|
| 37 |
SET SESSION plperl.on_plperl_init = 'test'; |
| 38 |
|
| 39 |
RESET ROLE; |
| 40 |
|
| 41 |
DROP ROLE regress_plperl_user; |