diff options
| author | Peter Eisentraut | 2015-03-11 02:33:25 +0000 |
|---|---|---|
| committer | Peter Eisentraut | 2015-04-14 23:26:37 +0000 |
| commit | 30982be4e5019684e1772dd9170aaa53f5a8e894 (patch) | |
| tree | ee83c2fa412fb58cfb12c0a74211fb76b8b5eed7 /src/bin | |
| parent | 936546dcbc24ad1f2b3d33e73aa5c5fde4d2be84 (diff) | |
Integrate pg_upgrade_support module into backend
Previously, these functions were created in a schema "binary_upgrade",
which was deleted after pg_upgrade was finished. Because we don't want
to keep that schema around permanently, move them to pg_catalog but
rename them with a binary_upgrade_... prefix.
The provided functions are only small wrappers around global variables
that were added specifically for pg_upgrade use, so keeping the module
separate does not create any modularity.
The functions still check that they are only called in binary upgrade
mode, so it is not possible to call these during normal operation.
Reviewed-by: Michael Paquier <michael.paquier@gmail.com>
Diffstat (limited to 'src/bin')
| -rw-r--r-- | src/bin/pg_dump/pg_dump.c | 18 | ||||
| -rw-r--r-- | src/bin/pg_dump/pg_dumpall.c | 2 |
2 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 7da5c411949..fe08c1b15d2 100644 --- a/src/bin/pg_dump/pg_dump.c +++ b/src/bin/pg_dump/pg_dump.c @@ -3045,7 +3045,7 @@ binary_upgrade_set_type_oids_by_type_oid(Archive *fout, appendPQExpBufferStr(upgrade_buffer, "\n-- For binary upgrade, must preserve pg_type oid\n"); appendPQExpBuffer(upgrade_buffer, - "SELECT binary_upgrade.set_next_pg_type_oid('%u'::pg_catalog.oid);\n\n", + "SELECT pg_catalog.binary_upgrade_set_next_pg_type_oid('%u'::pg_catalog.oid);\n\n", pg_type_oid); /* we only support old >= 8.3 for binary upgrades */ @@ -3064,7 +3064,7 @@ binary_upgrade_set_type_oids_by_type_oid(Archive *fout, appendPQExpBufferStr(upgrade_buffer, "\n-- For binary upgrade, must preserve pg_type array oid\n"); appendPQExpBuffer(upgrade_buffer, - "SELECT binary_upgrade.set_next_array_pg_type_oid('%u'::pg_catalog.oid);\n\n", + "SELECT pg_catalog.binary_upgrade_set_next_array_pg_type_oid('%u'::pg_catalog.oid);\n\n", pg_type_array_oid); } @@ -3106,7 +3106,7 @@ binary_upgrade_set_type_oids_by_rel_oid(Archive *fout, appendPQExpBufferStr(upgrade_buffer, "\n-- For binary upgrade, must preserve pg_type toast oid\n"); appendPQExpBuffer(upgrade_buffer, - "SELECT binary_upgrade.set_next_toast_pg_type_oid('%u'::pg_catalog.oid);\n\n", + "SELECT pg_catalog.binary_upgrade_set_next_toast_pg_type_oid('%u'::pg_catalog.oid);\n\n", pg_type_toast_oid); toast_set = true; @@ -3146,7 +3146,7 @@ binary_upgrade_set_pg_class_oids(Archive *fout, if (!is_index) { appendPQExpBuffer(upgrade_buffer, - "SELECT binary_upgrade.set_next_heap_pg_class_oid('%u'::pg_catalog.oid);\n", + "SELECT pg_catalog.binary_upgrade_set_next_heap_pg_class_oid('%u'::pg_catalog.oid);\n", pg_class_oid); /* only tables have toast tables, not indexes */ if (OidIsValid(pg_class_reltoastrelid)) @@ -3161,18 +3161,18 @@ binary_upgrade_set_pg_class_oids(Archive *fout, */ appendPQExpBuffer(upgrade_buffer, - "SELECT binary_upgrade.set_next_toast_pg_class_oid('%u'::pg_catalog.oid);\n", + "SELECT pg_catalog.binary_upgrade_set_next_toast_pg_class_oid('%u'::pg_catalog.oid);\n", pg_class_reltoastrelid); /* every toast table has an index */ appendPQExpBuffer(upgrade_buffer, - "SELECT binary_upgrade.set_next_index_pg_class_oid('%u'::pg_catalog.oid);\n", + "SELECT pg_catalog.binary_upgrade_set_next_index_pg_class_oid('%u'::pg_catalog.oid);\n", pg_index_indexrelid); } } else appendPQExpBuffer(upgrade_buffer, - "SELECT binary_upgrade.set_next_index_pg_class_oid('%u'::pg_catalog.oid);\n", + "SELECT pg_catalog.binary_upgrade_set_next_index_pg_class_oid('%u'::pg_catalog.oid);\n", pg_class_oid); appendPQExpBufferChar(upgrade_buffer, '\n'); @@ -8352,7 +8352,7 @@ dumpExtension(Archive *fout, DumpOptions *dopt, ExtensionInfo *extinfo) appendPQExpBuffer(q, "DROP EXTENSION IF EXISTS %s;\n", qextname); appendPQExpBufferStr(q, - "SELECT binary_upgrade.create_empty_extension("); + "SELECT pg_catalog.binary_upgrade_create_empty_extension("); appendStringLiteralAH(q, extinfo->dobj.name, fout); appendPQExpBufferStr(q, ", "); appendStringLiteralAH(q, extinfo->namespace, fout); @@ -8530,7 +8530,7 @@ dumpEnumType(Archive *fout, DumpOptions *dopt, TypeInfo *tyinfo) if (i == 0) appendPQExpBufferStr(q, "\n-- For binary upgrade, must preserve pg_enum oids\n"); appendPQExpBuffer(q, - "SELECT binary_upgrade.set_next_pg_enum_oid('%u'::pg_catalog.oid);\n", + "SELECT pg_catalog.binary_upgrade_set_next_pg_enum_oid('%u'::pg_catalog.oid);\n", enum_oid); appendPQExpBuffer(q, "ALTER TYPE %s.", fmtId(tyinfo->dobj.namespace->dobj.name)); diff --git a/src/bin/pg_dump/pg_dumpall.c b/src/bin/pg_dump/pg_dumpall.c index 6a7a6415f6e..7169ad09ccf 100644 --- a/src/bin/pg_dump/pg_dumpall.c +++ b/src/bin/pg_dump/pg_dumpall.c @@ -781,7 +781,7 @@ dumpRoles(PGconn *conn) { appendPQExpBufferStr(buf, "\n-- For binary upgrade, must preserve pg_authid.oid\n"); appendPQExpBuffer(buf, - "SELECT binary_upgrade.set_next_pg_authid_oid('%u'::pg_catalog.oid);\n\n", + "SELECT pg_catalog.binary_upgrade_set_next_pg_authid_oid('%u'::pg_catalog.oid);\n\n", auth_oid); } |
