Re: [HACKERS] PSQL commands: \quit_if, \quit_unless - Mailing list pgsql-hackers

From David G. Johnston
Subject Re: [HACKERS] PSQL commands: \quit_if, \quit_unless
Date
Msg-id CAKFQuwYAPvbzATpZ81zuFWYC0MABqeF3ML4yMPMkwieMyUWkbA@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] PSQL commands: \quit_if, \quit_unless  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: [HACKERS] PSQL commands: \quit_if, \quit_unless
List pgsql-hackers
On Mon, Dec 19, 2016 at 10:30 AM, Robert Haas <robertmhaas@gmail.com> wrote:

I see your point.  Just out of curiosity, why in the world don't you
use something other than psql for scripting?  I mean, if you accessed
the data from Perl or Python or
$INSERT_YOUR_FAVORITE_SCRIPTING_LANGUAGE_HERE, you could do all of
this stuff very easily without any contortions.  I've always thought
of psql as something that's fine for interactive use and goofy trivial
scripting but not really suitable for serious work.  I grant that you
seem to be making it serve the purpose, but, man.

I'm coming to the realization that this sentiment, when applied to my primary application, is probably correct...

In my situation the scripting language of choice is Bash - which largely acts as glue for programs such as psql, pdftk, enscript, and the R language.

Being able to do more conditional work in psql would make setting up more robust scripts easier and without either losing transaction capabilities or session pooling for improved performance when large numbers of small commands are run in between flow control in done in bash.

David J.

pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: [HACKERS] PSQL commands: \quit_if, \quit_unless
Next
From: Corey Huinker
Date:
Subject: Re: [HACKERS] PSQL commands: \quit_if, \quit_unless