Re: pasting a lot of commands to psql - Mailing list pgsql-general

From Alvaro Herrera
Subject Re: pasting a lot of commands to psql
Date
Msg-id 20160708170348.GA727986@alvherre.pgsql
Whole thread Raw
In response to Re: pasting a lot of commands to psql  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Tom Lane wrote:
> Francisco Olarte <folarte@peoplecall.com> writes:
> > On Thu, Jul 7, 2016 at 8:18 PM, Alvaro Herrera <alvherre@2ndquadrant.com> wrote:
> >> I've wished sometimes for a "\set READLINE off" psql metacommand for
> >> this kind of thing.  It's pretty annoying when the text being pasted
> >> contains tabs and readline uses to do completion.
>
> > Doesn't 'cat | psql ' disable it?
>
> Sure, but you could as well use 'psql -n'.  I think the point is to be
> able to turn it on and off without starting a fresh session.  (Admittedly,
> maybe there's not a lot of usability gain there.)

If your command line already connected to the correct server/database,
with the correct login role, then yeah you can do that.  If you have to
switch role (say the role that runs the commands is not a login role),
it's not so convenient to disconnect and launch a new psql.

Now of course this not a huge new feature, but a usability improvement
only -- but psql is full of small usability features and they make it a
pleasure to use.

--
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


pgsql-general by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: Memory usage per session
Next
From: Paul Tilles - NOAA Federal
Date:
Subject: RHEL 7