Re: Check the existance of temporary table - Mailing list pgsql-general

From Tom Lane
Subject Re: Check the existance of temporary table
Date
Msg-id 8345.1174845383@sss.pgh.pa.us
Whole thread Raw
In response to Check the existance of temporary table  ("dfx" <dfx@dfx.it>)
Responses Re: Check the existance of temporary table  ("Dmitry Koterov" <dmitry@koterov.ru>)
List pgsql-general
"dfx" <dfx@dfx.it> writes:
> how I can check  the existance of temporary table?
> I.e. wich query I have to use to know if MY_TEMP_TABLE exists?

As of 8.2 you can do

SELECT ... FROM pg_class
  WHERE relname = 'whatever' AND relnamespace = pg_my_temp_schema();

In earlier releases pg_my_temp_schema() isn't built in, so you have
to do some pushups to determine which schema is your temp schema.

            regards, tom lane

pgsql-general by date:

Previous
From: "Webb Sprague"
Date:
Subject: Re: Matrix (linear algebra) operations and types in PG?
Next
From: Joe Conway
Date:
Subject: Re: Matrix (linear algebra) operations and types in PG?