pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Carolyn Wong <carolyn@kss.net.au>
To: pgsql-sql@postgresql.org
Subject: SQL Script Question
Date: Wed, 23 Feb 2000 17:32:51 +1100
Message-ID: <38B37F13.C1D2D6F4@kss.net.au> (raw)

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.



view thread (3+ messages)  latest in thread

Message-ID: <38B37F13.C1D2D6F4@kss.net.au>
Permalink:  ../38B37F13.C1D2D6F4@kss.net.au/
Also on:    postgresql.org/message-id/38B37F13.C1D2D6F4@kss.net.au

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: carolyn@kss.net.au
  Subject: Re: SQL Script Question
  In-Reply-To: <38B37F13.C1D2D6F4@kss.net.au>
  References: <38B37F13.C1D2D6F4@kss.net.au>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox