Visibility of a local variable - Mailing list pgsql-bugs

From Alejandro Burne
Subject Visibility of a local variable
Date
Msg-id CAOKeeVj8s0DcjcTUULEOXGB3Ro7ZmwcV=O-wX44Aqdx7BQo1TA@mail.gmail.com
Whole thread Raw
Responses Re: Visibility of a local variable
List 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 by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #18492: Adding a toasted column to a table with an inherited temp table fails with Assert
Next
From: Pavel Stehule
Date:
Subject: Re: Missing semicolumn in anonymous plpgsql block does not raise syntax error