pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jeff Davis <pgsql@j-davis.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Heikki Linnakangas <hlinnakangas@vmware.com>
Cc: Pg Bugs <pgsql-bugs@postgresql.org>
Subject: Re: Bug with temporary child of a permanent table after recovery
Date: Mon, 17 Dec 2012 16:03:03 -0500
Message-ID: <7104.1355778183@sss.pgh.pa.us> (raw)
In-Reply-To: <1355776026.24766.39.camel@sussancws0025>
References: <50CB1455.3080002@vmware.com>
	<2959.1355507033@sss.pgh.pa.us>
	<8740.1355525814@sss.pgh.pa.us>
	<1355534626.32384.6.camel@sussancws0025>
	<7383.1355693030@sss.pgh.pa.us>
	<28278.1355710658@sss.pgh.pa.us>
	<1355776026.24766.39.camel@sussancws0025>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

Jeff Davis <pgsql@j-davis.com> writes:
> On Sun, 2012-12-16 at 21:17 -0500, Tom Lane wrote:
>> One thing I noticed that maybe needs more work is that tablecmds.c in
>> general seems mighty willing to hack upon temp tables belonging to other
>> sessions.  I added tests for that in the places where there already were
>> checks on relpersistence, but I wonder whether we ought not simply
>> forbid all forms of ALTER on nonlocal temp rels, right up at the top.

> Do you see any path where an ALTER can get a hold on a non-local temp
> table? Or do you just mean as a sanity check? Either way, blocking it at
> the top sounds good to me.

Well, if you're not a superuser then you shouldn't be able to access
non-local temp tables at all, because they live in schemas you won't
have permissions for.  So what we're discussing here is mainly just
protecting superusers from shooting themselves in the foot.  But, given
that there are any protections at all against non-local temp tables in
the code (and there are quite a number of such checks), I'm wondering
why ALTER TABLE doesn't have a blanket rejection.  Even for catalog
updates that don't involve direct touches of the file data (which is
certainly unsafe because of local vs shared buffer handling), it seems
risky because we also have various places that skip taking locks on
local temp tables.

			regards, tom lane


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (8+ messages)

Message-ID: <7104.1355778183@sss.pgh.pa.us>
Permalink:  ../7104.1355778183@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/7104.1355778183@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pgsql@j-davis.com, robertmhaas@gmail.com, hlinnakangas@vmware.com
  Subject: Re: Bug with temporary child of a permanent table after recovery
  In-Reply-To: <7104.1355778183@sss.pgh.pa.us>
  References: <50CB1455.3080002@vmware.com> <2959.1355507033@sss.pgh.pa.us> <8740.1355525814@sss.pgh.pa.us> <1355534626.32384.6.camel@sussancws0025> <7383.1355693030@sss.pgh.pa.us> <28278.1355710658@sss.pgh.pa.us> <1355776026.24766.39.camel@sussancws0025> <7104.1355778183@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox