pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Joshua Yanovski <pythonesque@gmail.com>
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #9227: Error on SELECT ROW OVERLAPS ROW with single ROW argument
Date: Tue, 18 Feb 2014 14:15:34 -0500
Message-ID: <9155.1392750934@sss.pgh.pa.us> (raw)
In-Reply-To: <CABz-M-FosPJfKb3vqAYrmvUPcPMbGShdiCYYbCYnq69w-rUjuA@mail.gmail.com>
References: <20140215035549.24618.37927@wrigleys.postgresql.org>
	<10303.1392683593@sss.pgh.pa.us>
	<CABz-M-EGDwHUmG7G0rPEL3KzgauoL99F7f7EcWYt1gAst2MMMw@mail.gmail.com>
	<CABz-M-Hs7eGjvQQ_jPx4=7yrkg8-u2q79EBUpydGXhTznvMqzw@mail.gmail.com>
	<CABz-M-FwbWJ06QCER+-oJLyQz9JW7jXY3PcwF3HdGi5W751P1w@mail.gmail.com>
	<7547.1392745766@sss.pgh.pa.us>
	<CABz-M-EYhQj7ONdJ1RO6NRE4MSp33d+R0aXpkRyrC=ScAUMA3w@mail.gmail.com>
	<7822.1392746510@sss.pgh.pa.us>
	<8502.1392748781@sss.pgh.pa.us>
	<CABz-M-FosPJfKb3vqAYrmvUPcPMbGShdiCYYbCYnq69w-rUjuA@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (13+ messages)  latest in thread

Message-ID: <9155.1392750934@sss.pgh.pa.us>
Permalink:  ../9155.1392750934@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/9155.1392750934@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pythonesque@gmail.com
  Subject: Re: BUG #9227: Error on SELECT ROW OVERLAPS ROW with single ROW argument
  In-Reply-To: <9155.1392750934@sss.pgh.pa.us>
  References: <20140215035549.24618.37927@wrigleys.postgresql.org> <10303.1392683593@sss.pgh.pa.us> <CABz-M-EGDwHUmG7G0rPEL3KzgauoL99F7f7EcWYt1gAst2MMMw@mail.gmail.com> <CABz-M-Hs7eGjvQQ_jPx4=7yrkg8-u2q79EBUpydGXhTznvMqzw@mail.gmail.com> <CABz-M-FwbWJ06QCER+-oJLyQz9JW7jXY3PcwF3HdGi5W751P1w@mail.gmail.com> <7547.1392745766@sss.pgh.pa.us> <CABz-M-EYhQj7ONdJ1RO6NRE4MSp33d+R0aXpkRyrC=ScAUMA3w@mail.gmail.com> <7822.1392746510@sss.pgh.pa.us> <8502.1392748781@sss.pgh.pa.us> <CABz-M-FosPJfKb3vqAYrmvUPcPMbGShdiCYYbCYnq69w-rUjuA@mail.gmail.com> <9155.1392750934@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox