Re: proposal: schema PL session variables - Mailing list pgsql-hackers

From Jim Nasby
Subject Re: proposal: schema PL session variables
Date
Msg-id 56BE5199.1030009@BlueTreble.com
Whole thread Raw
In response to Re: proposal: schema PL session variables  (Pavel Stehule <pavel.stehule@gmail.com>)
Responses Re: proposal: schema PL session variables
Re: proposal: schema PL session variables
List pgsql-hackers
On 2/12/16 2:58 PM, Pavel Stehule wrote:
>
>     So I think adding something like this needs to at least address
>     *how* SQL level access would work, *when* it's eventually implemented.
>
>
> I understand - and I agree.
>
> small note: Private variables should not be executed from any SQL,
> because SQL has not directly related schema. It can be executed only
> from SQL embedded in some object with attached schema - PL functions,
> views, constraints, .. So for this use case, the important information
> is info about a container. We have to hold info about related schema in
> planner/executor context.

I think that's probably true, but this also shows why we need to 
consider different PLs too. As it stands right now, the only way to 
access a variable outside of plpgsql would be to call a plpgsql 
function, and currently there's no way to make a plpgsql function 
private. So for this to work, private variables probably need to be 
exposed directly through the pl handler.

Again, I'm not saying this all has to be implemented up front, but there 
needs to be a plan for how it would work.

I think it would be a good idea to start a wiki page on this topic to 
start collecting stuff together.
-- 
Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
Experts in Analytics, Data Architecture and PostgreSQL
Data in Trouble? Get it in Treble! http://BlueTreble.com



pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: innocuous: pgbench does FD_ISSET on invalid socket
Next
From: Tom Lane
Date:
Subject: Re: Re: [COMMITTERS] pgsql: Add some isolation tests for deadlock detection and resolution.