SQL Script Question

From: Carolyn Wong <carolyn(at)kss(dot)net(dot)au>
To: pgsql-sql(at)postgresql(dot)org
Subject: SQL Script Question
Date: 2000-02-23 06:32:51
Message-ID: 38B37F13.C1D2D6F4@kss.net.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

I'm trying to write SQL script to create tables as follows:

--------------------------------
drop table xxx;
create table xxx (
......
);
grant all on xxx to public;
--------------------------------

Before dropping the table, I'd like to check if the table exists as the
following psuedo code:

if <table exists>
drop table xxx;

How can i write this 'if' condition? Or are there any other ways to
check this??

Thanks in advance.

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Andrzej Mazurkiewicz 2000-02-23 10:06:13 RE: [SQL] SQL Script Question
Previous Message Peter Eisentraut 2000-02-23 01:20:31 Re: [SQL] pg_group system table