1212 * by PostgreSQL
1313 *
1414 * IDENTIFICATION
15- * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.565 2010/01/06 03:04:02 momjian Exp $
15+ * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.566 2010/01/06 05:18:18 momjian Exp $
1616 *
1717 *-------------------------------------------------------------------------
1818 */
@@ -7192,6 +7192,7 @@ dumpCompositeType(Archive *fout, TypeInfo *tyinfo)
71927192 int ntups ;
71937193 int i_attname ;
71947194 int i_atttypdefn ;
7195+ int i_typrelid ;
71957196 int i ;
71967197
71977198 /* Set proper schema search path so type references list correctly */
@@ -7201,7 +7202,8 @@ dumpCompositeType(Archive *fout, TypeInfo *tyinfo)
72017202 /* We assume here that remoteVersion must be at least 70300 */
72027203
72037204 appendPQExpBuffer (query , "SELECT a.attname, "
7204- "pg_catalog.format_type(a.atttypid, a.atttypmod) AS atttypdefn "
7205+ "pg_catalog.format_type(a.atttypid, a.atttypmod) AS atttypdefn, "
7206+ "typrelid "
72057207 "FROM pg_catalog.pg_type t, pg_catalog.pg_attribute a "
72067208 "WHERE t.oid = '%u'::pg_catalog.oid "
72077209 "AND a.attrelid = t.typrelid "
@@ -7222,9 +7224,15 @@ dumpCompositeType(Archive *fout, TypeInfo *tyinfo)
72227224
72237225 i_attname = PQfnumber (res , "attname" );
72247226 i_atttypdefn = PQfnumber (res , "atttypdefn" );
7227+ i_typrelid = PQfnumber (res , "typrelid" );
72257228
72267229 if (binary_upgrade )
7230+ {
7231+ Oid typrelid = atooid (PQgetvalue (res , 0 , i_typrelid ));
7232+
72277233 binary_upgrade_set_type_oids_by_type_oid (q , tyinfo -> dobj .catId .oid );
7234+ binary_upgrade_set_relfilenodes (q , typrelid , false);
7235+ }
72287236
72297237 appendPQExpBuffer (q , "CREATE TYPE %s AS (" ,
72307238 fmtId (tyinfo -> dobj .name ));
@@ -10518,6 +10526,9 @@ dumpTableSchema(Archive *fout, TableInfo *tbinfo)
1051810526 appendPQExpBuffer (delq , "%s;\n" ,
1051910527 fmtId (tbinfo -> dobj .name ));
1052010528
10529+ if (binary_upgrade )
10530+ binary_upgrade_set_relfilenodes (q , tbinfo -> dobj .catId .oid , false);
10531+
1052110532 appendPQExpBuffer (q , "CREATE VIEW %s AS\n %s\n" ,
1052210533 fmtId (tbinfo -> dobj .name ), viewdef );
1052310534
0 commit comments