]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix a couple of issues with pg_dump's handling of inheritance child tables
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 28 Oct 2007 19:08:16 +0000 (19:08 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 28 Oct 2007 19:08:16 +0000 (19:08 +0000)
commit56ac701b3b634aa325b8d97f4cafd0219aff36b8
tree3953b8f7853095b5c357b8227265e2c868104ce9
parent5808e2b1737368547b3658cdf1362c7e4130259e
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.
src/bin/pg_dump/common.c