upgrading postgres db
search cancel

upgrading postgres db

book

Article ID: 261687

calendar_today

Updated On:

Products

DX Application Performance Management

Issue/Introduction

I was following the steps from APM 10.x - How to manual upgrade PostgreSQL 9.6.2 to 13.4 and higher versions? to upgrade PostgreSQL and ran into the following problem

[postgres@host_name data]$ /usr/pgsql-13/bin/pg_upgrade -b /opt/apm/postgres/PostgreSQL-9.6.2/bin -B /usr/pgsql-13/bin -d /opt/apm/postgres/PostgreSQL-9.6.2/data -D /opt/apm/pgsql/13/data
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 tables WITH OIDS                               ok
Checking for invalid "sql_identifier" user columns          ok
Checking for invalid "unknown" user columns                 ok
Creating dump of global objects                             ok
Creating dump of database schemas
                                                            ok

New cluster database "cemdb" is not empty: found relation "public.ts_app_auth_types"
Failure, exiting

Environment

Release : 10.7.0

Resolution

pg_upgrade Troubleshooting

Upgrade Error - New cluster is not empty; exiting

If pg_upgrade reports that the new cluster is not empty, please empty the new clusterThe target cluster may not contain any user-defined databases.