Re: proposal: alternative psql commands quit and exit - Mailing list pgsql-hackers

From Stephen Frost
Subject Re: proposal: alternative psql commands quit and exit
Date
Msg-id 20180114013415.GN2416@tamriel.snowman.net
Whole thread Raw
In response to Re: proposal: alternative psql commands quit and exit  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom, Vik, all,

* Tom Lane (tgl@sss.pgh.pa.us) wrote:
> Vik Fearing <vik.fearing@2ndquadrant.com> writes:
> > In particular, I currently hate how pasting a query with tabs screws
> > everything up with unhelpful completions.  I don't want to add to that
> > with the column example Tom exposed in [1] and especially with the
> > plpgsql example Vladimir Svedov exposed in [2].
>
> That seems like sort of an independent problem, though.  I wonder
> whether it's possible to find out from libreadline that the input
> text came from a paste rather than being typed.

I'm not sure exactly how, but I know that some software is able to
figure that out (irssi, in particular).  Might be just a timing-based
heuristic though.

> > I quite like the idea of blanking the database name in PROMPT2 as
> > suggested by Daniel in [3], I would be happy to work on that patch if
> > others agree.
>
> I think that the part of that about inserting a line number is important.
> What about combining the two ideas: in PROMPT2, the database name is
> *replaced* by a line number, while (trying to) keep the width the same?

Seems like a good approach to me.

Thanks!

Stephen

Attachment

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: proposal: alternative psql commands quit and exit
Next
From: Everaldo Canuto
Date:
Subject: Re: proposal: alternative psql commands quit and exit