pgsql: Adjust range_adjacent to support different canonicalization rule

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Adjust range_adjacent to support different canonicalization rule
Date: 2011-11-23 22:13:16
Message-ID: E1RTL48-0003vg-Dd@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Adjust range_adjacent to support different canonicalization rules.

The original coding would not work for discrete ranges in which the
canonicalization rule is to produce symmetric boundaries (either [] or ()
style), as noted by Jeff Davis. Florian Pflug pointed out that we could
fix that by invoking the canonicalization function to see if the range
"between" the two given ranges normalizes to empty. This implementation
of Florian's idea is a tad slower than the original code, but only in the
case where there actually is a canonicalization function --- if not, it's
essentially the same logic as before.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/b7056b832444696c931d59af057b0a345f5ae178

Modified Files
--------------
src/backend/utils/adt/rangetypes.c | 60 +++++++++++++++++++++++++++++------
1 files changed, 49 insertions(+), 11 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2011-11-24 00:14:16 pgsql: Some more editing of the range-types documentation.
Previous Message Tom Lane 2011-11-23 17:46:03 pgsql: Creator of a range type must have permission to call support fun