From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andreas Seltenreich <seltenreich@gmx.de>
Cc: Peter Geoghegan <pg@heroku.com>
Cc: Andres Freund <andres@anarazel.de>
Cc: Pg Hackers <pgsql-hackers@postgresql.org>
Subject: Re: ORDER/GROUP BY expression not found in targetlist
Date: Thu, 26 May 2016 11:11:11 -0400
Message-ID: <5833.1464275471@sss.pgh.pa.us> (raw)
In-Reply-To: <87zircga6w.fsf@credativ.de>
References: <20160526021235.w4nq7k3gnheg7vit@alap3.anarazel.de>
<CAM3SWZRJu4Csxu4yU-q0HEQcjoNaM6xk1=QsaER7xny-pNtSvg@mail.gmail.com>
<87a8jcoqtc.fsf@elite.ansel.ydns.eu>
<26822.1464271975@sss.pgh.pa.us>
<87zircga6w.fsf@credativ.de>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
Andreas Seltenreich <seltenreich@gmx.de> writes:
> Tom Lane writes:
>> It's looking for an operator that is known to be semantically equality,
>> by virtue of being the equality member of a btree or hash opclass.
>> Type path has no such opclass unfortunately.
> As do lots of data types in the regression db while still having an
> operator providing semantic equivalence. I was hoping for someone to
> question that status quo. Naively I'd say an equivalence flag is
> missing in the catalog that is independent of opclasses.
[ shrug... ] I see little wrong with that status quo. For this
particular use-case, there are two ways we could implement DISTINCT: one
of them requires sorting, and the other requires hashing. So you would
need to provide that opclass infrastructure even if there were some other
way of identifying the operator that means equality.
Type path and the other geometric types lack any natural sort order so
it's hard to imagine making a default btree opclass for them. But a
default hash opclass might not be out of reach, given an exact equality
operator.
Another problem with the geometric types is that long ago somebody
invented "=" operators for most of them that have little to do with what
anyone would consider equality. The "path = path" operator just compares
whether the paths have the same number of points. A lot of the other ones
compare areas. It'd be hard to justify marking any of them as default
equality for the type.
regards, tom lane
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
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-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, seltenreich@gmx.de, pg@heroku.com, andres@anarazel.de
Subject: Re: ORDER/GROUP BY expression not found in targetlist
In-Reply-To: <5833.1464275471@sss.pgh.pa.us>
References: <20160526021235.w4nq7k3gnheg7vit@alap3.anarazel.de> <CAM3SWZRJu4Csxu4yU-q0HEQcjoNaM6xk1=QsaER7xny-pNtSvg@mail.gmail.com> <87a8jcoqtc.fsf@elite.ansel.ydns.eu> <26822.1464271975@sss.pgh.pa.us> <87zircga6w.fsf@credativ.de> <5833.1464275471@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