How can I do conditional 'drop table' in Postgres

From: Dragan Matic <mlists(at)panforma(dot)co(dot)yu>
To: pgsql-general(at)postgresql(dot)org
Subject: How can I do conditional 'drop table' in Postgres
Date: 2004-05-07 10:51:56
Message-ID: 409B6A4C.6070401@panforma.co.yu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

if exists (select * from sysobjects where id =
object_id(N'[dbo].[pp_fisk]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[pp_fisk]
GO

For instance, this is a valid script in Ms SQL, it will drop table
pp_fisk only if it exists, is there a way to do something similar in
Postgres? Tnx in advance.

Dragan

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Együd Csaba 2004-05-07 11:13:52 Re: Removing OIDs without recreate
Previous Message Karel Zak 2004-05-07 10:14:11 Re: Removing OIDs without recreate