Re: PL/pgSQL 2 - Mailing list pgsql-hackers

From David G Johnston
Subject Re: PL/pgSQL 2
Date
Msg-id 1409770902478-5817608.post@n5.nabble.com
Whole thread Raw
In response to Re: PL/pgSQL 2  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: PL/pgSQL 2  (Pavel Stehule <pavel.stehule@gmail.com>)
List pgsql-hackers
This is more of an SQL request the pl/pgsql but is/has there been thought to
adding the ternary if/then opeator?  Something like:

boolean_exp ?> val_if_true : val_if_false

using "?" by itself would be OK but not ideal - and the addition of the ">"
doesn't seem hateful...

Sorry if this is deemed off-topic but I just went to write

CASE WHEN boolean_exp THEN val_if_true ELSE val_if_false END

And the fact there is as much standard code as there is custom bothered me
just as is being discussed on this thread.

I'm going to go write a "ifthen(bool, anyelement, anyelement)" function
now....

David J.




--
View this message in context: http://postgresql.1045698.n5.nabble.com/PL-pgSQL-2-tp5817121p5817608.html
Sent from the PostgreSQL - hackers mailing list archive at Nabble.com.



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: PL/pgSQL 2
Next
From: Pavel Stehule
Date:
Subject: Re: PL/pgSQL 2