From: | Michael Fuhr <mike(at)fuhr(dot)org> |
---|---|
To: | "Walsh, Richard (Richard)" <richardwalsh(at)avaya(dot)com> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: dropping non-existent tables |
Date: | 2005-07-26 22:08:34 |
Message-ID: | 20050726220834.GA84496@winnie.fuhr.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Tue, Jul 26, 2005 at 06:04:08PM +0200, Walsh, Richard (Richard) wrote:
> I have a problem in that I need to drop non-existent tables in a DDL
> script. This is in order that the script can re-build a database schema
> if the tables already exist. However, in Postgres this is proving to be
> a problem because if the table does not exist then the DDL execution
> will stop once it gets an error.
Are you executing the statements inside a transaction? If so then
you could execute the DROP statements in separate transactions (or
execute them outside of any transaction in autocommit mode). Also,
if you're using psql then make sure you don't have ON_ERROR_STOP set.
In PostgreSQL 8.1, psql will have an ON_ERROR_ROLLBACK setting that
uses savepoints to automatically roll back failed statements while
allowing the rest of the transaction to continue.
--
Michael Fuhr
http://www.fuhr.org/~mfuhr/
From | Date | Subject | |
---|---|---|---|
Next Message | Martijn van Oosterhout | 2005-07-26 22:09:50 | Re: transaction timeout |
Previous Message | Joseph Shraibman | 2005-07-26 22:00:20 | Re: Problem with text_pattern_ops |