BUG #15806: pg_upgrade failure column pg_stat_replication.sent_location does not exist

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

BUG #15806: pg_upgrade failure column pg_stat_replication.sent_location does not exist

PG Doc comments form
The following bug has been logged on the website:

Bug reference:      15806
Logged by:          Todd Vernick
Email address:      [hidden email]
PostgreSQL version: 9.6.4
Operating system:   CentOS Linux release 7.4.1708
Description:        

Upgrading from 9.6.4 to 11.3 or 10.3 fails. This was reproduced on another
user on the slack general channel. The check does not catch it.

-bash-4.1$ /usr/pgsql-10/bin/pg_upgrade -d /var/lib/pgsql/9.6/data/ -D
/tmp/data -b /usr/pgsql-9.6/bin/ -B /usr/pgsql-10/bin/ --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 reg* data types in user tables                 ok
Checking for contrib/isn with bigint-passing mismatch       ok
Checking for invalid "unknown" user columns                 ok
Checking for hash indexes                                   ok
Checking for presence of required libraries                 ok
Checking database user is the install user                  ok
Checking for prepared transactions                          ok
*Clusters are compatible*

-bash-4.1$ /usr/pgsql-10/bin/pg_upgrade -d /var/lib/pgsql/9.6/data/ -D
/tmp/data -b /usr/pgsql-9.6/bin/ -B /usr/pgsql-10/bin/
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 reg* data types in user tables                 ok
Checking for contrib/isn with bigint-passing mismatch       ok
Checking for invalid "unknown" user columns                 ok
Creating dump of global objects                             ok
Creating dump of database schemas
                                                            ok
Checking for presence of required libraries                 ok
Checking database user is the install user                  ok
Checking for prepared transactions                          ok
If pg_upgrade fails after this point, you must re-initdb the
new cluster before continuing.
Performing Upgrade
------------------
Analyzing all rows in the new cluster                       ok
Freezing all rows in the new cluster                        ok
Deleting files from new pg_xact                             ok
Copying old pg_clog to new server                           ok
Setting next transaction ID and epoch for new cluster       ok
Deleting files from new pg_multixact/offsets                ok
Copying old pg_multixact/offsets to new server              ok
Deleting files from new pg_multixact/members                ok
Copying old pg_multixact/members to new server              ok
Setting next multixact ID and offset for new cluster        ok
Resetting WAL archives                                      ok
Setting frozenxid and minmxid counters in new cluster       ok
Restoring global objects in the new cluster                 ok
Restoring database schemas in the new cluster
  postgres                                                  
*failure*
Consult the last few lines of "pg_upgrade_dump_13269.log" for
the probable cause of the failure.
Failure, exiting
-bash-4.1$ cat pg_upgrade_dump_13269.log
command: "/usr/pgsql-10/bin/pg_dump" --host /var/lib/pgsql --port 50432
--username postgres --schema-only --quote-all-identifiers --binary-upgrade
--format=custom  --file="pg_upgrade_dump_13269.custom" 'dbname=postgres' >>
"pg_upgrade_dump_13269.log" 2>&1
command: "/usr/pgsql-10/bin/pg_restore" --host /var/lib/pgsql --port 50432
--username postgres --exit-on-error --verbose --dbname 'dbname=postgres'
"pg_upgrade_dump_13269.custom" >> "pg_upgrade_dump_13269.log" 2>&1
pg_restore: connecting to database for restore
pg_restore: creating pg_largeobject "pg_largeobject"
pg_restore: creating pg_largeobject_metadata "pg_largeobject_metadata"
pg_restore: creating COMMENT "DATABASE "postgres""
pg_restore: creating SCHEMA "public"
pg_restore: creating COMMENT "SCHEMA "public""
pg_restore: creating VIEW "public.myview"
pg_restore: [archiver (db)] Error while PROCESSING TOC:
pg_restore: [archiver (db)] Error from TOC entry 185; 1259 16384 VIEW myview
postgres
pg_restore: [archiver (db)] could not execute query: ERROR:  column
pg_stat_replication.sent_location does not exist
LINE 14:  SELECT "pg_stat_replication"."sent_location"
                 ^
    Command was:
-- For binary upgrade, must preserve pg_type oid
SELECT
pg_catalog.binary_upgrade_set_next_pg_type_oid('16386'::pg_catalog.oid);
-- For binary upgrade, must preserve pg_type array oid
SELECT
pg_catalog.binary_upgrade_set_next_array_pg_type_oid('16385'::pg_catalog.oid);
-- For binary upgrade, must preserve pg_class oids
SELECT
pg_catalog.binary_upgrade_set_next_heap_pg_class_oid('16384'::pg_catalog.oid);
CREATE VIEW "public"."myview" AS
 SELECT "pg_stat_replication"."sent_location"
   FROM "pg_stat_replication";