pgsql: Fix a couple of issues with pg_dump's handling of inheritance - Mailing list pgsql-committers

From tgl@postgresql.org (Tom Lane)
Subject pgsql: Fix a couple of issues with pg_dump's handling of inheritance
Date
Msg-id 20071028190802.8DB60754229@cvs.postgresql.org
Whole thread Raw
List pgsql-committers
Log Message:
-----------
Fix a couple of issues with pg_dump's handling of inheritance child tables
that have default expressions different from their parent.  First, if the
parent table's default expression has to be split out as a separate
ALTER TABLE command, we need a dependency constraint to ensure that the
child's command is given second.  This is because the ALTER TABLE on the
parent will propagate to the child.  (We can't prevent that by using ONLY on
the parent's command, since it's possible that other children exist that
should receive the inherited default.)  Second, if the child has a NULL
default where the parent does not, we have to explicitly say DEFAULT NULL on
the child in order for this state to be preserved after reload.  (The latter
actually doesn't work right because of a backend bug, but that is a separate
issue.)

Backpatch as far as 8.0.  7.x pg_dump has enough issues with altered tables
(due to lack of dependency analysis) that trying to fix this one doesn't seem
very productive.

Modified Files:
--------------
    pgsql/src/bin/pg_dump:
        common.c (r1.98 -> r1.99)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/bin/pg_dump/common.c?r1=1.98&r2=1.99)

pgsql-committers by date:

Previous
From: kostas@pgfoundry.org (User Kostas)
Date:
Subject: pgtreelib - pgtreelib:
Next
From: tgl@postgresql.org (Tom Lane)
Date:
Subject: pgsql: Fix a couple of issues with pg_dump's handling of inheritance