Re: stopping execution of a script (on error) - Mailing list pgsql-general

From Peter Eisentraut
Subject Re: stopping execution of a script (on error)
Date
Msg-id Pine.LNX.4.30.0106141834350.2008-100000@peter.localdomain
Whole thread Raw
In response to stopping execution of a script (on error)  (Olivier Chapiteau <ochapiteau@cyberdeck.net>)
List pgsql-general
Olivier Chapiteau writes:

> Is it possible to stop the execution of a sql script in case of problem ?
>
> ex :
>
> create table newtable as select * from oldtable
> DROP TABLE oldtable
>
> I don't want to drop the table if the first instruction did not work properly

In psql:

\set ON_ERROR_STOP

--
Peter Eisentraut   peter_e@gmx.net   http://funkturm.homeip.net/~peter


pgsql-general by date:

Previous
From: Olivier Chapiteau
Date:
Subject: stopping execution of a script (on error)
Next
From: Arcady Genkin
Date:
Subject: Re: PHP's pg_connect() and non-standard location of the socket (was: REPOST: redefining location of the socket file /tmp/.s.PGSQL.5432)