Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TkhHU-0007RJ-MH for pgsql-bugs@arkaria.postgresql.org; Mon, 17 Dec 2012 20:27:20 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1TkhHT-0002bt-V6 for pgsql-bugs@arkaria.postgresql.org; Mon, 17 Dec 2012 20:27:20 +0000 Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TkhHR-0002bl-Us for pgsql-bugs@postgresql.org; Mon, 17 Dec 2012 20:27:18 +0000 Received: from mail-pb0-f46.google.com ([209.85.160.46]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TkhHO-0004PB-3e for pgsql-bugs@postgresql.org; Mon, 17 Dec 2012 20:27:16 +0000 Received: by mail-pb0-f46.google.com with SMTP id wy7so4277103pbc.19 for ; Mon, 17 Dec 2012 12:27:08 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=subject:from:to:cc:in-reply-to:references:content-type:date :message-id:mime-version:x-mailer:content-transfer-encoding :x-gm-message-state; bh=7gt1+3LdGfzLYghjCqgjZIr8znLBScx8sSm/x9MEiu4=; b=nu4feYsvJgt91/fOYlapcrJOrwDJ6jJ/GbgPACWG2gHpbTmw8Qh+jphzp8tDXaQ8gs gKk4Q0ROdNJZ1cbs0/aVNgnvhRyiJn8j5xyMAtBkZeeBzPItLTb6sxPLUcfdVLxtlreg NWbYpzm0lUVb0aQXJXGNpXXY5z1AnRQNRfDXw4cT8A+R70XW9ok0R3HeFcNMHzV/k+oC 83qW2WBrpR5l3WT5rAL3jpYQaUoZbNeA/+ygk8YvN0VgguYFgPxqJ1J2cET+fi5kHgCB Fsj4Iz8oap70hS6uA0kWUSw0jaL3zq4t0YutOxfBnTIeGitsGy7kUdGLUlvFpEM+8vt+ yG7A== Received: by 10.66.72.225 with SMTP id g1mr45381865pav.79.1355776028401; Mon, 17 Dec 2012 12:27:08 -0800 (PST) Received: from ?IPv6:::1? ([2600:3c01::f03c:91ff:fe93:2ae4]) by mx.google.com with ESMTPS id gj1sm8731743pbc.11.2012.12.17.12.27.06 (version=SSLv3 cipher=OTHER); Mon, 17 Dec 2012 12:27:07 -0800 (PST) Subject: Re: Bug with temporary child of a permanent table after recovery From: Jeff Davis To: Tom Lane Cc: Robert Haas , Heikki Linnakangas , Pg Bugs In-Reply-To: <28278.1355710658@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> Content-Type: text/plain; charset="ISO-8859-1" Date: Mon, 17 Dec 2012 12:27:06 -0800 Message-ID: <1355776026.24766.39.camel@sussancws0025> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQkXq7ZTk3SVt66wgXOcQoMd/7/s6T6+ohnxDzzNNxpX1/bK+BGT7pTxZSDjE2dIjN9Sb6cb X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org On Sun, 2012-12-16 at 21:17 -0500, Tom Lane wrote: > I wrote: > > On the whole I think resurrecting the rd_islocaltemp flag might be the > > best thing. We can keep the use of "relpersistence == > > RELPERSISTENCE_TEMP" to do what rd_istemp used to do, it's just the > > equation of "rd_backend == MyBackendId" with "is my temp table" that's > > bogus. And this way gets rid of some unnecessary cross-branch coding > > differences. > > Here is a draft patch for this. Thoughts/objections? It looks good to me. > 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. Regards, Jeff Davis -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs