1 year ago

#26473

test-img

Alpha Geek

pg_upgrade failure while upgrading from v11 to v14

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 ?

postgresql

macos

pg-upgrade

0 Answers

Your Answer

Accepted video resources