Re: How to *really* quit psql?

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>, PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: How to *really* quit psql?
Date: 2022-11-19 19:25:34
Message-ID: CAKFQuwZsd6p39nSxthzT6+6szMaf_xOpjkxqWPjZ3MVTN0K8eA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Nov 19, 2022 at 12:10 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Fabien COELHO <coelho(at)cri(dot)ensmp(dot)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.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Марина Полякова 2022-11-19 19:36:12 Re: Fix order of checking ICU options in initdb and create database
Previous Message Tom Lane 2022-11-19 19:10:31 Re: How to *really* quit psql?