Re: proposal: alternative psql commands quit and exit

From: Geoff Winkless <pgsqladmin(at)geoff(dot)dj>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Geoff Winkless <pgsqladmin(at)geoff(dot)dj>, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, Robert Haas <robertmhaas(at)gmail(dot)com>, Everaldo Canuto <everaldo(dot)canuto(at)gmail(dot)com>, Chapman Flack <chap(at)anastigmatix(dot)net>, Vik Fearing <vik(dot)fearing(at)2ndquadrant(dot)com>, Stephen Frost <sfrost(at)snowman(dot)net>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal: alternative psql commands quit and exit
Date: 2018-01-15 17:43:39
Message-ID: CAEzk6feWvBc8qAw=3pPTdQ5AwkW0DynbE95fzk+s9py3bvWoNA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 15 January 2018 at 17:03, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Geoff Winkless <pgsqladmin(at)geoff(dot)dj> writes:
>> And while trying to find the EOF setting in libreadline might get
>> messy, you're already assuming that ctrl-C hasn't been knobbled using
>> stty intr. Unless you want to go searching for that too?
>
> Yeah, that's why I personally don't want to mention ctrl-C in this
> message. If we do mention it we're going to need to look up what
> the signal is really bound to.

Could always rewrite gets_interactive to implement the documented
"alternative interface" to readline

https://tiswww.cwru.edu/php/chet/readline/readline.html#SEC43

and force exit that way by intercepting Ctrl-D at the character level.
That does feel a bit (!) wrong though, and I'm not sure how difficult
it gets with different locales etc. Would also have to modify
gets_fromFile, in case readline was disabled.

At this point it depends quite how far down the rabbit-hole you want
to go to stop people googling "how do I exit psql", I suppose :p

Geoff

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2018-01-15 17:45:36 polymorphic parameters limits - correct solution?
Previous Message Alexander Korotkov 2018-01-15 17:40:10 Re: [HACKERS] proposal: psql command \graw