Visibility of a local variable

Поиск
Список
Период
Сортировка
От Alejandro Burne
Тема Visibility of a local variable
Дата
Msg-id CAOKeeVj8s0DcjcTUULEOXGB3Ro7ZmwcV=O-wX44Aqdx7BQo1TA@mail.gmail.com
обсуждение исходный текст
Ответы Re: Visibility of a local variable
Список pgsql-bugs
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

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG #18492: Adding a toasted column to a table with an inherited temp table fails with Assert
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: Missing semicolumn in anonymous plpgsql block does not raise syntax error