pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Momjian <pgman@candle.pha.pa.us>
To: jack <datactrl@tpg.com.au>
Cc: pgsql-sql@postgresql.org
Subject: Re: About temporary table
Date: Mon, 25 Mar 2002 16:05:29 -0500 (EST)
Message-ID: <200203252105.g2PL5TD16361@candle.pha.pa.us> (raw)
In-Reply-To: <00e501c1d3e6$4ea1a600$1400a8c0@jac>

jack wrote:
> 
> ----- Original Message -----
> From: "David Stanaway" <David@Stanaway.net>
> To: "jack" <datactrl@tpg.com.au>
> Sent: Monday, March 25, 2002 2:17 PM
> Subject: Re: [SQL] About temporary table
> 
> 
> >
> > ----- Original Message -----
> > From: jack <datactrl@tpg.com.au>
> > To: <pgsql-sql@postgresql.org>
> > 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



view thread (7+ messages)  latest in thread

Message-ID: <200203252105.g2PL5TD16361@candle.pha.pa.us>
Permalink:  ../200203252105.g2PL5TD16361@candle.pha.pa.us/
Also on:    postgresql.org/message-id/200203252105.g2PL5TD16361@candle.pha.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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: pgman@candle.pha.pa.us, datactrl@tpg.com.au
  Subject: Re: About temporary table
  In-Reply-To: <200203252105.g2PL5TD16361@candle.pha.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