Determining if table exists before dropping - Mailing list pgsql-general

From Dwayne Miller
Subject Determining if table exists before dropping
Date
Msg-id 3E6CB696.2090606@espgroup.net
Whole thread Raw
List pgsql-general
Is there any way of wrapping a DROP TABLE statement within a test in a
psql script?  I've constructed a script that should DROP a table if it
exists before trying to CREATE the table.  I'm passing this script in as
a command from a C program using PQsendQuery().  And the first DROP
statement results in an error being returned when the TABLE does not
exist.  The rest of the statements are ignored.  psql processes the
script to completion even though an error is generated.  I would like
the script to return an error if some other error was encountered.

Perhaps there is a way to treat this error as a warning?

Tks,
Dwayne


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: [NOVICE] General Performance questions
Next
From: Steve Crawford
Date:
Subject: Re: [NOVICE] General Performance questions