Re: Sharing data between stored functions?

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Igor Neyman <ineyman(at)perceptron(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Sharing data between stored functions?
Date: 2015-03-05 19:37:25
Message-ID: 54F8B075.2090005@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 03/05/2015 11:20 AM, Igor Neyman wrote:
>
>
>> -----Original Message-----
>> From: Adrian Klaver [mailto:adrian(dot)klaver(at)aklaver(dot)com]
>> Sent: Thursday, March 05, 2015 2:07 PM
>> To: Igor Neyman; inspector morse
>> Cc: Merlin Moncure; pgsql-general(at)postgresql(dot)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(dot)klaver(at)aklaver(dot)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(dot)klaver(at)aklaver(dot)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. The data 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 either session-specific or transaction-specific data. You specify whether the data is session- or transaction-specific with the ON COMMIT keywords (below)."
>
>
> Regards,
> Igor Neyman
>
>

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message AI Rumman 2015-03-05 19:38:12 Re: Postgresql CIFS
Previous Message wambacher 2015-03-05 19:21:32 Re: autovacuum worker running amok - and me too ;)