Re: How to *really* quit psql?

2022-11-20 Thread Fabien COELHO
Hello David, 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

Re: How to *really* quit psql?

2022-11-19 Thread Fabien COELHO
Hello David, vagrant@vagrant:~$ /usr/local/pgsql/bin/psql -v ON_ERROR_STOP=1 -f two.psql -f three.psql postgres ?column? -- 2 (1 row) ?column? -- 3 (1 row) (there is a \quit at the end of two.psql) Yep, that summarizes my issues! ON_ERROR_STOP is only of SQL

Re: How to *really* quit psql?

2022-11-19 Thread Fabien COELHO
Hello Tom, - 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

Re: How to *really* quit psql?

2022-11-19 Thread David G. Johnston
On Sat, Nov 19, 2022 at 12:59 PM David G. Johnston < david.g.johns...@gmail.com> wrote: > On Sat, Nov 19, 2022 at 12:49 PM Tom Lane wrote: > >> Greg Stark writes: >> > On Sat, 19 Nov 2022 at 14:10, Tom Lane wrote: >> >> Under what circumstances would it be appropriate for a script to take >>

Re: How to *really* quit psql?

2022-11-19 Thread David G. Johnston
On Sat, Nov 19, 2022 at 12:49 PM Tom Lane wrote: > Greg Stark writes: > > On Sat, 19 Nov 2022 at 14:10, Tom Lane wrote: > >> 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

Re: How to *really* quit psql?

2022-11-19 Thread Tom Lane
Greg Stark writes: > On Sat, 19 Nov 2022 at 14:10, Tom Lane wrote: >> 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. > Presumably when they're written by the

Re: How to *really* quit psql?

2022-11-19 Thread Greg Stark
On Sat, 19 Nov 2022 at 14:10, Tom Lane wrote: > 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. Presumably when they're written by the same person so the script

Re: How to *really* quit psql?

2022-11-19 Thread David G. Johnston
On Sat, Nov 19, 2022 at 12:10 PM Tom Lane wrote: > Fabien COELHO 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 > >

Re: How to *really* quit psql?

2022-11-19 Thread Tom Lane
Fabien COELHO 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

How to *really* quit psql?

2022-11-19 Thread Fabien COELHO
Hello devs, I want to abort a psql script. How can I do that? The answer seems to be \quit, but it is not so simple: - when the current script is from a terminal, you exit psql, OK - when the current script is from a file (-f, <), you exit psql, OK - when the current script is included