2

I am using pg_upgrade to move data from v11 to v14, but it is failing because of one database.

Before running upgrade I use to check the cluster compatibility, which seems well. below is log.

pg_upgrade -d /Users/Pro/pg_backup/postgres.old -D /usr/local/var/postgres/ -b /usr/local/Cellar/postgresql@11/11.14_1/bin/ -B /usr/local/Cellar/postgresql/14.1_1/bin --link --check
Performing Consistency Checks
-----------------------------
Checking cluster versions                                   ok
Checking database user is the install user                  ok
Checking database connection settings                       ok
Checking for prepared transactions                          ok
Checking for system-defined composite types in user tables  ok
Checking for reg* data types in user tables                 ok
Checking for contrib/isn with bigint-passing mismatch       ok
Checking for user-defined encoding conversions              ok
Checking for user-defined postfix operators                 ok
Checking for tables WITH OIDS                               ok
Checking for invalid "sql_identifier" user columns          ok
Checking for presence of required libraries                 ok
Checking database user is the install user                  ok
Checking for prepared transactions                          ok
Checking for new cluster tablespace directories             ok

*Clusters are compatible*

but when I run without check it exits with below error message..

"/usr/local/Cellar/postgresql/14.1_1/bin/pg_restore" --host /usr/local/Cellar/postgresql/14.1_1/bin --port 50432 --username Pro --create --exit-on-error --verbose --dbname template1 "pg_upgrade_dump_4552187.custom" >> "pg_upgrade_dump_4552187.log" 2>&1

*failure*
There were problems executing ""/usr/local/Cellar/postgresql/14.1_1/bin/pg_restore" --host /usr/local/Cellar/postgresql/14.1_1/bin --port 50432 --username Pro --create --exit-on-error --verbose --dbname template1 "pg_upgrade_dump_4552187.custom" >> "pg_upgrade_dump_4552187.log" 2>&1"

Consult the last few lines of "pg_upgrade_dump_4552187.log" for
the probable cause of the failure.
Failure, exiting
"/usr/local/Cellar/postgresql/14.1_1/bin/pg_ctl" -w -D "/usr/local/var/postgres" -o "" -m fast stop >> "pg_upgrade_server.log" 2>&1

when I checked the log file there was no error but this is what last few line said

-- For binary upgrade, set toast's relfrozenxid and relminmxid
UPDATE pg_catalog.pg_class
SET relfrozenxid = '3451702', relminmxid = '11832'
WHERE oid = '4552289';

Is there any way I can skip this database or bypass the error while pg_upgrade ?

Alpha Geek
  • 457
  • 7
  • 17
  • 2
    As a rule of thumb, it's usually recommendable to upgrade one major version at a time, as usually the process to upgrade multiple versions in one go is not tested in any software package. – Augusto Jan 08 '22 at 11:23
  • Do what it says. Consult the last few lines of pg_upgrade_dump_4552187.log. – jjanes Jan 08 '22 at 13:07
  • @jjanes, I already did.. but have not got any error or clue. see my updated answer. – Alpha Geek Jan 09 '22 at 05:34
  • Hmm, that does look pretty uninformative. Can you go back several more lines? Do you have "weird" settings in the new server's config file? Is this error reproducible if you re-init the new system and repeat? – jjanes Jan 10 '22 at 00:34
  • And by "several more" lines, I mean maybe like up to 100 more. – jjanes Jan 10 '22 at 01:16

0 Answers0