Change the way pg_dump retrieves partitioning info

This gets rid of the code that issued separate queries to retrieve the
partitioning parent-child relationship, parent partition key, and child
partition bound information.  With this patch, the information is
retrieved instead using the queries issued from getTables() and
getInherits(), which is both more efficient than the previous approach
and doesn't require any new code.

Since the partitioning parent-child relationship is now retrieved with
the same old code that handles inheritance, partition attributes receive
a proper flagInhAttrs() treatment (that it didn't receive before), which
is needed so that the inherited NOT NULL constraints are not emitted if
we already emitted it for the parent.

Also, fix a bug in pg_dump's --binary-upgrade code, which caused pg_dump
to emit invalid command to attach a partition to its parent.

Author: Amit Langote, with some additional changes by me.

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/44c528810a1eca52a7888ed74c08353d45331b00

Modified Files
--------------
src/bin/pg_dump/common.c         |  90 -------------
src/bin/pg_dump/pg_dump.c        | 264 +++++++++++++++++----------------------
src/bin/pg_dump/pg_dump.h        |  15 +--
src/bin/pg_dump/t/002_pg_dump.pl |  36 +++++-
4 files changed, 153 insertions(+), 252 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers

Reply via email to