Re: Sharing data between stored functions? - Mailing list pgsql-general

From Adrian Klaver
Subject Re: Sharing data between stored functions?
Date
Msg-id 54F8B075.2090005@aklaver.com
Whole thread Raw
In response to Sharing data between stored functions?  (inspector morse <inspectormorse86@gmail.com>)
List pgsql-general
On 03/05/2015 11:20 AM, Igor Neyman wrote:
>
>
>> -----Original Message-----
>> From: Adrian Klaver [mailto:adrian.klaver@aklaver.com]
>> Sent: Thursday, March 05, 2015 2:07 PM
>> To: Igor Neyman; inspector morse
>> Cc: Merlin Moncure; pgsql-general@postgresql.org
>> Subject: Re: [GENERAL] Sharing data between stored functions?
>>
>> On 03/05/2015 11:01 AM, Igor Neyman wrote:
>>>
>>>
>>>>> Sorry, my reply was based on (old) Oracle knowledge.
>>>>> Now, I'm wondering too, why PG didn't implement such basic (at least
>>>>> to
>>>> me) feature.
>>>>
>>>> Per my previous post, see:
>>>>
>>>> http://www.postgresql.org/docs/9.4/interactive/sql-createtable.html
>>>>
>>>> Compatibility
>>>>
>>>> The CREATE TABLE command conforms to the SQL standard, with
>>>> exceptions listed below.
>>>>
>>>> Temporary Tables
>>>> ....
>>>>>
>>>>> Regards,
>>>>> Igor Neyman
>>>>>
>>>> --
>>>> Adrian Klaver
>>>> adrian.klaver@aklaver.com
>>>
>>>
>>> m.b. I'm missing something, but this quote from docs doesn't explain
>> "why", it just states that feature is not implemented.
>>
>> "The SQL standard also distinguishes between global and local temporary
>> tables, where a local temporary table has a separate set of contents for each
>> SQL module within each session, though its definition is still shared across
>> sessions. Since PostgreSQL does not support SQL modules, this distinction is
>> not relevant in PostgreSQL.
>> "
>>
>>>
>>> Regards,
>>> Igor Neyman
>>>
>>
>>
>> --
>> Adrian Klaver
>> adrian.klaver@aklaver.com

CCing list.
>
> I can't completely agree with this reasoning.

Well that is something you are going to have to take up with the SQL
standards committee:

http://dbis-informatik.uibk.ac.at/files/ext/lehre/ss11/vo-ndbm/lit/ORel-SQL1999-IBM-Nelson-Mattos.pdf

Page 261

http://www.jtc1sc32.org/doc/N2151-2200/32N2153T-text_for_ballot-FDIS_9075-1.pdf

Page 25

> May be I'm just used to Oracle's implementation.  Oh, and in Oracle temp tables have nothing to do with SQL modules.
>  From Oracle docs:
> "Specify GLOBAL TEMPORARY to indicate that the table is temporary and that its definition is visible to all sessions.
Thedata in a temporary table is visible only to the session that inserts the data into the table. 
> A temporary table has a definition that persists the same as the definitions of regular tables, but it contains
eithersession-specific or transaction-specific data. You specify whether the data is session- or transaction-specific
withthe ON COMMIT keywords (below)." 
>
>
> Regards,
> Igor Neyman
>
>


--
Adrian Klaver
adrian.klaver@aklaver.com


pgsql-general by date:

Previous
From: wambacher
Date:
Subject: Re: autovacuum worker running amok - and me too ;)
Next
From: AI Rumman
Date:
Subject: Re: Postgresql CIFS