Re: pgsql: pg_upgrade: Preserve relfilenodes and tablespace OIDs.

From: Christoph Berg <myon(at)debian(dot)org>
To: Robert Haas <rhaas(at)postgresql(dot)org>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: pgsql: pg_upgrade: Preserve relfilenodes and tablespace OIDs.
Date: 2022-02-13 11:51:10
Message-ID: YgjwrkEvNEqoz4Vm@msg.df7cb.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

Re: Robert Haas
> pg_upgrade: Preserve relfilenodes and tablespace OIDs.

> src/bin/pg_dump/pg_dumpall.c | 3 +

--- a/src/bin/pg_dump/pg_dumpall.c
+++ b/src/bin/pg_dump/pg_dumpall.c
@@ -1066,6 +1066,9 @@ dumpTablespaces(PGconn *conn)
/* needed for buildACLCommands() */
fspcname = pg_strdup(fmtId(spcname));

+ appendPQExpBufferStr(buf, "\n-- For binary upgrade, must preserve pg_table
+ appendPQExpBuffer(buf, "SELECT pg_catalog.binary_upgrade_set_next_pg_table

This needs to be guarded with "if (binary_upgrade)".

Error message during a Debian pg_upgradecluster (-m dump) from 14 to 15:

2022-02-13 12:44:01.272 CET [168032] postgres(at)template1 LOG: statement: SELECT pg_catalog.binary_upgrade_set_next_pg_tablespace_oid('16408'::pg_catalog.oid);
2022-02-13 12:44:01.272 CET [168032] postgres(at)template1 ERROR: function can only be called when server is in binary upgrade mode
2022-02-13 12:44:01.272 CET [168032] postgres(at)template1 STATEMENT: SELECT pg_catalog.binary_upgrade_set_next_pg_tablespace_oid('16408'::pg_catalog.oid);

Christoph

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Alvaro Herrera 2022-02-13 15:26:37 Re: pgsql: Fix skip-empty-xacts with sequences in test_decoding
Previous Message Tom Lane 2022-02-13 04:12:50 Re: pgsql: Add suport for server-side LZ4 base backup compression.

Browse pgsql-hackers by date

  From Date Subject
Next Message John Naylor 2022-02-13 12:14:07 Re: Non-decimal integer literals
Previous Message Andres Freund 2022-02-13 08:30:06 Re: Adding CI to our tree