Re: [HACKERS] expr ? trueval : falseval - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: [HACKERS] expr ? trueval : falseval
Date
Msg-id 199803201703.MAA07780@candle.pha.pa.us
Whole thread Raw
In response to expr ? trueval : falseval  (Brett McCormick <brett@work.chicken.org>)
List pgsql-hackers
>
>
> expr ? trueval : falseval
>
> if expr evaluated is true, the entire expression is trueval evaluated,
> otherwise it is falseval evaluated.
>
> Is it possible to have this sort of grammar logic in the parser?

Good question.  Answer is no, I think, unless you can do some fancy
things with functions.

--
Bruce Momjian                          |  830 Blythe Avenue
maillist@candle.pha.pa.us              |  Drexel Hill, Pennsylvania 19026
  +  If your life is a hard drive,     |  (610) 353-9879(w)
  +  Christ can be your backup.        |  (610) 853-3000(h)

pgsql-hackers by date:

Previous
From: "Thomas G. Lockhart"
Date:
Subject: Re: [HACKERS] expr ? trueval : falseval
Next
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] Re: [PATCHES] patches for 6.2.1p6