if exists / where exisyts....

From: Denis Cartier Millon <Denis(dot)CM(at)Wanadoo(dot)fr>
To: pgsql-interfaces(at)postgresql(dot)org
Cc: frederic(dot)mougin(at)agriculture(dot)gouv(dot)fr
Subject: if exists / where exisyts....
Date: 2002-05-24 14:12:32
Message-ID: 3CEE4A50.2090802@Wanadoo.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

i want to test if a table exists before to drop this......

the :
if exists (select 1 from pg_tables where tablename = "thetable")
drop table thetable
;

don't work....

i try :

wher e exists (....)
;

don't work.

but the expresssion :
select * from pg_tables where exists(select 1 from pg_tables where
tablename = "thetable")
;

work

Responses

Browse pgsql-interfaces by date

  From Date Subject
Next Message Ron Johnson 2002-05-24 15:32:08 Re: if exists / where exisyts....
Previous Message Ron Johnson 2002-05-23 16:03:52 Re: libpq - description of columns