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

From Greg Stark
Subject Re: How to *really* quit psql?
Date
Msg-id CAM-w4HNKg_dSjTrNurYsmUsPywboh4vjEwLipjSqnnr-BmVVow@mail.gmail.com
Whole thread Raw
In response to Re: How to *really* quit psql?  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: How to *really* quit psql?
List pgsql-hackers
On Sat, 19 Nov 2022 at 14:10, Tom Lane <tgl@sss.pgh.pa.us> 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 does
effectively know what the "user" intended because it's written by the
same user.

Off the top of my head I could imagine someone writing something like
report-error-and-exit.sql and wanting to be able to use \i
report-error-and-exit.sql to ensure all scripts report their errors
using some common log file or something.

Not saying that's the only or best way to do that though. And there is
the risk that scripts would start using this functionality
inappropriately which would mean, for example, getting an install
script for something and then not being able to use it within another
script safely :(

--
greg



pgsql-hackers by date:

Previous
From: Марина Полякова
Date:
Subject: Re: Fix order of checking ICU options in initdb and create database
Next
From: Peter Geoghegan
Date:
Subject: Simplify vacuum_set_xid_limits()'s signature (minor refactoring)