May 2018
Intermediate to advanced
576 pages
30h 25m
English
You can change the value of a setting during your transaction as well, like this:
SET LOCAL work_mem = '16MB';
This results in the following output:
WARNING: SET LOCAL can only be used in transaction blocksSET
In order to understand what the warning means, we look that setting up in the pg_settings catalog view:
postgres=# SELECT name, setting, reset_val, source FROM pg_settings WHERE source = ‘session’; name | setting | reset_val | source ----------+---------+-----------+--------- work_mem | 1024 | 1024 | session
Huh? What happened to your parameter setting? The SET LOCAL command takes effect only for the transaction in which it was executed, which was just the SET LOCAL command in our case. We need to execute it inside a ...