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