Re: psql question: aborting a "script"

From: Francisco Olarte <folarte(at)peoplecall(dot)com>
To: Melvin Davidson <melvin6925(at)gmail(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: psql question: aborting a "script"
Date: 2016-03-15 15:05:03
Message-ID: CA+bJJbzMpG6vfiEqdX+GHe908UVgA3=8OfkyBe92NH7apMVxJg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi Melvin:

On Tue, Mar 15, 2016 at 3:57 PM, Melvin Davidson <melvin6925(at)gmail(dot)com> wrote:
> What you really want is
> "ON_ERROR_STOP
...
> So just
> SET ON_ERROR_STOP = ON
> before any other statements

IIRC you are right with the variable ... BUT .. it is a psql setting,
not a session setting, so he'll probably need to use the \set psql
mettacommand:

\set ON_ERROR_STOP on

and also, use on as suggested on the docs, not ON, I'm not sure wether
PSQL is case sensitive.

Francisco Olarte.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Matthias Schmitt 2016-03-15 15:10:44 pg_dump crashing
Previous Message Albe Laurenz 2016-03-15 15:02:46 Re: psql question: aborting a "script"