From: Jerry Sievers <jerry.sievers@comcast.net>
To: hamann.w@t-online.de
Cc: pgsql-general@lists.postgresql.org
Subject: Re: conditionally terminate psql script
Date: Mon, 17 Dec 2018 09:01:10 -0600
Message-ID: <87efag2o5l.fsf@jsievers.enova.com> (raw)
In-Reply-To: <wolfgang-1181217140722.A0520644@noten19.local>
References: <wolfgang-1181217140722.A0520644@noten19.local>
hamann.w@t-online.de writes:
> Hi,
>
> many thanks -- too bad I am still using 9.3
Just because your server backend is 9.3 does not rule out using much
newer clients, such as psql.
HTH
>
> Best regards
> Wolfgang
>
>>> Hi
>>> >> po 17. 12. 2018 v 13:14 odesÃlatel <hamann.w@t-online.de> napsal:
>>> >> >
>>> >
>>> > Hi,
>>> >
>>> > is there a way to stop execution of a psql script if a select returns some
>>> > rows (or no rows)
>>> > The idea is to add a safety check on data, specifically to select all new
>>> > rows that would conflict
>>> > on a bulk insert, show them and stop
>>> >
>>> >> you need psql from PostgreSQL 10 and higher
>>> >> there is a \if statement
>>> >> Regards
>>> >> Pavel
>>> >> >
>>> > Best regards
>>> > Wolfgang
>>> >
>>> >
>>> >
>>>
>
>
>
>
>
>
--
Jerry Sievers
e: jerry.sievers@comcast.net
p: 312.241.7800
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-general@postgresql.org
Cc: jerry.sievers@comcast.net, hamann.w@t-online.de
Subject: Re: conditionally terminate psql script
In-Reply-To: <87efag2o5l.fsf@jsievers.enova.com>
References: <wolfgang-1181217140722.A0520644@noten19.local> <87efag2o5l.fsf@jsievers.enova.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