Re: Creation of temporary tables on read-only standby servers

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Greg Stark <gsstark(at)mit(dot)edu>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Martijn van Oosterhout <kleptog(at)svana(dot)org>, Andres Freund <andres(at)anarazel(dot)de>, pgsql-hackers(at)postgresql(dot)org, Bruce Momjian <bruce(at)momjian(dot)us>
Subject: Re: Creation of temporary tables on read-only standby servers
Date: 2010-10-19 23:12:57
Message-ID: 11126.1287529977@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Greg Stark <gsstark(at)mit(dot)edu> writes:
> On Tue, Oct 19, 2010 at 3:45 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> Relcache entries alone are not gonna work. There is way too much stuff
>> that assumes that tables are correctly represented in the system
>> catalogs.

> Well we're talking about multiple things now. In the global temporary
> table case they *are* properly represented in the system catalogs.
> Except for their local state such as the actual relfilenode all the
> structural attributes are going to be accurate.

... and relpages and reltuples ... it's really not going to be that easy
to have a table that isn't described in pg_class. Which the structure
you're describing isn't. There might be a template for it in pg_class,
but that's something entirely different.

> In the case of tables created locally on a slave, well, that's more
> complicated.

I think they're more alike than you think. If we had the infrastructure
to do local temp tables this way, it'd be pretty easy to use that to
instantiate per-backend copies of global temp tables. (The global
entities would be templates, not actual tables.)

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Stark 2010-10-19 23:47:18 Re: Creation of temporary tables on read-only standby servers
Previous Message Terry Laurenzo 2010-10-19 23:12:52 Re: patch: Add JSON datatype to PostgreSQL (GSoC, WIP)