Skip site navigation (1) Skip section navigation (2)

Re: Shouldn't psql -1 imply ON_ERROR_STOP?

From: Bernd Helmle <mailings(at)oopsware(dot)de>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Shouldn't psql -1 imply ON_ERROR_STOP?
Date: 2009-07-25 20:58:27
Message-ID: D0D7895C7E76DF3DCA08EF9D@teje (view raw or flat)
Thread:
Lists: pgsql-hackers
--On Samstag, Juli 25, 2009 16:00:18 +0300 Peter Eisentraut 
<peter_e(at)gmx(dot)net> wrote:

> When you run a file with psql -1/--single-transaction, and a command
> fails,  you get bombarded with
>
> ERROR:  current transaction is aborted, commands ignored until end of
> transaction block
>
> for the rest of the file.
>
> Shouldn't -1 imply ON_ERROR_STOP or some variant by default?

Only if it could ensured that embedded SAVEPOINTS can be handled 
properly...a quick check shows that ON_ERROR_STOP will stop any script even 
when the errorneous command is probably rolled back by a subsequent 
ROLLBACK TO:

SELECT 1;

SAVEPOINT A;

SELECT et; <-- ON_ERROR_STOP stops here

ROLLBACK TO A;

SELECT 2;

It seems -1 needs some smarter variant of ON_ERROR_STOP.

-- 
  Thanks

                    Bernd

pgsql-hackers by date

Next:From: Robert HaasDate: 2009-07-25 21:31:51
Subject: Re: Patch for 8.5, transformationHook
Previous:From: Robert HaasDate: 2009-07-25 20:39:29
Subject: Re: SE-PostgreSQL Specifications

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group