Re: Visibility of a local variable - Mailing list pgsql-bugs

From David G. Johnston
Subject Re: Visibility of a local variable
Date
Msg-id CAKFQuwYBxmU8kw6zrZXdwWP85Y6n3WkrBhaboBVPjg3EyPJHrw@mail.gmail.com
Whole thread Raw
In response to Visibility of a local variable  (Alejandro Burne <adburne@gmail.com>)
Responses Re: Visibility of a local variable
List pgsql-bugs
On Monday, June 3, 2024, Alejandro Burne <adburne@gmail.com> wrote:
A local variable, created within a transaction, continues to persist (without value) after the transaction has ended.


This is under-documented but at present there is no plan to change this long-standing behavior, just document it better.

Once a session knows a variable exists it cannot be made to not exist.  Only set back to its default empty string value (since custom variables are only of type text)

David J.
 

pgsql-bugs by date:

Previous
From: SAS
Date:
Subject: Minor update on pg_hba documentation
Next
From: Pierre Forstmann
Date:
Subject: Re: BUG #18494: hstore data type not recognized by Npgsql in PostgreSQL 16.3