X-Original-To: pgsql-hackers-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id EF6D2D1B507 for ; Tue, 16 Sep 2003 18:55:24 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 17979-04 for ; Tue, 16 Sep 2003 15:55:15 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id F2821D1B4E2 for ; Tue, 16 Sep 2003 15:55:13 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.9/8.12.9) with ESMTP id h8GItFpr025915; Tue, 16 Sep 2003 14:55:15 -0400 (EDT) To: "Merlin Moncure" Cc: pgsql-hackers@postgresql.org Subject: Re: observations about temporary tables and schemas In-reply-to: <303E00EBDD07B943924382E153890E5434A9D2@cuthbert.rcsinc.local> References: <303E00EBDD07B943924382E153890E5434A9D2@cuthbert.rcsinc.local> Comments: In-reply-to "Merlin Moncure" message dated "Tue, 16 Sep 2003 14:37:32 -0400" Date: Tue, 16 Sep 2003 14:55:14 -0400 Message-ID: <25914.1063738514@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/984 X-Sequence-Number: 43996 "Merlin Moncure" writes: > The other and more interesting way is to manually jump into the > temporary schema (eg. pg_temp_x) that hosts a temp table constructed by > another backend. While this is unlikely to happen in a normal setting, > the server does allow it. Following this, backend X can both see and > manipulate a temporary table set up by backend Y, including table schema > manipulation. Not unless backend X is run by a superuser. There are privilege restrictions against this for ordinary users. The other behaviors you note are consequences of the current implementation and might change in future. > Also, Is the prohibition of using schemas for temp tables a SQL spec > requirement or a technical consideration? The SQL spec's notion of temp tables is only tenuously related to ours in the first place :-(. However, the spec appears to require that references to temp tables be unqualified names, so AFAICT it's not expected that applications can reference more than one schema's worth of temp tables anyway. regards, tom lane