pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephen Frost <sfrost@snowman.net>
To: pgsql-committers@postgresql.org
Subject: pgsql: Change the way pg_dump retrieves partitioning info
Date: Fri, 05 May 2017 02:18:54 +0000
Message-ID: <E1d6Spa-0008GI-RJ@gemulon.postgresql.org> (raw)
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>

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


Message-ID: <E1d6Spa-0008GI-RJ@gemulon.postgresql.org>
Permalink:  ../E1d6Spa-0008GI-RJ@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1d6Spa-0008GI-RJ@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: sfrost@snowman.net
  Subject: Re: pgsql: Change the way pg_dump retrieves partitioning info
  In-Reply-To: <E1d6Spa-0008GI-RJ@gemulon.postgresql.org>
  References: <E1d6Spa-0008GI-RJ@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox