HiveBrain v1.2.0
Get Started
← Back to all entries
patternsqlMinor

Postgresql Upgrade from 9.1.9 to 9.4.5 pg_stat_activity.procpid causes failure

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
postgresqlpg_stat_activityprocpidfailurefromupgradecauses

Problem

Attempting to upgrade from 9.1.9 to 9.4.5 Postgresql.

pg_upgrade process fails while trying to pg_restore pg_stat_activity. This fails because the column name differs from the old system to the new system.

pg_restore: [archiver (db)] Error while PROCESSING TOC:
pg_restore: [archiver (db)] Error from TOC entry 498; 1259 26457 VIEW blocking_procs postgres
pg_restore: [archiver (db)] could not execute query: ERROR:  column a.procpid does not exist
LINE 14: ...bl" JOIN "pg_stat_activity" "a" ON (("bl"."pid" = "a"."procp...


How does one solve this issue and use pg_upgrade to move from 9.1.9 to 9.4.5?

Solution

Apparently, you have a view, blocking_procs on top of pg_stat_activity. You will need to drop that view and reinstall it after the upgrade.

DROP VIEW blocking_procs;

Code Snippets

DROP VIEW blocking_procs;

Context

StackExchange Database Administrators Q#148495, answer score: 2

Revisions (0)

No revisions yet.