Allow a partitioned table to have a default partition.

Robert Haas <rhaas@postgresql.org>

Commit: 6f6b99d1335be8ea1b74581fc489a97b109dd08a
Author: Robert Haas <rhaas@postgresql.org>
Date: 2017-09-08T21:28:04Z
Releases: 11.0
Allow a partitioned table to have a default partition.

Any tuples that don't route to any other partition will route to the
default partition.

Jeevan Ladhe, Beena Emerson, Ashutosh Bapat, Rahila Syed, and Robert
Haas, with review and testing at various stages by (at least) Rushabh
Lathia, Keith Fiske, Amit Langote, Amul Sul, Rajkumar Raghuanshi, Sven
Kunze, Kyotaro Horiguchi, Thom Brown, Rafia Sabih, and Dilip Kumar.

Discussion: http://postgr.es/m/CAH2L28tbN4SYyhS7YV1YBWcitkqbhSWfQCy0G=apRcC_PEO-bg@mail.gmail.com
Discussion: http://postgr.es/m/CAOG9ApEYj34fWMcvBMBQ-YtqR9fTdXhdN82QEKG0SVZ6zeL1xg@mail.gmail.com

Files

PathChange+/−
doc/src/sgml/catalogs.sgml modified +11 −0
doc/src/sgml/ref/alter_table.sgml modified +28 −3
doc/src/sgml/ref/create_table.sgml modified +32 −3
src/backend/catalog/heap.c modified +39 −2
src/backend/catalog/partition.c modified +579 −65
src/backend/commands/tablecmds.c modified +159 −28
src/backend/nodes/copyfuncs.c modified +1 −0
src/backend/nodes/equalfuncs.c modified +1 −0
src/backend/nodes/outfuncs.c modified +1 −0
src/backend/nodes/readfuncs.c modified +1 −0
src/backend/parser/gram.y modified +20 −7
src/backend/parser/parse_utilcmd.c modified +12 −0
src/backend/utils/adt/ruleutils.c modified +7 −1
src/bin/psql/describe.c modified +6 −5
src/bin/psql/tab-complete.c modified +2 −2
src/include/catalog/catversion.h modified +1 −1
src/include/catalog/partition.h modified +7 −0
src/include/catalog/pg_partitioned_table.h modified +8 −5
src/include/commands/tablecmds.h modified +4 −0
src/include/nodes/parsenodes.h modified +1 −0
src/test/regress/expected/alter_table.out modified +49 −0
src/test/regress/expected/create_table.out modified +20 −0
src/test/regress/expected/insert.out modified +135 −12
src/test/regress/expected/plancache.out modified +26 −0
src/test/regress/expected/sanity_check.out modified +4 −0
src/test/regress/expected/update.out modified +33 −0
src/test/regress/sql/alter_table.sql modified +47 −0
src/test/regress/sql/create_table.sql modified +20 −0
src/test/regress/sql/insert.sql modified +68 −1
src/test/regress/sql/plancache.sql modified +21 −0
src/test/regress/sql/update.sql modified +24 −0

Documentation touched

Discussion