Re: \if, \elseif, \else, \endif (was Re: [HACKERS] PSQL commands:\quit_if, \quit_unless) - Mailing list pgsql-hackers

From Corey Huinker
Subject Re: \if, \elseif, \else, \endif (was Re: [HACKERS] PSQL commands:\quit_if, \quit_unless)
Date
Msg-id CADkLM=eVykMYA9scoROyaLaNoK+v6fWE==Cd+TmfVPB977_giQ@mail.gmail.com
Whole thread Raw
In response to Re: \if, \elseif, \else, \endif (was Re: [HACKERS] PSQL commands:\quit_if, \quit_unless)  (Corey Huinker <corey.huinker@gmail.com>)
Responses Re: \if, \elseif, \else, \endif (was Re: [HACKERS] PSQL commands:\quit_if, \quit_unless)  (Fabien COELHO <coelho@cri.ensmp.fr>)
List pgsql-hackers
On Mon, Jan 23, 2017 at 4:12 PM, Corey Huinker <corey.huinker@gmail.com> wrote:
I do not like the choice of "elseif", which exists in PHP & VB. PL/pgSQL has "ELSIF" like perl, that I do not like much, though. Given the syntax and behavioral proximity with cpp, I suggest that "elif" would be a better choice.

I'm personally indifferent to elif vs elsif vs elseif, but I think elseif was the consensus. It's easy enough to change.

Went with elsif to follow pl/pgsql. In reviewing the original thread it seemed that "elif" was linked to "fi" and that got some negative feedback.
 
 

Documentation: I do not think that the systematic test-like example in the documentation is relevant, a better example should be shown. The list of what is considered true or false should be told explicitely, not end with "etc" that is everyone to guess.

It was copied from the regression test. I knew there would be follow-up suggestions for what should be shown.

Work on this is pending discussion of what true/false values we should allow, and if values outside of those is an error.



  case ...: case ...:

The project rules are to add explicit /* PASSTHROUGH */ comment.

Will do.

I went looking for other examples of explicit /* PASSTHROUGH */ comments and could find none. Could you explain what it is you want me to fix with the switch statements?

pgsql-hackers by date:

Previous
From: Jim Nasby
Date:
Subject: Re: [HACKERS] Protect syscache from bloating with negative cacheentries
Next
From: Jim Nasby
Date:
Subject: Re: [HACKERS] Proposal : For Auto-Prewarm.