A local variable, created within a transaction, continues to persist (without value) after the transaction has ended.
> select version();
PostgreSQL 12.15 (Ubuntu 12.15-1.pgdg18.04+1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0, 64-bit
> select current_setting('my.var1');
ERROR: parámetro de configuración «my.var1» no reconocido SQL state: 42704
(as expected)
> begin;
> set local my.var1 = true;
> commit;
(everything ok)
> select current_setting('my.var1');
returns an empty field (current_setting)
It should return the same error as in the first statement
Greetings, Alejandro