Re: Make ON_ERROR_STOP stop on shell script failure
От | Greg Stark |
---|---|
Тема | Re: Make ON_ERROR_STOP stop on shell script failure |
Дата | |
Msg-id | CAM-w4HOW3cc8V6HUegWiB-9t1oHZ74rQUZ0J5zuUJsjOyZLg+w@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Make ON_ERROR_STOP stop on shell script failure (Andreas 'ads' Scherbaum <ads@pgug.de>) |
Ответы |
Re: Make ON_ERROR_STOP stop on shell script failure
Re: Make ON_ERROR_STOP stop on shell script failure |
Список | pgsql-hackers |
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... But if you remove that failing hunk the resulting patch does apply. I don't see any tests so ... I don't know if the behaviour is still sensible. A quick read gives me the impression that now it's actually inconsistent in the other direction where it stops sometimes more often than the user might expect. I also don't understand the difference between ON_ERROR_STOP_ON and ON_ERROR_STOP_ALL. Nor why we would want ON_ERROR_STOP_SHELL which stops only on shell errors, rather than, say, ON_ERROR_STOP_SQL to do the converse which would at least match the historical behaviour?
Вложения
В списке pgsql-hackers по дате отправления: