SQL Script Question - Mailing list pgsql-sql

From Carolyn Wong
Subject SQL Script Question
Date
Msg-id 38B37F13.C1D2D6F4@kss.net.au
Whole thread Raw
Responses Re: [SQL] SQL Script Question  (Kovacs Zoltan Sandor <tip@pc10.radnoti-szeged.sulinet.hu>)
List 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.


pgsql-sql by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: [SQL] pg_group system table
Next
From: Andrzej Mazurkiewicz
Date:
Subject: RE: [SQL] SQL Script Question