Re: BUG #9227: Error on SELECT ROW OVERLAPS ROW with single ROW argument - Mailing list pgsql-bugs

From Joshua Yanovski
Subject Re: BUG #9227: Error on SELECT ROW OVERLAPS ROW with single ROW argument
Date
Msg-id CABz-M-HQRbEFdN5WeBAMHyfVdN8ERCwJiYXTy1iA89AtTvZ9iA@mail.gmail.com
Whole thread Raw
In response to Re: BUG #9227: Error on SELECT ROW OVERLAPS ROW with single ROW argument  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
> Hmm ... interesting idea, but I don't think it answers any of the
> fundamental issues about comparison semantics (ie, how much do we
> care if "var" is promoted differently in the two clauses).
My first thought was that it essentially would work as you describe
above--if the expression is volatile, evaluate the argument first and
then evaluate the expression, otherwise replace the parameter within
the subexpression.  But then I realized that you didn't actually say
that is what the BETWEEN node would be doing :)  I suppose any extra
logic would have to be present in some translation function to deal
with the let node, so effectively it would be special-cased anyway.

>
> Also, as a grammar translation target for BETWEEN it would be a pretty
> bad choice, because now views that had been defined in a perfectly
> SQL-compliant manner would print out with very-PG-specific syntax.
> The existing translation is nasty because of the double eval issue,
> but at least what we print is standard SQL.
>
>                         regards, tom lane
That's a good point, I suppose I'll just have to wait for this feature
to be added to the SQL standard :)

--
Josh

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #9161: wal_writer_delay is limited to 10s
Next
From: Andres Freund
Date:
Subject: Re: BUG #9161: wal_writer_delay is limited to 10s