Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: temp table existence



------------- Original message ----------------------
From: "Marcin Krawczyk" <jankes(dot)mk(at)gmail(dot)com>
> Hi all. Is there a way to determine the existence of a TEMP
> TABLE? I need to check i it exists before I create it. Doing simple
> check on pg_class or pg_tables is
> not enough because there may be other such tables created in other sessions.
> Or maybe anyone knows the identification (apart from 'others') of error to
> trap it with EXCEPTION clause?

select  *  from temp_table limit 1;
Trap error 42P01 Undefined table.

--
Adrian Klaver
aklaver(at)comcast(dot)net

 -

--- Begin Message --- Hi all. Is there a way to determine the existence of a TEMP TABLE? I need to check i it exists before I create it. Doing simple check on pg_class or pg_tables is
not enough because there may be other such tables created in other sessions. Or maybe anyone knows the identification (apart from 'others') of error to trap it with EXCEPTION clause?

--- End Message ---


Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group