Re: Incremental results from libpq - Mailing list pgsql-interfaces

From Tom Lane
Subject Re: Incremental results from libpq
Date
Msg-id 20610.1132189463@sss.pgh.pa.us
Whole thread Raw
In response to Re: Incremental results from libpq  (Alvaro Herrera <alvherre@commandprompt.com>)
List pgsql-interfaces
Alvaro Herrera <alvherre@commandprompt.com> writes:
> Bruce Momjian wrote:
>> How is it better than what we have now?

> Global temporary tables are defined only once (not once per session),
> and the schema (definition) is known to all sessions.  Only the content
> is private to each session.

Basically, this trades off ease of initialization (you don't have to
create the table in each session, 'cause it's already there) for
flexibility (all sessions have to use the same definition of the same
temp table name).

Note that it's *not* global vs local temp tables; that distinction, in
the spec, has to do with visibility across module boundaries, an issue
that we do not have because we do not have modules.  In the spec, all
temp tables act this way, and there's actually no way to produce the
effect we have of fully session-local temp tables.  I don't think we
want to buy into the spec definition completely.

Still, I can think of lots of applications where all users of the
database are running basically the same code and so there's no real need
for session-private temp table schemas.  In that scenario it's
definitely simpler if functions don't have to worry about creating a
temp table before they can use it.
        regards, tom lane


pgsql-interfaces by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Incremental results from libpq
Next
From: "Goulet, Dick"
Date:
Subject: Re: Incremental results from libpq