Re: \if, \elseif, \else, \endif (was Re: PSQL commands: \quit_if, \quit_unless)

From: "Daniel Verite" <daniel(at)manitou-mail(dot)org>
To: "Corey Huinker" <corey(dot)huinker(at)gmail(dot)com>
Cc: "Fabien COELHO" <coelho(at)cri(dot)ensmp(dot)fr>,"Erik Rijkers" <er(at)xs4all(dot)nl>,"Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>,"Jim Nasby" <Jim(dot)Nasby(at)bluetreble(dot)com>,"PostgreSQL" <pgsql-hackers(at)postgresql(dot)org>,pgsql-hackers-owner(at)postgresql(dot)org
Subject: Re: \if, \elseif, \else, \endif (was Re: PSQL commands: \quit_if, \quit_unless)
Date: 2017-02-03 17:20:37
Message-ID: 2d6ed317-c243-4998-aa98-81f51af9db23@manitou-mail.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Corey Huinker wrote:

> I meant in the specific psql-context, does it do anything other
> than (attempt to) terminate sent-but-not-received SQL queries?

It cancels the current edit in the query buffer, including the
case when it spans multiple lines.
If we add the functionality that Ctrl+C also exits from branches,
we could do it like the shell does Ctrl+D for logout, that is it
logs out only if the input buffer is empty, otherwise it does
the other functionality bound to this key (normally Delete).
So if you're in the middle of an edit, the first Ctrl+C will
cancel the edit and a second one will go back from the /if

Best regards,
--
Daniel Vérité
PostgreSQL-powered mailer: http://www.manitou-mail.org
Twitter: @DanielVerite

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Serge Rielau 2017-02-03 17:30:54 Re: Packages: Again
Previous Message Alexander Korotkov 2017-02-03 17:11:11 Re: LWLock optimization for multicore Power machines