Re: Check the existance of temporary table

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: dfx(at)dfx(dot)it
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Check the existance of temporary table
Date: 2007-03-25 17:56:23
Message-ID: 8345.1174845383@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"dfx" <dfx(at)dfx(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Joe Conway 2007-03-25 17:58:33 Re: Matrix (linear algebra) operations and types in PG?
Previous Message Webb Sprague 2007-03-25 17:26:22 Re: Matrix (linear algebra) operations and types in PG?