aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/bin/pg_dump/pg_dump.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c
index c5f3bc14476..4f9938a6acf 100644
--- a/src/bin/pg_dump/pg_dump.c
+++ b/src/bin/pg_dump/pg_dump.c
@@ -8085,7 +8085,6 @@ dumpCompositeType(Archive *fout, TypeInfo *tyinfo)
int i_attalign;
int i_attisdropped;
int i_attcollation;
- int i_typrelid;
int i;
int actual_atts;
@@ -8106,8 +8105,7 @@ dumpCompositeType(Archive *fout, TypeInfo *tyinfo)
"pg_catalog.format_type(a.atttypid, a.atttypmod) AS atttypdefn, "
"a.attlen, a.attalign, a.attisdropped, "
"CASE WHEN a.attcollation <> at.typcollation "
- "THEN a.attcollation ELSE 0 END AS attcollation, "
- "ct.typrelid "
+ "THEN a.attcollation ELSE 0 END AS attcollation "
"FROM pg_catalog.pg_type ct "
"JOIN pg_catalog.pg_attribute a ON a.attrelid = ct.typrelid "
"LEFT JOIN pg_catalog.pg_type at ON at.oid = a.atttypid "
@@ -8125,8 +8123,7 @@ dumpCompositeType(Archive *fout, TypeInfo *tyinfo)
appendPQExpBuffer(query, "SELECT a.attname, "
"pg_catalog.format_type(a.atttypid, a.atttypmod) AS atttypdefn, "
"a.attlen, a.attalign, a.attisdropped, "
- "0 AS attcollation, "
- "ct.typrelid "
+ "0 AS attcollation "
"FROM pg_catalog.pg_type ct, pg_catalog.pg_attribute a "
"WHERE ct.oid = '%u'::pg_catalog.oid "
"AND a.attrelid = ct.typrelid "
@@ -8145,14 +8142,11 @@ dumpCompositeType(Archive *fout, TypeInfo *tyinfo)
i_attalign = PQfnumber(res, "attalign");
i_attisdropped = PQfnumber(res, "attisdropped");
i_attcollation = PQfnumber(res, "attcollation");
- i_typrelid = PQfnumber(res, "typrelid");
if (binary_upgrade)
{
- Oid typrelid = atooid(PQgetvalue(res, 0, i_typrelid));
-
binary_upgrade_set_type_oids_by_type_oid(q, tyinfo->dobj.catId.oid);
- binary_upgrade_set_pg_class_oids(q, typrelid, false);
+ binary_upgrade_set_pg_class_oids(q, tyinfo->typrelid, false);
}
appendPQExpBuffer(q, "CREATE TYPE %s AS (",