pgsql: Return FALSE instead of throwing error for comparisons with empt

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Return FALSE instead of throwing error for comparisons with empt
Date: 2011-11-14 20:16:07
Message-ID: E1RQ2wp-0007j3-MP@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Return FALSE instead of throwing error for comparisons with empty ranges.

Change range_before, range_after, range_adjacent to return false rather
than throwing an error when one or both input ranges are empty.

The original definition is unnecessarily difficult to use, and also can
result in undesirable planner failures since the planner could try to
compare an empty range to something else while deriving statistical
estimates. (This was, in fact, the cause of repeatable regression test
failures on buildfarm member jaguar, as well as intermittent failures
elsewhere.)

Also tweak rangetypes regression test to not drop all the objects it
creates, so that the final state of the regression database contains
some rangetype objects for pg_dump testing.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/851c83fc81917c61b063c875fc1bca489dfcc482

Modified Files
--------------
doc/src/sgml/filelist.sgml | 2 +-
doc/src/sgml/func.sgml | 73 ++++++++++++++++-----------
src/backend/utils/adt/rangetypes.c | 31 +++++-------
src/test/regress/expected/rangetypes.out | 42 +++++++---------
src/test/regress/expected/sanity_check.out | 4 +-
src/test/regress/output/misc.source | 4 +-
src/test/regress/sql/rangetypes.sql | 48 +++++++-----------
7 files changed, 101 insertions(+), 103 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2011-11-14 20:34:48 pgsql: Return NULL instead of throwing error when desired bound is not
Previous Message Tom Lane 2011-11-14 18:59:46 pgsql: Fix copyright notices, other minor editing in new range-types co