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

From: Greg Stark <stark(at)mit(dot)edu>
To: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
Cc: Corey Huinker <corey(dot)huinker(at)gmail(dot)com>, Erik Rijkers <er(at)xs4all(dot)nl>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, Daniel Verite <daniel(at)manitou-mail(dot)org>, 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-11 22:57:43
Message-ID: CAM-w4HMRumvzES_PaBD8b84b_LdhTyH__FAK6xwFBgwkTzvOsw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 10 February 2017 at 21:36, Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr> wrote:
>> command prompt is now
>> ----------- ---------------------------------------
>> \echo bob '' = initial state, no branch going on at all
>> \if yes 't' = inside a true branch
>> \if no 'tf' = false inside a true
>> \endif 't' = back to just the true branch
>> \if yes 'tt'
>> \if yes 'ttt'
>> \if yes '...ttt' = only show the last 3, but let it be known that
>> there's at least one more'
>> \else '...ttz' = past the point of a true bit of this branch
>
>
> I like the "tfz" idea. I'm not sure whether the up to 6 characters is a
> good, though.

I haven't been following this thread but just skimming through it for
the first time I thought this was more baroque than I was expecting. I
was expecting something like a { for each level of nested if you're in
so you can see how many deep you are. I didn't expect to see anything
more complex than that.

--
greg

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2017-02-11 23:35:36 Re: Parallel Index Scans
Previous Message Corey Huinker 2017-02-11 22:08:27 Re: \if, \elseif, \else, \endif (was Re: PSQL commands: \quit_if, \quit_unless)