May 2019
Intermediate to advanced
600 pages
20h 46m
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 can 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 | 4096 | 4096 | 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 ...
Read now
Unlock full access