@@ -324,7 +324,7 @@ static void binary_upgrade_set_type_oids_by_rel(Archive *fout,
324
324
const TableInfo *tbinfo);
325
325
static void binary_upgrade_set_pg_class_oids(Archive *fout,
326
326
PQExpBuffer upgrade_buffer,
327
- Oid pg_class_oid, bool is_index );
327
+ Oid pg_class_oid);
328
328
static void binary_upgrade_extension_member(PQExpBuffer upgrade_buffer,
329
329
const DumpableObject *dobj,
330
330
const char *objtype,
@@ -5385,8 +5385,7 @@ binary_upgrade_set_type_oids_by_rel(Archive *fout,
5385
5385
5386
5386
static void
5387
5387
binary_upgrade_set_pg_class_oids(Archive *fout,
5388
- PQExpBuffer upgrade_buffer, Oid pg_class_oid,
5389
- bool is_index)
5388
+ PQExpBuffer upgrade_buffer, Oid pg_class_oid)
5390
5389
{
5391
5390
PQExpBuffer upgrade_query = createPQExpBuffer();
5392
5391
PGresult *upgrade_res;
@@ -5435,7 +5434,8 @@ binary_upgrade_set_pg_class_oids(Archive *fout,
5435
5434
appendPQExpBufferStr(upgrade_buffer,
5436
5435
"\n-- For binary upgrade, must preserve pg_class oids and relfilenodes\n");
5437
5436
5438
- if (!is_index)
5437
+ if (relkind != RELKIND_INDEX &&
5438
+ relkind != RELKIND_PARTITIONED_INDEX)
5439
5439
{
5440
5440
appendPQExpBuffer(upgrade_buffer,
5441
5441
"SELECT pg_catalog.binary_upgrade_set_next_heap_pg_class_oid('%u'::pg_catalog.oid);\n",
@@ -11520,7 +11520,7 @@ dumpCompositeType(Archive *fout, const TypeInfo *tyinfo)
11520
11520
binary_upgrade_set_type_oids_by_type_oid(fout, q,
11521
11521
tyinfo->dobj.catId.oid,
11522
11522
false, false);
11523
- binary_upgrade_set_pg_class_oids(fout, q, tyinfo->typrelid, false );
11523
+ binary_upgrade_set_pg_class_oids(fout, q, tyinfo->typrelid);
11524
11524
}
11525
11525
11526
11526
qtypname = pg_strdup(fmtId(tyinfo->dobj.name));
@@ -15654,7 +15654,7 @@ dumpTableSchema(Archive *fout, const TableInfo *tbinfo)
15654
15654
15655
15655
if (dopt->binary_upgrade)
15656
15656
binary_upgrade_set_pg_class_oids(fout, q,
15657
- tbinfo->dobj.catId.oid, false );
15657
+ tbinfo->dobj.catId.oid);
15658
15658
15659
15659
appendPQExpBuffer(q, "CREATE VIEW %s", qualrelname);
15660
15660
@@ -15756,7 +15756,7 @@ dumpTableSchema(Archive *fout, const TableInfo *tbinfo)
15756
15756
15757
15757
if (dopt->binary_upgrade)
15758
15758
binary_upgrade_set_pg_class_oids(fout, q,
15759
- tbinfo->dobj.catId.oid, false );
15759
+ tbinfo->dobj.catId.oid);
15760
15760
15761
15761
appendPQExpBuffer(q, "CREATE %s%s %s",
15762
15762
tbinfo->relpersistence == RELPERSISTENCE_UNLOGGED ?
@@ -16607,7 +16607,7 @@ dumpIndex(Archive *fout, const IndxInfo *indxinfo)
16607
16607
16608
16608
if (dopt->binary_upgrade)
16609
16609
binary_upgrade_set_pg_class_oids(fout, q,
16610
- indxinfo->dobj.catId.oid, true );
16610
+ indxinfo->dobj.catId.oid);
16611
16611
16612
16612
/* Plain secondary index */
16613
16613
appendPQExpBuffer(q, "%s;\n", indxinfo->indexdef);
@@ -16861,7 +16861,7 @@ dumpConstraint(Archive *fout, const ConstraintInfo *coninfo)
16861
16861
16862
16862
if (dopt->binary_upgrade)
16863
16863
binary_upgrade_set_pg_class_oids(fout, q,
16864
- indxinfo->dobj.catId.oid, true );
16864
+ indxinfo->dobj.catId.oid);
16865
16865
16866
16866
appendPQExpBuffer(q, "ALTER %sTABLE ONLY %s\n", foreign,
16867
16867
fmtQualifiedDumpable(tbinfo));
@@ -17255,7 +17255,7 @@ dumpSequence(Archive *fout, const TableInfo *tbinfo)
17255
17255
if (dopt->binary_upgrade)
17256
17256
{
17257
17257
binary_upgrade_set_pg_class_oids(fout, query,
17258
- tbinfo->dobj.catId.oid, false );
17258
+ tbinfo->dobj.catId.oid);
17259
17259
17260
17260
/*
17261
17261
* In older PG versions a sequence will have a pg_type entry, but v14
0 commit comments