Re: How to *really* quit psql?

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: How to *really* quit psql?
Дата
Msg-id CAKFQuwZsd6p39nSxthzT6+6szMaf_xOpjkxqWPjZ3MVTN0K8eA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: How to *really* quit psql?  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: How to *really* quit psql?  (Fabien COELHO <coelho@cri.ensmp.fr>)
Список pgsql-hackers
On Sat, Nov 19, 2022 at 12:10 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
Fabien COELHO <coelho@cri.ensmp.fr> writes:
>   - when the current script is included from something,
>     you quit the current script and proceed after the \i of next -f, BAD

> Question: is there any way to really abort a psql script from an included
> file?

Under what circumstances would it be appropriate for a script to take
it on itself to decide that?  It has no way of knowing what the next -f
option is or what the user intended.


Can we add an exit code argument to the \quit meta-command that could be set to non-zero and, combined with ON_ERROR_STOP, produces the desired effect of aborting everything just like an error under ON_ERROR_STOP does (which is the workaround here I suppose, but an ugly one that involves the server).

David J.

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: How to *really* quit psql?
Следующее
От: Марина Полякова
Дата:
Сообщение: Re: Fix order of checking ICU options in initdb and create database