Re: Temporary tables under hot standby

From: Nicolas Barbier <nicolas(dot)barbier(at)gmail(dot)com>
To: Simon Riggs <simon(at)2ndquadrant(dot)com>
Cc: Noah Misch <noah(at)leadboat(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Temporary tables under hot standby
Date: 2012-04-25 08:37:16
Message-ID: CAP-rdTbbndhGB2x_3YTgbRyTkk5d6VMBMttrRWW-SrwUE=OwfA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2012/4/25 Simon Riggs <simon(at)2ndquadrant(dot)com>:

> On Wed, Apr 25, 2012 at 4:55 AM, Noah Misch <noah(at)leadboat(dot)com> wrote:
>
>> I do not see a clean behind-the-scenes fix for points 1, 4 and 5.  We can
>> resolve those by adding a new variety of temporary table, one coincidentally
>> matching the SQL standard's notion of a temporary table.  The developer will
>> declare it once, after which all sessions observe it as an initially-empty
>> table whose contents remain local to the session.

[..]

> I don't see how introducing a new type of temp table solves this
> problem. How would the developer declare this in HS? How would it then
> be globally visible without using global OIDs, causing sinval and
> using global locks?

The declarative creation of an “standard-like” temporary table only
happens once (it is part of the schema). Using (e.g. putting stuff in
and executing queries on) such tables can happen on the standby
without the master having to know.

Therefore, I don't see the problem. Just schedule issuing the creation
along with any other schema-changes on the master.

Nicolas

--
A. Because it breaks the logical sequence of discussion.
Q. Why is top posting bad?

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2012-04-25 09:10:31 Re: Temporary tables under hot standby
Previous Message Simon Riggs 2012-04-25 08:04:54 Re: Temporary tables under hot standby