Re: what is difference between LOCAL and GLOBAL TEMP TABLES in PostgreSQL

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: what is difference between LOCAL and GLOBAL TEMP TABLES in PostgreSQL
Date: 2007-07-01 21:46:46
Message-ID: 17505.1183326406@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com> writes:
> if I understand well, there isn't any difference between local and
> global temp tables in postgresql.

See the archives; some time ago we determined that the correct reading
of the spec is that global/local determines visibility of temp tables
across modules, but still within a single session. Since we don't have
modules there is no difference for us.

> I have question. Is correct implementation of global temp in Oracle or
> Firebird, where content of glob.temp table is session visible and
> metadata of g.t.t is persistent?

It's correct per spec. Whether it's more useful than what we do is
highly debatable --- it forces all sessions to use the same definition
of any given temp table name, which is a bit silly for something that's
supposed to support session-local data.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Eric 2007-07-02 02:20:08 Re: GiST consistent function, expected arguments; multi-dimensional indexes
Previous Message Tom Lane 2007-07-01 21:40:42 Re: Restartable signals 'n all that