]> granicus.if.org Git - postgresql/commit
Fix pg_dump for better handling of inherited columns.
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 10 Feb 2012 18:28:10 +0000 (13:28 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 10 Feb 2012 18:28:10 +0000 (13:28 -0500)
commit182228bd747caa362664bff525fc8346a37da16e
tree211a079cc4177b39575d8af5d0b8d4493fedc8c6
parent1e7d008bf899764f20b8f23bc182886f908277f9
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.
src/bin/pg_dump/common.c
src/bin/pg_dump/pg_dump.c
src/bin/pg_dump/pg_dump.h
src/bin/pg_dump/pg_dump_sort.c