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-e48a5b2d8...@lab.ntt.co.jp
        https://postgr.es/m/11aa0c50-316b-18bb-722d-c23814f39...@lab.ntt.co.jp
        https://postgr.es/m/143ed9a4-6038-76d4-9a55-502035815...@lab.ntt.co.jp
        https://postgr.es/m/20180413193503.nynq7bnmgh6vs5vm@alvherre.pgsql

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/da6f3e45ddb68ab3161076e120e7c32cfd46d1db

Modified Files
--------------
contrib/pageinspect/hashfuncs.c                 |    1 +
contrib/pg_stat_statements/pg_stat_statements.c |    1 +
src/backend/catalog/heap.c                      |    1 +
src/backend/catalog/partition.c                 | 3360 +----------------------
src/backend/catalog/pg_constraint.c             |    2 +
src/backend/commands/indexcmds.c                |    1 +
src/backend/commands/tablecmds.c                |    2 +
src/backend/commands/trigger.c                  |    1 +
src/backend/executor/execMain.c                 |    2 +-
src/backend/executor/execPartition.c            |  113 +-
src/backend/optimizer/path/joinrels.c           |    2 +-
src/backend/optimizer/util/plancat.c            |    4 +-
src/backend/optimizer/util/relnode.c            |    2 +-
src/backend/parser/parse_utilcmd.c              |    1 +
src/backend/partitioning/Makefile               |    2 +-
src/backend/partitioning/partbounds.c           | 2315 ++++++++++++++++
src/backend/tcop/utility.c                      |    1 +
src/backend/utils/adt/ruleutils.c               |    2 +-
src/backend/utils/cache/Makefile                |    6 +-
src/backend/utils/cache/partcache.c             |  967 +++++++
src/backend/utils/cache/relcache.c              |  208 +-
src/backend/utils/misc/pg_controldata.c         |    5 +-
src/include/catalog/partition.h                 |   34 +-
src/include/commands/tablecmds.h                |    1 -
src/include/executor/execPartition.h            |    1 -
src/include/executor/executor.h                 |    1 -
src/include/nodes/parsenodes.h                  |    6 +-
src/include/partitioning/partbounds.h           |   41 +-
src/include/partitioning/partdefs.h             |   24 +
src/include/partitioning/partprune.h            |    3 +-
src/include/utils/partcache.h                   |   96 +
src/include/utils/rel.h                         |   72 -
32 files changed, 3693 insertions(+), 3585 deletions(-)

Reply via email to