pgsql: Fix pg_dump for better handling of inherited columns. - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Fix pg_dump for better handling of inherited columns.
Date
Msg-id E1RvvDP-0007Zp-7p@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Fix pg_dump for better handling of inherited columns.

Revise pg_dump's handling of inherited columns, which was last looked at
seriously in 2001, to eliminate several misbehaviors associated with
inherited default expressions and NOT NULL flags.  In particular make sure
that a column is printed in a child table's CREATE TABLE command if and
only if it has attislocal = true; the former behavior would sometimes cause
a column to become marked attislocal when it was not so marked in the
source database.  Also, stop relying on textual comparison of default
expressions to decide if they're inherited; instead, don't use
default-expression inheritance at all, but just install the default
explicitly at each level of the hierarchy.  This fixes the
search-path-related misbehavior recently exhibited by Chester Young, and
also removes some dubious assumptions about the order in which ALTER TABLE
SET DEFAULT commands would be executed.

Back-patch to all supported branches.

Branch
------
REL9_0_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/ab060c74ba0f0767237e7a3bc6022a84e177abab

Modified Files
--------------
src/bin/pg_dump/common.c       |  153 +++++++++++++---------------------------
src/bin/pg_dump/pg_dump.c      |  141 +++++++++++++++++++++++++++----------
src/bin/pg_dump/pg_dump.h      |   15 +---
src/bin/pg_dump/pg_dump_sort.c |    9 +++
4 files changed, 164 insertions(+), 154 deletions(-)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Fix pg_dump for better handling of inherited columns.
Next
From: Tom Lane
Date:
Subject: pgsql: Fix brain fade in previous pg_dump patch.