pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: David Johnston <david.g.johnston@gmail.com>
Cc: pgsql-general@postgresql.org <pgsql-general@postgresql.org>
Cc: pgsql-bugs@postgresql.org <pgsql-bugs@postgresql.org>
Subject: Re: Rollback on include error in psql
Date: Mon, 29 Dec 2014 16:09:16 -0800
Message-ID: <54A1ED2C.2070701@aklaver.com> (raw)
In-Reply-To: <CAKFQuwaM6Uniq+aDGF=Mfo4ec80WaxrEYNBrYd+hf-w0c2X+-w@mail.gmail.com>
References: <CAK7FUCxR2cozA3ZTtPqUKgivFXBpPz=kJrfX6oWH5V5QtpnQBA@mail.gmail.com>
	<54A01E44.9050105@aklaver.com>
	<CAK7FUCxx8KHZ-nKb9RjB=S134kP2U8MjmNHLSUGo2Q13rY3Eyw@mail.gmail.com>
	<54A06C58.2020009@aklaver.com>
	<1419815044308-5832233.post@n5.nabble.com>
	<54A17800.1010700@aklaver.com>
	<CAKFQuwa1GOsfNc05rfCQ5X=WA9xwgVxbQWxs+uqmRCB+HEaw=g@mail.gmail.com>
	<54A183C5.1080500@aklaver.com>
	<CAKFQuwbPxVT+bKoGdT1KCmJUBSCGgQw+Epv7AbndcrDwWpP_Zw@mail.gmail.com>
	<54A18A25.50303@aklaver.com>
	<CAKFQuwaqyzRc1Dpt2HDm09OYUGZ9ysZ6406-Wj6QJkLnT_qrdw@mail.gmail.com>
	<54A1D0BA.4080609@aklaver.com>
	<CAKFQuwaEKnoP1i8CpHwn9_H1Wma5vRf13oinz1tdZ=MOpYek7Q@mail.gmail.com>
	<54A1D7BF.3060300@aklaver.com>
	<CAKFQuwYkfuxRrpKSe1n3wAgN+QTfXL3F7UCHmdvtm9KUX7gwkw@mail.gmail.com>
	<54A1E5F6.2000100@aklaver.com>
	<CAKFQuwaM6Uniq+aDGF=Mfo4ec80WaxrEYNBrYd+hf-w0c2X+-w@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-general>

On 12/29/2014 03:56 PM, David Johnston wrote:
>
>

>
>
> ​So you think psql should issue "COMMIT;" even if it is exiting due to
> "ON_ERROR_STOP"?

I say yes, if it is a non-SQL error. As Viktor stated, SQL errors abort 
the transaction.

>
> Whether you do or don't can you show me where in the documentation the
> current behavior is described?

Your biggest issue seems to be with --single-transaction and 
ON_ERROR_STOP so:

--single-transaction

     When psql executes a script, adding this option wraps BEGIN/COMMIT 
around the script to execute it as a single transaction.

Therefore:

BEGIN;
script
COMMIT;

I would and have agreed with your previous statements that it is not 
clear enough that \i is not an SQL command and an error with same is 
ignored by the transaction. Outside of that I see no problem.

>
> ​David J.​
>


-- 
Adrian Klaver
adrian.klaver@aklaver.com


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



view thread (24+ messages)  latest in thread

Message-ID: <54A1ED2C.2070701@aklaver.com>
Permalink:  ../54A1ED2C.2070701@aklaver.com/
Also on:    postgresql.org/message-id/54A1ED2C.2070701@aklaver.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: adrian.klaver@aklaver.com, david.g.johnston@gmail.com, pgsql-general@postgresql.org
  Subject: Re: Rollback on include error in psql
  In-Reply-To: <54A1ED2C.2070701@aklaver.com>
  References: <CAK7FUCxR2cozA3ZTtPqUKgivFXBpPz=kJrfX6oWH5V5QtpnQBA@mail.gmail.com> <54A01E44.9050105@aklaver.com> <CAK7FUCxx8KHZ-nKb9RjB=S134kP2U8MjmNHLSUGo2Q13rY3Eyw@mail.gmail.com> <54A06C58.2020009@aklaver.com> <1419815044308-5832233.post@n5.nabble.com> <54A17800.1010700@aklaver.com> <CAKFQuwa1GOsfNc05rfCQ5X=WA9xwgVxbQWxs+uqmRCB+HEaw=g@mail.gmail.com> <54A183C5.1080500@aklaver.com> <CAKFQuwbPxVT+bKoGdT1KCmJUBSCGgQw+Epv7AbndcrDwWpP_Zw@mail.gmail.com> <54A18A25.50303@aklaver.com> <CAKFQuwaqyzRc1Dpt2HDm09OYUGZ9ysZ6406-Wj6QJkLnT_qrdw@mail.gmail.com> <54A1D0BA.4080609@aklaver.com> <CAKFQuwaEKnoP1i8CpHwn9_H1Wma5vRf13oinz1tdZ=MOpYek7Q@mail.gmail.com> <54A1D7BF.3060300@aklaver.com> <CAKFQuwYkfuxRrpKSe1n3wAgN+QTfXL3F7UCHmdvtm9KUX7gwkw@mail.gmail.com> <54A1E5F6.2000100@aklaver.com> <CAKFQuwaM6Uniq+aDGF=Mfo4ec80WaxrEYNBrYd+hf-w0c2X+-w@mail.gmail.com> <54A1ED2C.2070701@aklaver.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox