Re: Make ON_ERROR_STOP stop on shell script failure

From: walther(at)technowledgy(dot)de
To: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>, bt22nakamorit <bt22nakamorit(at)oss(dot)nttdata(dot)com>, Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Make ON_ERROR_STOP stop on shell script failure
Date: 2022-09-28 06:36:00
Message-ID: 481f228c-ce59-355a-ff48-202d50d30d54@technowledgy.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Fujii Masao:
> One concern about this patch is that some applications already depend on
> the current behavior of ON_ERROR_STOP, i.e., psql doesn't stop even when
> the shell command returns non-zero exit code. If so, we might need to
> extend ON_ERROR_STOP so that it accepts the following setting values.

I just got bitten by this and I definitely consider this a bug. I expect
psql to stop when a shell script fails and I have ON_ERROR_STOP set. I
don't think this should be made more complicated with different settings.

If someone needs to have ON_ERROR_STOP set, but continue execution after
a certain shell command, they could still do something like this:

\! might_fail || true

Best

Wolfgang

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Benjamin Coutu 2022-09-28 07:04:31 Re: Insertion Sort Improvements
Previous Message Tom Lane 2022-09-28 06:27:33 Re: longfin and tamandua aren't too happy but I'm not sure why