Return FALSE instead of throwing error for comparisons with empty ranges.
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 14 Nov 2011 20:15:53 +0000 (15:15 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 14 Nov 2011 20:15:53 +0000 (15:15 -0500)
commit851c83fc81917c61b063c875fc1bca489dfcc482
tree5652e4c318aa287085e0362a096c4cb453d9c906
parentf1585362856d4da17113ba2e4ba46cf83cba0cf2
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.
doc/src/sgml/filelist.sgml
doc/src/sgml/func.sgml
src/backend/utils/adt/rangetypes.c
src/test/regress/expected/rangetypes.out
src/test/regress/expected/sanity_check.out
src/test/regress/output/misc.source
src/test/regress/sql/rangetypes.sql