postgresql/src
Dean Rasheed d363d42bb9 Use MINVALUE/MAXVALUE instead of UNBOUNDED for range partition bounds.
Previously, UNBOUNDED meant no lower bound when used in the FROM list,
and no upper bound when used in the TO list, which was OK for
single-column range partitioning, but problematic with multiple
columns. For example, an upper bound of (10.0, UNBOUNDED) would not be
collocated with a lower bound of (10.0, UNBOUNDED), thus making it
difficult or impossible to define contiguous multi-column range
partitions in some cases.

Fix this by using MINVALUE and MAXVALUE instead of UNBOUNDED to
represent a partition column that is unbounded below or above
respectively. This syntax removes any ambiguity, and ensures that if
one partition's lower bound equals another partition's upper bound,
then the partitions are contiguous.

Also drop the constraint prohibiting finite values after an unbounded
column, and just document the fact that any values after MINVALUE or
MAXVALUE are ignored. Previously it was necessary to repeat UNBOUNDED
multiple times, which was needlessly verbose.

Note: Forces a post-PG 10 beta2 initdb.

Report by Amul Sul, original patch by Amit Langote with some
additional hacking by me.

Discussion: https://postgr.es/m/CAAJ_b947mowpLdxL3jo3YLKngRjrq9+Ej4ymduQTfYR+8=YAYQ@mail.gmail.com
2017-07-21 09:20:47 +01:00
..
backend Use MINVALUE/MAXVALUE instead of UNBOUNDED for range partition bounds. 2017-07-21 09:20:47 +01:00
bin Add static assertions about pg_control fitting into one disk sector. 2017-07-19 16:16:57 -04:00
common Change pg_ctl to detect server-ready by watching status in postmaster.pid. 2017-06-28 17:31:32 -04:00
fe_utils Phase 3 of pgindent updates. 2017-06-21 15:35:54 -04:00
include Use MINVALUE/MAXVALUE instead of UNBOUNDED for range partition bounds. 2017-07-21 09:20:47 +01:00
interfaces Translation updates 2017-07-10 11:53:55 -04:00
makefiles Always use -fPIC, not -fpic, when building shared libraries with gcc. 2017-06-01 13:32:55 -04:00
pl Translation updates 2017-07-10 11:53:55 -04:00
port Phase 3 of pgindent updates. 2017-06-21 15:35:54 -04:00
template Remove "sco" and "unixware" ports. 2016-10-11 11:26:04 -04:00
test Use MINVALUE/MAXVALUE instead of UNBOUNDED for range partition bounds. 2017-07-21 09:20:47 +01:00
timezone Phase 3 of pgindent updates. 2017-06-21 15:35:54 -04:00
tools Use MINVALUE/MAXVALUE instead of UNBOUNDED for range partition bounds. 2017-07-21 09:20:47 +01:00
tutorial Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
.gitignore
DEVELOPERS
Makefile Remove redundant coverage target 2017-02-17 08:56:57 -05:00
Makefile.global.in Add ICU_CFLAGS to global CPPFLAGS 2017-06-12 15:57:22 -04:00
Makefile.shlib Remove support for bcc and msvc standalone libpq builds 2017-04-11 15:22:21 +02:00
nls-global.mk nls-global.mk: search build dir for source files, too 2016-06-07 18:55:18 -04:00