Created
August 17, 2021 15:25
-
-
Save arlandism/350033058982968cd50c3a74ba91cad2 to your computer and use it in GitHub Desktop.
Example of set_config expiring after current transaction is over
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
arlandis=# begin transaction; | |
BEGIN | |
arlandis=*# select set_config('my.random.key', 'blahblah', true); | |
set_config | |
------------ | |
blahblah | |
(1 row) | |
arlandis=*# select current_setting('my.random.key'); | |
current_setting | |
----------------- | |
blahblah | |
(1 row) | |
arlandis=*# commit; | |
COMMIT | |
arlandis=# select current_setting('my.random.key'); | |
current_setting | |
----------------- | |
(1 row) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment