Thread: Re: Re: [COMMITTERS] pgsql: Add ERROR msg for GLOBAL/LOCAL TEMP is not yet implemented

Simon Riggs  wrote:
> On 9 June 2012 16:46, Tom Lane  wrote:
>> Simon Riggs  writes:
>>> Add ERROR msg for GLOBAL/LOCAL TEMP is not yet implemented
>>
>> I don't believe there was actual consensus for this change,
> 
> It was hardly a subject of marked disagreement.
Regarding GLOBAL, the three comments so far have been along the same
lines.  But I assumed this was a 9.3 discussion.
>> and certainly not for throwing error on both cases.
> 
> Why would we do it for GLOBAL but not LOCAL also?
Because the current support for temporary tables is relatively
similar to the standard's description of LOCAL TEMPORARY TABLES, but
nothing at all like the standard's descri0ption of GLOBAL TEMPORARY
TABLES.  Now, I would love for us to also support DECLARE LOCAL
TEMPORARY TABLE, for a table for which the name would only be in
scope within a given code block, but that wouldn't require breaking
the existing syntax, as far as I can see.
In terms of roll-out, I think a warning for at least a release or two
before actually throwing an error would make sense, even for GLOBAL.
If we seriously think that global temporary tables might be a 9.3
item, maybe a notice or warning in 9.2 could be justified; but we are
on the second beta, so we need a pretty solid reason for any
behavioral change at this point.
-Kevin


On Sat, Jun 9, 2012 at 1:09 PM, Kevin Grittner
<Kevin.Grittner@wicourts.gov> wrote:
> Simon Riggs  wrote:
>> On 9 June 2012 16:46, Tom Lane  wrote:
>>> Simon Riggs  writes:
>>>> Add ERROR msg for GLOBAL/LOCAL TEMP is not yet implemented
>>>
>>> I don't believe there was actual consensus for this change,
>>
>> It was hardly a subject of marked disagreement.
>
> Regarding GLOBAL, the three comments so far have been along the same
> lines.  But I assumed this was a 9.3 discussion.

I assumed it was a 9.2 discussion.

>> Why would we do it for GLOBAL but not LOCAL also?
>
> Because the current support for temporary tables is relatively
> similar to the standard's description of LOCAL TEMPORARY TABLES, but
> nothing at all like the standard's descri0ption of GLOBAL TEMPORARY
> TABLES.  Now, I would love for us to also support DECLARE LOCAL
> TEMPORARY TABLE, for a table for which the name would only be in
> scope within a given code block, but that wouldn't require breaking
> the existing syntax, as far as I can see.

+1.  I definitely see no point in complaining about LOCAL TEMP.

> In terms of roll-out, I think a warning for at least a release or two
> before actually throwing an error would make sense, even for GLOBAL.
> If we seriously think that global temporary tables might be a 9.3
> item, maybe a notice or warning in 9.2 could be justified; but we are
> on the second beta, so we need a pretty solid reason for any
> behavioral change at this point.

I am not sure that an ERROR on GLOBAL TEMP will break very much; there
is little reason for anyone to be using that syntax.  However, a
WARNING is OK with me, too.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


"Kevin Grittner" <Kevin.Grittner@wicourts.gov> writes:
> Because the current support for temporary tables is relatively
> similar to the standard's description of LOCAL TEMPORARY TABLES, but
> nothing at all like the standard's descri0ption of GLOBAL TEMPORARY
> TABLES.

Um ... did you read the spec before stating that?  In the previous
discussion of this, back in 2003, we concluded that LOCAL TEMP is
even further away from our current semantics than GLOBAL TEMP, because
the former means "local to a SQL module" and we don't have modules.

http://archives.postgresql.org/pgsql-hackers/2003-04/msg00502.php
        regards, tom lane