Re: conditionally terminate psql script - Mailing list pgsql-general

From hamann.w@t-online.de
Subject Re: conditionally terminate psql script
Date
Msg-id wolfgang-1181217140722.A0520644@noten19.local
Whole thread Raw
In response to Re: conditionally terminate psql script  (Pavel Stehule <pavel.stehule@gmail.com>)
Responses Re: conditionally terminate psql script  (Pavel Luzanov <p.luzanov@postgrespro.ru>)
Re: conditionally terminate psql script  (Jerry Sievers <jerry.sievers@comcast.net>)
Re: conditionally terminate psql script  (Torsten Förtsch <tfoertsch123@gmail.com>)
List pgsql-general
Hi,

many thanks -- too bad I am still using 9.3

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
>> >
>> >
>> >
>>






pgsql-general by date:

Previous
From: Pavel Luzanov
Date:
Subject: Re: conditionally terminate psql script
Next
From: Pavel Luzanov
Date:
Subject: Re: conditionally terminate psql script