Re: How to *really* quit psql?

From: Greg Stark <stark(at)mit(dot)edu>
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:39:04
Message-ID: CAM-w4HNKg_dSjTrNurYsmUsPywboh4vjEwLipjSqnnr-BmVVow@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, 19 Nov 2022 at 14:10, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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

In response to

Responses

Browse pgsql-hackers by date

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