Re: Temp table exists test?? - Mailing list pgsql-novice

From Michael Guerin
Subject Re: Temp table exists test??
Date
Msg-id 4202E04C.8030705@rentec.com
Whole thread Raw
In response to Re: Temp table exists test??  (Michael Fuhr <mike@fuhr.org>)
Responses Re: Temp table exists test??
Re: Temp table exists test??
List 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
>
>
>


pgsql-novice by date:

Previous
From: Michael Fuhr
Date:
Subject: Re: Temp table exists test??
Next
From: "Mike G."
Date:
Subject: Re: how to generate printed output of queries