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

From Jim Nasby
Subject Re: proposal: schema PL session variables
Date
Msg-id 56BB8A21.8060701@BlueTreble.com
Whole thread Raw
In response to Re: proposal: schema PL session variables  (Pavel Stehule <pavel.stehule@gmail.com>)
List pgsql-hackers
On 2/10/16 11:33 AM, Pavel Stehule wrote:
>
>     I don't think that really makes sense. I would expect schema
>     variables to be exposed to a function as variables or attributes,
>     either in the global namespace for that PL, or as an attribute of
>     some object (ie the plpy object in plpython).
>
>
> I don't know a python, and I don't know what is possible there and what
> I know. Set/Get function I can implement in any PL other than PLpgSQL.
> You have to do conversion from Postgres type to PL types and I can do it
> in function.

Requiring PLs to go through the native SPI to get to schema variables is 
just plain ugly and inefficient. Why wouldn't they be exposed natively?

Not designing these things through is how we ended up with the mess that 
is composite types and arrays in plpython and pltcl. I'm not saying any 
PLs besides plpgsql need to support this natively out of the box, but we 
better have an idea of how they would support it (and it'd be a good 
idea if at least one other PL did support it).
-- 
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: Pavel Stehule
Date:
Subject: Re: proposal: schema PL session variables
Next
From: Jim Nasby
Date:
Subject: Re: proposal: schema PL session variables