diff options
author | Nathan Bossart <nathan@postgresql.org> | 2024-07-03 10:58:26 -0500 |
---|---|---|
committer | Nathan Bossart <nathan@postgresql.org> | 2024-07-03 10:58:26 -0500 |
commit | 6e1c4a03a978ed3574124d8f2be22ba2e5a4b1e9 (patch) | |
tree | 3e5f95b322e46e67f0038623a134ce512a3884c6 /src | |
parent | f3412a61f3f92d795ce0c8bb715831ec02124bfb (diff) | |
download | postgresql-6e1c4a03a978ed3574124d8f2be22ba2e5a4b1e9.tar.gz postgresql-6e1c4a03a978ed3574124d8f2be22ba2e5a4b1e9.zip |
Remove is_index parameter from binary_upgrade_set_pg_class_oids().
Since commit 9a974cbcba, this function retrieves the relkind before
it needs to know whether the relation is an index, so we no longer
need callers to provide this information.
Suggested-by: Daniel Gustafsson
Reviewed-by: Daniel Gustafsson
Discussion: https://postgr.es/m/20240418041712.GA3441570%40nathanxps13
Diffstat (limited to 'src')
-rw-r--r-- | src/bin/pg_dump/pg_dump.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c index 7aec016a9ff..6920b42bd26 100644 --- a/src/bin/pg_dump/pg_dump.c +++ b/src/bin/pg_dump/pg_dump.c @@ -324,7 +324,7 @@ static void binary_upgrade_set_type_oids_by_rel(Archive *fout, const TableInfo *tbinfo); static void binary_upgrade_set_pg_class_oids(Archive *fout, PQExpBuffer upgrade_buffer, - Oid pg_class_oid, bool is_index); + Oid pg_class_oid); static void binary_upgrade_extension_member(PQExpBuffer upgrade_buffer, const DumpableObject *dobj, const char *objtype, @@ -5385,8 +5385,7 @@ binary_upgrade_set_type_oids_by_rel(Archive *fout, static void binary_upgrade_set_pg_class_oids(Archive *fout, - PQExpBuffer upgrade_buffer, Oid pg_class_oid, - bool is_index) + PQExpBuffer upgrade_buffer, Oid pg_class_oid) { PQExpBuffer upgrade_query = createPQExpBuffer(); PGresult *upgrade_res; @@ -5435,7 +5434,8 @@ binary_upgrade_set_pg_class_oids(Archive *fout, appendPQExpBufferStr(upgrade_buffer, "\n-- For binary upgrade, must preserve pg_class oids and relfilenodes\n"); - if (!is_index) + if (relkind != RELKIND_INDEX && + relkind != RELKIND_PARTITIONED_INDEX) { appendPQExpBuffer(upgrade_buffer, "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) binary_upgrade_set_type_oids_by_type_oid(fout, q, tyinfo->dobj.catId.oid, false, false); - binary_upgrade_set_pg_class_oids(fout, q, tyinfo->typrelid, false); + binary_upgrade_set_pg_class_oids(fout, q, tyinfo->typrelid); } qtypname = pg_strdup(fmtId(tyinfo->dobj.name)); @@ -15654,7 +15654,7 @@ dumpTableSchema(Archive *fout, const TableInfo *tbinfo) if (dopt->binary_upgrade) binary_upgrade_set_pg_class_oids(fout, q, - tbinfo->dobj.catId.oid, false); + tbinfo->dobj.catId.oid); appendPQExpBuffer(q, "CREATE VIEW %s", qualrelname); @@ -15756,7 +15756,7 @@ dumpTableSchema(Archive *fout, const TableInfo *tbinfo) if (dopt->binary_upgrade) binary_upgrade_set_pg_class_oids(fout, q, - tbinfo->dobj.catId.oid, false); + tbinfo->dobj.catId.oid); appendPQExpBuffer(q, "CREATE %s%s %s", tbinfo->relpersistence == RELPERSISTENCE_UNLOGGED ? @@ -16607,7 +16607,7 @@ dumpIndex(Archive *fout, const IndxInfo *indxinfo) if (dopt->binary_upgrade) binary_upgrade_set_pg_class_oids(fout, q, - indxinfo->dobj.catId.oid, true); + indxinfo->dobj.catId.oid); /* Plain secondary index */ appendPQExpBuffer(q, "%s;\n", indxinfo->indexdef); @@ -16861,7 +16861,7 @@ dumpConstraint(Archive *fout, const ConstraintInfo *coninfo) if (dopt->binary_upgrade) binary_upgrade_set_pg_class_oids(fout, q, - indxinfo->dobj.catId.oid, true); + indxinfo->dobj.catId.oid); appendPQExpBuffer(q, "ALTER %sTABLE ONLY %s\n", foreign, fmtQualifiedDumpable(tbinfo)); @@ -17255,7 +17255,7 @@ dumpSequence(Archive *fout, const TableInfo *tbinfo) if (dopt->binary_upgrade) { binary_upgrade_set_pg_class_oids(fout, query, - tbinfo->dobj.catId.oid, false); + tbinfo->dobj.catId.oid); /* * In older PG versions a sequence will have a pg_type entry, but v14 |