Re: [GENERAL] Check the existance of temporary table

2007-03-26 Thread Patrick TJ McPhee
In article <[EMAIL PROTECTED]>, Martin Gainty <[EMAIL PROTECTED]> wrote: % Assuming your schema will be pg_temp_1 Not a particularly reasonable assumption... % vi InitialTableDisplayStatements.sql % select * from pg_tables where pg_namespace = 'pg_temp1'; pmcphee=# select * from pg_tables wher

Re: [GENERAL] Check the existance of temporary table

2007-03-25 Thread Dmitry Koterov
In stored procedures I used something like BEGIN CREATE TEMPORARY TABLE tmp ... EXCEPTION WHEN ... THEN ... END See pg error codes for details (I don't remember exactly, but maybe it is a dumplicate_table or duplicate_object exception). On 3/25/07, Tom Lane <[EMAIL PROTECTED]> wrote: "d

Re: [GENERAL] Check the existance of temporary table

2007-03-25 Thread Tom Lane
"dfx" <[EMAIL PROTECTED]> 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_tem

Re: [GENERAL] Check the existance of temporary table

2007-03-25 Thread Martin Gainty
Domenico- Assuming your schema will be pg_temp_1 vi InitialTableDisplayStatements.sql select * from pg_tables where pg_namespace = 'pg_temp1'; /usr/local/pgsql/bin/psql -f InitialTableDisplayStatements.sql -U username -h dbname -p Port > db.out then write a quick java app to parse the db.out c