postgres.git / summary / log / commit / refs

commit    97dc3c8a147c01da38570e4be7b4979af918dca2
Author:   Tom Lane <tgl@sss.pgh.pa.us>
Date:     Fri Feb 10 19:09:21 2012 +0000
First released in: 9.2.0, 8.3.18, 8.4.11, 9.0.7, 9.1.3

    Fix brain fade in previous pg_dump patch.
    
    In pre-7.3 databases, pg_attribute.attislocal doesn't exist.  The easiest
    way to make sure the new inheritance logic behaves sanely is to assume it's
    TRUE, not FALSE.  This will result in printing child columns even when
    they're not really needed.  We could work harder at trying to reconstruct a
    value for attislocal, but there is little evidence that anyone still cares
    about dumping from such old versions, so just do the minimum necessary to
    have a valid dump.
    
    I had this correct in the original draft of the patch, but for some
    unaccountable reason decided it wasn't necessary to change the value.
    Testing against an old server shows otherwise...


src/bin/pg_dump/pg_dump.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c index c55f71cd9a0..91ca9fdd895 100644 --- a/src/bin/pg_dump/pg_dump.c +++ b/src/bin/pg_dump/pg_dump.c @@ -5835,13 +5835,13 @@ getTableAttrs(Archive *fout, TableInfo *tblinfo, int numTables) * explicitly set or was just a default. * * attislocal doesn't exist before 7.3, either; in older databases - * we just assume that inherited columns had no local definition. + * we assume it's TRUE, else we'd fail to dump non-inherited atts. */ appendPQExpBuffer(q, "SELECT a.attnum, a.attname, a.atttypmod, " "-1 AS attstattarget, a.attstorage, " "t.typstorage, a.attnotnull, a.atthasdef, " "false AS attisdropped, a.attlen, " - "a.attalign, false AS attislocal, " + "a.attalign, true AS attislocal, " "format_type(t.oid,a.atttypmod) AS atttypname, " "'' AS attoptions, 0 AS attcollation, " "NULL AS attfdwoptions " @@ -5860,7 +5860,7 @@ getTableAttrs(Archive *fout, TableInfo *tblinfo, int numTables) "attstorage, attstorage AS typstorage, " "attnotnull, atthasdef, false AS attisdropped, " "attlen, attalign, " - "false AS attislocal, " + "true AS attislocal, " "(SELECT typname FROM pg_type WHERE oid = atttypid) AS atttypname, " "'' AS attoptions, 0 AS attcollation, " "NULL AS attfdwoptions " [parent: 00bc96bd2b66]