12
12
* by PostgreSQL
13
13
*
14
14
* 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 $
16
16
*
17
17
*-------------------------------------------------------------------------
18
18
*/
@@ -7192,6 +7192,7 @@ dumpCompositeType(Archive *fout, TypeInfo *tyinfo)
7192
7192
int ntups ;
7193
7193
int i_attname ;
7194
7194
int i_atttypdefn ;
7195
+ int i_typrelid ;
7195
7196
int i ;
7196
7197
7197
7198
/* Set proper schema search path so type references list correctly */
@@ -7201,7 +7202,8 @@ dumpCompositeType(Archive *fout, TypeInfo *tyinfo)
7201
7202
/* We assume here that remoteVersion must be at least 70300 */
7202
7203
7203
7204
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 "
7205
7207
"FROM pg_catalog.pg_type t, pg_catalog.pg_attribute a "
7206
7208
"WHERE t.oid = '%u'::pg_catalog.oid "
7207
7209
"AND a.attrelid = t.typrelid "
@@ -7222,9 +7224,15 @@ dumpCompositeType(Archive *fout, TypeInfo *tyinfo)
7222
7224
7223
7225
i_attname = PQfnumber (res , "attname" );
7224
7226
i_atttypdefn = PQfnumber (res , "atttypdefn" );
7227
+ i_typrelid = PQfnumber (res , "typrelid" );
7225
7228
7226
7229
if (binary_upgrade )
7230
+ {
7231
+ Oid typrelid = atooid (PQgetvalue (res , 0 , i_typrelid ));
7232
+
7227
7233
binary_upgrade_set_type_oids_by_type_oid (q , tyinfo -> dobj .catId .oid );
7234
+ binary_upgrade_set_relfilenodes (q , typrelid , false);
7235
+ }
7228
7236
7229
7237
appendPQExpBuffer (q , "CREATE TYPE %s AS (" ,
7230
7238
fmtId (tyinfo -> dobj .name ));
@@ -10518,6 +10526,9 @@ dumpTableSchema(Archive *fout, TableInfo *tbinfo)
10518
10526
appendPQExpBuffer (delq , "%s;\n" ,
10519
10527
fmtId (tbinfo -> dobj .name ));
10520
10528
10529
+ if (binary_upgrade )
10530
+ binary_upgrade_set_relfilenodes (q , tbinfo -> dobj .catId .oid , false);
10531
+
10521
10532
appendPQExpBuffer (q , "CREATE VIEW %s AS\n %s\n" ,
10522
10533
fmtId (tbinfo -> dobj .name ), viewdef );
10523
10534
0 commit comments