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

From Tom Lane
Subject Re: BUG #9227: Error on SELECT ROW OVERLAPS ROW with single ROW argument
Date
Msg-id 9155.1392750934@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #9227: Error on SELECT ROW OVERLAPS ROW with single ROW argument  (Joshua Yanovski <pythonesque@gmail.com>)
Responses Re: BUG #9227: Error on SELECT ROW OVERLAPS ROW with single ROW argument
List pgsql-bugs
Joshua Yanovski <pythonesque@gmail.com> writes:
> That sounds like it should work.  I was also wondering whether it
> might be possible to do this more generally with some kind of "let"
> internal node:

> (let var = x in (var >= y and var <= z)

> I don't know enough about the planner or the SQL standard to know
> whether this would work, but it does seem a little nicer than
> special-casing BETWEEN to me.

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).

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

pgsql-bugs by date:

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