Re: Temp table exists test??

From: Michael Guerin <guerin(at)rentec(dot)com>
To: Michael Fuhr <mike(at)fuhr(dot)org>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Temp table exists test??
Date: 2005-02-04 02:39:08
Message-ID: 4202E04C.8030705@rentec.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

I'm trying to detect the existence of a temp table in a function for
that connection.

So,

Connection 1:
Create table foo (i int);

Connection 2:
select * from pg_class where relname = 'foo'

returns the table from connection 1, however I need to know if there's a
temp table foo for connection 2 not connection 1. Each row in pg_class
is associated with a namespace, so I'm looking for something like:

select * from pg_class where relname = 'foo' and relnamespace = ???

-Michael

Michael Fuhr wrote:

>On Thu, Feb 03, 2005 at 08:16:30PM -0500, Michael Guerin wrote:
>
>
>> Is there a way to find out the namespace id (relnamespace) for your
>>connection?
>>
>>
>
>It's not clear what you're trying to do. Are you looking for
>current_schema()? Or maybe one of the other system information
>functions?
>
>http://www.postgresql.org/docs/8.0/static/functions-info.html
>
>
>

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Mike G. 2005-02-04 02:52:28 Re: how to generate printed output of queries
Previous Message Ramon Orticio 2005-02-04 02:32:27 how to generate printed output of queries