Re: how do I check if a temporary table exists?

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: "D'Arcy J(dot)M(dot) Cain" <darcy(at)druid(dot)net>
Cc: datactrl <quals(at)bigfoot(dot)com>, pgsql-sql(at)postgresql(dot)org, roelof(dot)sondaar(at)scania(dot)com
Subject: Re: how do I check if a temporary table exists?
Date: 2001-03-24 16:44:18
Message-ID: 200103241644.LAA17614@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Multiple backends can create temp tables with the same name and each
person will see their own version.

> Thus spake datactrl
> > How do I check if a temporary table exists? Searching pg_tables with a
> > temporary table name we chose always fails.
>
> What do you mean? You know that it exists because you just created it
> and the create succeeded. Can you describe a situation where you need
> to know about a temp table and don't already know?
>
> It can't go into the pg_tables table because then it would be visible
> to other processes. Are you perhaps misunderstanding temp tables? You
> cannot see them except from the process that created them.
>
> --
> D'Arcy J.M. Cain <darcy(at){druid|vex}.net> | Democracy is three wolves
> http://www.druid.net/darcy/ | and a sheep voting on
> +1 416 425 1212 (DoD#0082) (eNTP) | what's for dinner.
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2001-03-24 17:06:41 Re: all views in database broken at once
Previous Message Tom Lane 2001-03-24 16:39:43 Re: how do I check if a temporary table exists?