Re: Temp table exists test??

Поиск
Список
Период
Сортировка
От Michael Guerin
Тема Re: Temp table exists test??
Дата
Msg-id 4202E04C.8030705@rentec.com
обсуждение исходный текст
Ответ на Re: Temp table exists test??  (Michael Fuhr <mike@fuhr.org>)
Ответы Re: Temp table exists test??  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Temp table exists test??  (Michael Fuhr <mike@fuhr.org>)
Список 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 по дате отправления:

Предыдущее
От: Michael Fuhr
Дата:
Сообщение: Re: Temp table exists test??
Следующее
От: "Mike G."
Дата:
Сообщение: Re: how to generate printed output of queries