How to *really* quit psql? - Mailing list pgsql-hackers

From Fabien COELHO
Subject How to *really* quit psql?
Date
Msg-id a7acfaf-331d-965e-3b44-7c51b22c3727@minesparis.psl.eu
Whole thread Raw
Responses Re: How to *really* quit psql?
List pgsql-hackers
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 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?

I've found "\! kill $PPID" which works with bash, but I'm not sure of the 
portability and I was hoping for something straightforward and cleaner.

If there is really no simple way, would it be okay to add a \exit which 
does that?

-- 
Fabien.



pgsql-hackers by date:

Previous
From: Nathan Bossart
Date:
Subject: Re: predefined role(s) for VACUUM and ANALYZE
Next
From: Tom Lane
Date:
Subject: Re: How to *really* quit psql?