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

From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: Corey Huinker <corey(dot)huinker(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Greg Stark <stark(at)mit(dot)edu>, Erik Rijkers <er(at)xs4all(dot)nl>, 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-03-02 06:23:40
Message-ID: alpine.DEB.2.20.1703020710260.762@lancre
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Hello Corey,

> That is accurate. The only positive it has is that the user only
> experiences one error, and it's the first error that was encountered if
> reading top-to-bottom, left to right. It is an issue of which we prioritize
> - user experience or simpler code.

Hmmm. The last simpler structure I suggested, which is basically the one
used in your code before the update, does check for the structure error
first. The only drawback is that the condition is only evaluated when
needed, which is an issue we can cope with, IMO.

>> Now if you want to require committer opinion on this one, fine with me.
>
> Rather than speculate on what a committer thinks of this edge case (and
> making a patch for each possible theory), I'd rather just ask them what
> their priorities are and which user experience they favor.

ISTM that the consistent message by Robert & Tom was to provide simpler
code even if the user experience is somehow degraded, as they required
that user-friendly features were removed (eg trying to be nicer about
structural syntax errors, barking in interactive mode so that the user
always knows the current status, providing a detailed status indicator in
the prompt...).

Now committers can change their opinions, it is their privilege:-)

--
Fabien.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2017-03-02 06:25:16 Re: PATCH: two slab-like memory allocators
Previous Message Amit Khandekar 2017-03-02 06:23:24 Re: UPDATE of partition key