Received: from candle.pha.pa.us (216-55-132-35.dsl.san-diego.abac.net [216.55.132.35]) by postgresql.org (Postfix) with ESMTP id F26C9475D00 for ; Mon, 25 Mar 2002 16:05:34 -0500 (EST) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.10.1) id g2PL5TD16361; Mon, 25 Mar 2002 16:05:29 -0500 (EST) From: Bruce Momjian Message-Id: <200203252105.g2PL5TD16361@candle.pha.pa.us> Subject: Re: About temporary table In-Reply-To: <00e501c1d3e6$4ea1a600$1400a8c0@jac> To: jack Date: Mon, 25 Mar 2002 16:05:29 -0500 (EST) Cc: pgsql-sql@postgresql.org X-Mailer: ELM [version 2.4ME+ PL97 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Archive-Number: 200203/330 X-Sequence-Number: 7205 jack wrote: > > ----- Original Message ----- > From: "David Stanaway" > To: "jack" > Sent: Monday, March 25, 2002 2:17 PM > Subject: Re: [SQL] About temporary table > > > > > > ----- Original Message ----- > > From: jack > > To: > > Sent: Sunday, March 24, 2002 10:11 PM > > Subject: Re: [SQL] About temporary table > > > You can see if its in the relevant system tables, then drop it. > > But how can we find the exact name of a temporary table? Or do you know > which system table has the name mapping? There is actually no way to know the name from the table name, but if there is only one temp table, pg_class will have the oid of the backend in the table name. To get the backend pid, you can use libpq's PQbackendPID() function or do this: create function getpid () returns int as '/shlib/libc.so' language 'c'; test=> select getpid(); getpid -------- 16011 (1 row) -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 853-3000 + If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup. | Drexel Hill, Pennsylvania 19026