Re: pgsql: pg_upgrade: Preserve relfilenodes and tablespace OIDs. - Mailing list pgsql-hackers

From Christoph Berg
Subject Re: pgsql: pg_upgrade: Preserve relfilenodes and tablespace OIDs.
Date
Msg-id YgjwrkEvNEqoz4Vm@msg.df7cb.de
Whole thread Raw
Responses Re: pgsql: pg_upgrade: Preserve relfilenodes and tablespace OIDs.  (Robert Haas <robertmhaas@gmail.com>)
List 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@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@template1 ERROR:  function can only be called when server is in binary
upgrademode
 
2022-02-13 12:44:01.272 CET [168032] postgres@template1 STATEMENT:  SELECT
pg_catalog.binary_upgrade_set_next_pg_tablespace_oid('16408'::pg_catalog.oid);

Christoph



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Adding CI to our tree
Next
From: John Naylor
Date:
Subject: Re: Non-decimal integer literals