Re: BUG #9227: Error on SELECT ROW OVERLAPS ROW with single ROW argument

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Joshua Yanovski <pythonesque(at)gmail(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #9227: Error on SELECT ROW OVERLAPS ROW with single ROW argument
Date: 2014-02-18 19:15:34
Message-ID: 9155.1392750934@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Joshua Yanovski <pythonesque(at)gmail(dot)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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2014-02-18 19:20:20 Re: BUG #9161: wal_writer_delay is limited to 10s
Previous Message Clemens Eisserer 2014-02-18 19:03:39 Re: BUG #9161: wal_writer_delay is limited to 10s