Re: psql -c does not honor ON_ERROR_STOP

From: Joe Conway <joe(dot)conway(at)credativ(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: psql -c does not honor ON_ERROR_STOP
Date: 2015-01-07 13:53:05
Message-ID: 54AD3A41.5000208@credativ.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 01/06/2015 12:36 PM, Tom Lane wrote:
> -c submits the entire string to the backend in one PQexec();
> therefore ON_ERROR_STOP cannot have any impact on its behavior.
> The backend will abandon processing the whole string upon first
> error, embedded begin/ commit commands notwithstanding.
>
> There's been repeated discussion of changing -c so that the string
> is split apart and processed more like it would be if it'd been
> read from stdin. However, given the number of ways you can already
> submit a string via stdin, this wouldn't be buying any new
> functionality. Even discounting backwards-compatibility
> considerations, such a change would make it completely impossible
> to test multiple-commands-per-PQexec scenarios using psql. So I'm
> inclined to leave it alone.
>
> Possibly the point is worth documenting explicitly, though.

OK, thanks. I'll submit a proposal for an update to the docs.

Joe

- --
Joseph E Conway
credativ LLC

270 E Douglas Ave
El Cajon, CA 92020

Office: +1 619 270 8787
Mobile: +1 619 843 8340

===================================
USA: http://www.credativ.us
Canada: http://www.credativ.ca
Germany: http://www.credativ.de
Netherlands: http://www.credativ.nl
UK: http://www.credativ.co.uk
India: http://www.credativ.in
===================================
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBAgAGBQJUrTo5AAoJEDfy90M199hl+7AP/jdG9IvJ6jH6GmjTQ8DLQZVu
QiIJYpuE0A5Zr6bNukksX4ItDrvhuERwlLMQelTWhByYYh0CYEQf/4dPs2vPn+QG
ZXRS6CE9YSQ+umab1O05Bdft8CqrQ682C12PxogInwy38NzmspTAbcGDq+Yve9Z4
EMpMN4Jz0sK77N0acTw/HqLNQMwaGSeUAh/1jKnKB85RKpLgkHmTpuQhrQwZ7mfY
CJdUbyBUj9PGTHkEtUaRtUU9FF+KAax2OX6KDaC8neZ9YF1hMv4CkA5jOr8Hm2yL
JQJCjjC1wCt5e4VN+/d0lNsBj7/CCLPpzy4rnOUEEJOCqe/n6dc65tC72B2zirTH
5gWHkI3rC4EeoWVm9oxutEmhG5ocLv7aTTr7ZUXwEPHk+U3MMbgFfrz1VF6z6Ymp
t6LcWztBR+VLlXPiHwCSDNKenSimyDWACuIJcGArTf5BZmekRGpLW03bgnJkjXSZ
IEXyqcAGw7Tac7t12cZ/f4sDsWWM+yOOIdq82SsXJ052P1patl5l1H1aU5Tek7WE
qYwEFOMD8e2bCqOHm8Ij94ZymfN5eirscFL9fcM1QkHHgKsXh5ShUCTwtxHWYlMC
yth50q7mdmrW3Lych1ry0bYBecjF/dOlgjv19hWHZXmuCXU+5uhwbJUzvHOzioiJ
SfbED2GriwGDudEtgHnb
=qdOf
-----END PGP SIGNATURE-----

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2015-01-07 14:24:02 Re: [COMMITTERS] pgsql: Change how first WAL segment on new timeline after promotion is
Previous Message Heikki Linnakangas 2015-01-07 13:51:47 Re: pg_rewind in contrib