Fix pg_dump to use NULL placeholder for version-dependent attributes to
authorShigeru Hanada <shigeru.hanada@gmail.com>
Mon, 27 Jun 2011 13:34:08 +0000 (22:34 +0900)
committerShigeru Hanada <shigeru.hanada@gmail.com>
Mon, 27 Jun 2011 13:34:08 +0000 (22:34 +0900)
avoid error which occurs when connecting older version of PG server.

src/bin/pg_dump/pg_dump.c

index 04ca7f6cb2621608681e2b5369ed7b3533a48e0d..258e15383d0886491438a630f68233bc9580d812 100644 (file)
@@ -5633,7 +5633,8 @@ getTableAttrs(TableInfo *tblinfo, int numTables)
                  "pg_catalog.format_type(t.oid,a.atttypmod) AS atttypname, "
                        "array_to_string(a.attoptions, ', ') AS attoptions, "
                              "CASE WHEN a.attcollation <> t.typcollation "
-                           "THEN a.attcollation ELSE 0 END AS attcollation "
+                           "THEN a.attcollation ELSE 0 END AS attcollation, "
+                             "NULL AS attfdwoptions "
             "FROM pg_catalog.pg_attribute a LEFT JOIN pg_catalog.pg_type t "
                              "ON a.atttypid = t.oid "
                              "WHERE a.attrelid = '%u'::pg_catalog.oid "
@@ -5651,7 +5652,8 @@ getTableAttrs(TableInfo *tblinfo, int numTables)
                              "a.attlen, a.attalign, a.attislocal, "
                  "pg_catalog.format_type(t.oid,a.atttypmod) AS atttypname, "
                        "array_to_string(a.attoptions, ', ') AS attoptions, "
-                             "0 AS attcollation "
+                             "0 AS attcollation, "
+                             "NULL AS attfdwoptions "
             "FROM pg_catalog.pg_attribute a LEFT JOIN pg_catalog.pg_type t "
                              "ON a.atttypid = t.oid "
                              "WHERE a.attrelid = '%u'::pg_catalog.oid "
@@ -5667,7 +5669,8 @@ getTableAttrs(TableInfo *tblinfo, int numTables)
                              "a.attnotnull, a.atthasdef, a.attisdropped, "
                              "a.attlen, a.attalign, a.attislocal, "
                  "pg_catalog.format_type(t.oid,a.atttypmod) AS atttypname, "
-                             "'' AS attoptions, 0 AS attcollation "
+                             "'' AS attoptions, 0 AS attcollation, "
+                             "NULL AS attfdwoptions "
             "FROM pg_catalog.pg_attribute a LEFT JOIN pg_catalog.pg_type t "
                              "ON a.atttypid = t.oid "
                              "WHERE a.attrelid = '%u'::pg_catalog.oid "
@@ -5688,7 +5691,8 @@ getTableAttrs(TableInfo *tblinfo, int numTables)
                              "false AS attisdropped, a.attlen, "
                              "a.attalign, false AS attislocal, "
                              "format_type(t.oid,a.atttypmod) AS atttypname, "
-                             "'' AS attoptions, 0 AS attcollation "
+                             "'' AS attoptions, 0 AS attcollation, "
+                             "NULL AS attfdwoptions "
                              "FROM pg_attribute a LEFT JOIN pg_type t "
                              "ON a.atttypid = t.oid "
                              "WHERE a.attrelid = '%u'::oid "
@@ -5706,7 +5710,8 @@ getTableAttrs(TableInfo *tblinfo, int numTables)
                              "attlen, attalign, "
                              "false AS attislocal, "
                              "(SELECT typname FROM pg_type WHERE oid = atttypid) AS atttypname, "
-                             "'' AS attoptions, 0 AS attcollation "
+                             "'' AS attoptions, 0 AS attcollation, "
+                             "NULL AS attfdwoptions "
                              "FROM pg_attribute a "
                              "WHERE attrelid = '%u'::oid "
                              "AND attnum > 0::int2 "