Re: what is difference between LOCAL and GLOBAL TEMP TABLES in PostgreSQL - Mailing list pgsql-hackers

From Tom Lane
Subject Re: what is difference between LOCAL and GLOBAL TEMP TABLES in PostgreSQL
Date
Msg-id 27473.1183431616@sss.pgh.pa.us
Whole thread Raw
In response to Re: what is difference between LOCAL and GLOBAL TEMP TABLES in PostgreSQL  (Alvaro Herrera <alvherre@commandprompt.com>)
Responses Re: what is difference between LOCAL and GLOBAL TEMP TABLES in PostgreSQL  ("Pavel Stehule" <pavel.stehule@gmail.com>)
Re: what is difference between LOCAL and GLOBAL TEMP TABLES in PostgreSQL  (Gregory Stark <stark@enterprisedb.com>)
Re: what is difference between LOCAL and GLOBAL TEMP TABLES in PostgreSQL  (Bruce Momjian <bruce@momjian.us>)
List pgsql-hackers
Alvaro Herrera <alvherre@commandprompt.com> writes:
> Tom Lane escribi�:
>> I rather doubt that.  The most likely implementation would involve
>> cloning a "template" entry into pg_class.

> How about a new relkind which causes the table to be located in
> PGDATA/base/<dboid>/pg_temp_<backendid>/<relfilenode>
> So each backend can have its own copy of the table with the same
> relfilenode; there's no need for extra catalog entries.

Uh-huh.  And what do you do with relpages, reltuples, relfrozenxid, and
pg_statistic entries?  What if one backend wants to TRUNCATE or CLUSTER
its copy (requiring a new relfilenode)?  Where does ALTER TABLE fit into
this?
        regards, tom lane


pgsql-hackers by date:

Previous
From: Gregory Stark
Date:
Subject: Re: what is difference between LOCAL and GLOBAL TEMP TABLES in PostgreSQL
Next
From: Robert Treat
Date:
Subject: Re: Still recommending daily vacuum...