Reorganize partitioning code

Alvaro Herrera <alvherre@alvh.no-ip.org>

Commit: da6f3e45ddb68ab3161076e120e7c32cfd46d1db
Author: Alvaro Herrera <alvherre@alvh.no-ip.org>
Date: 2018-04-15T00:12:14Z
Releases: 11.0
Reorganize partitioning code

There's been a massive addition of partitioning code in PostgreSQL 11,
with little oversight on its placement, resulting in a
catalog/partition.c with poorly defined boundaries and responsibilities.
This commit tries to set a couple of distinct modules to separate things
a little bit.  There are no code changes here, only code movement.

There are three new files:
  src/backend/utils/cache/partcache.c
  src/include/partitioning/partdefs.h
  src/include/utils/partcache.h

The previous arrangement of #including catalog/partition.h almost
everywhere is no more.

Authors: Amit Langote and Álvaro Herrera
Discussion: https://postgr.es/m/98e8d509-790a-128c-be7f-e48a5b2d8d97@lab.ntt.co.jp
	https://postgr.es/m/11aa0c50-316b-18bb-722d-c23814f39059@lab.ntt.co.jp
	https://postgr.es/m/143ed9a4-6038-76d4-9a55-502035815e68@lab.ntt.co.jp
	https://postgr.es/m/20180413193503.nynq7bnmgh6vs5vm@alvherre.pgsql

Files

PathChange+/−
contrib/pageinspect/hashfuncs.c modified +1 −0
contrib/pg_stat_statements/pg_stat_statements.c modified +1 −0
src/backend/catalog/heap.c modified +1 −0
src/backend/catalog/partition.c modified +111 −3249
src/backend/catalog/pg_constraint.c modified +2 −0
src/backend/commands/indexcmds.c modified +1 −0
src/backend/commands/tablecmds.c modified +2 −0
src/backend/commands/trigger.c modified +1 −0
src/backend/executor/execMain.c modified +1 −1
src/backend/executor/execPartition.c modified +112 −1
src/backend/optimizer/path/joinrels.c modified +1 −1
src/backend/optimizer/util/plancat.c modified +3 −1
src/backend/optimizer/util/relnode.c modified +1 −1
src/backend/parser/parse_utilcmd.c modified +1 −0
src/backend/partitioning/Makefile modified +1 −1
src/backend/partitioning/partbounds.c added +2315 −0
src/backend/tcop/utility.c modified +1 −0
src/backend/utils/adt/ruleutils.c modified +1 −1
src/backend/utils/cache/Makefile modified +3 −3
src/backend/utils/cache/partcache.c added +967 −0
src/backend/utils/cache/relcache.c modified +2 −206
src/backend/utils/misc/pg_controldata.c modified +3 −2
src/include/catalog/partition.h modified +2 −32
src/include/commands/tablecmds.h modified +0 −1
src/include/executor/execPartition.h modified +0 −1
src/include/executor/executor.h modified +0 −1
src/include/nodes/parsenodes.h modified +4 −2
src/include/partitioning/partbounds.h modified +33 −8
src/include/partitioning/partdefs.h added +24 −0
src/include/partitioning/partprune.h modified +2 −1
src/include/utils/partcache.h added +96 −0
src/include/utils/rel.h modified +0 −72

Discussion