Re: Comma-separated predicates in simple CASE expressions (f263) - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Comma-separated predicates in simple CASE expressions (f263)
Date
Msg-id 3763943.1661898037@sss.pgh.pa.us
Whole thread Raw
In response to Comma-separated predicates in simple CASE expressions (f263)  (Daniel Gustafsson <daniel@yesql.se>)
Responses Re: Comma-separated predicates in simple CASE expressions (f263)
List pgsql-hackers
Daniel Gustafsson <daniel@yesql.se> writes:
> I was looking at F263 from the SQL standard, Comma-separated predicates in
> simple CASE expression, and thinking if we could support this within the
> framework we already have at a minimal added cost.  The attached sketch diff
> turns each predicate in the list into a CaseWhen node and uses the location
> from parsing for grouping in errorhandling for searched case.

> Is this a viable approach or am I missing something obvious?

I don't particularly like duplicating the THEN clause multiple times.
I think if we're going to do this we should do it right, and that
means a substantially larger patch to propagate the notion of multiple
comparison values all the way down.

I also don't care for the bit in transformCaseExpr where you seem
to be relying on subexpression location fields to make semantic
decisions.  Surely there's a better way.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Daniel Gustafsson
Date:
Subject: Comma-separated predicates in simple CASE expressions (f263)
Next
From: Nathan Bossart
Date:
Subject: Re: introduce bufmgr hooks