Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit97dc3c8

Browse files
committed
Fix brain fade in previous pg_dump patch.
In pre-7.3 databases, pg_attribute.attislocal doesn't exist. The easiestway to make sure the new inheritance logic behaves sanely is to assume it'sTRUE, not FALSE. This will result in printing child columns even whenthey're not really needed. We could work harder at trying to reconstruct avalue for attislocal, but there is little evidence that anyone still caresabout dumping from such old versions, so just do the minimum necessary tohave a valid dump.I had this correct in the original draft of the patch, but for someunaccountable reason decided it wasn't necessary to change the value.Testing against an old server shows otherwise...
1 parent00bc96b commit97dc3c8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

‎src/bin/pg_dump/pg_dump.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5835,13 +5835,13 @@ getTableAttrs(Archive *fout, TableInfo *tblinfo, int numTables)
58355835
* explicitly set or was just a default.
58365836
*
58375837
* attislocal doesn't exist before 7.3, either; in older databases
5838-
* wejustassumethat inherited columns had no local definition.
5838+
* we assumeit's TRUE, else we'd fail to dump non-inherited atts.
58395839
*/
58405840
appendPQExpBuffer(q,"SELECT a.attnum, a.attname, a.atttypmod, "
58415841
"-1 AS attstattarget, a.attstorage, "
58425842
"t.typstorage, a.attnotnull, a.atthasdef, "
58435843
"false AS attisdropped, a.attlen, "
5844-
"a.attalign,false AS attislocal, "
5844+
"a.attalign,true AS attislocal, "
58455845
"format_type(t.oid,a.atttypmod) AS atttypname, "
58465846
"'' AS attoptions, 0 AS attcollation, "
58475847
"NULL AS attfdwoptions "
@@ -5860,7 +5860,7 @@ getTableAttrs(Archive *fout, TableInfo *tblinfo, int numTables)
58605860
"attstorage, attstorage AS typstorage, "
58615861
"attnotnull, atthasdef, false AS attisdropped, "
58625862
"attlen, attalign, "
5863-
"false AS attislocal, "
5863+
"true AS attislocal, "
58645864
"(SELECT typname FROM pg_type WHERE oid = atttypid) AS atttypname, "
58655865
"'' AS attoptions, 0 AS attcollation, "
58665866
"NULL AS attfdwoptions "

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp