Re: Make ON_ERROR_STOP stop on shell script failure
От | Peter Eisentraut |
---|---|
Тема | Re: Make ON_ERROR_STOP stop on shell script failure |
Дата | |
Msg-id | 8e940fb8-0e16-0e6f-c4be-e5920b49fd23@enterprisedb.com обсуждение исходный текст |
Ответ на | Re: Make ON_ERROR_STOP stop on shell script failure (Greg Stark <stark@mit.edu>) |
Ответы |
Re: Make ON_ERROR_STOP stop on shell script failure
|
Список | pgsql-hackers |
On 20.03.23 19:31, Greg Stark wrote: > So I took a look at this patch. The conflict is with 2fe3bdbd691 > committed by Peter Eisentraut which added error checks for pipes. > Afaics the behaviour is now for pipe commands returning non-zero to > cause an error*always* regardless of the setting of ON_ERROR_STOP. > > I'm not entirely sure that's sensible actually. If you write to a pipe > that ends in grep and it happens to produce no matching rows you may > actually be quite surprised when that causes your script to fail... The only thing that that patch changed in psql was the \w command, and AFAICT, ON_ERROR_STOP is still respected: $ cat test.sql \w |foo $ psql -f test.sql sh: foo: command not found psql:test.sql:1: error: |foo: command not found $ echo $? 0 $ psql -f test.sql -v ON_ERROR_STOP=1 sh: foo: command not found psql:test.sql:1: error: |foo: command not found $ echo $? 3
В списке pgsql-hackers по дате отправления: