Re: stopping execution of a script (on error)

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Olivier Chapiteau <ochapiteau(at)cyberdeck(dot)net>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: stopping execution of a script (on error)
Date: 2001-06-14 16:34:55
Message-ID: Pine.LNX.4.30.0106141834350.2008-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)gmx(dot)net http://funkturm.homeip.net/~peter

In response to

Browse pgsql-general by date

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