Problems with pg_upgrade and extensions referencing catalog tables/views

From: "Nasby, Jim" <nasbyj(at)amazon(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Problems with pg_upgrade and extensions referencing catalog tables/views
Date: 2019-05-08 22:07:23
Message-ID: 052C3470-917A-4DC5-91B4-81F2D7C8950D@amazon.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

pgTap has a view that references pg_proc; to support introspection of functions and aggregates. That view references proisagg in versions < 11, and prokind in 11+. pgtap's make process understands how to handle this; modifying the creation scripts as necessary. It actually has to do this for several functions as well.

The problem is that pg_dump --binary-upgrade intentionally does not simply issue a `CREATE EXTENSION` command the way a normal dump does, so that it can control the OIDs that are assigned to objects[1]. That means that attempting to pg_upgrade a database with pgtap installed to version 11+ fails trying to create the view that references pg_proc.proisagg[2].

For pgtap, we should be able to work around this by removing the offending column from the view and embedding the knowledge in a function. This would be more difficult in other types of extensions though, especially any that are attempting to provide more user-friendly views of catalog tables.

I don’t recall why pg_upgrade wants to control OIDs… don’t we re-create all catalog entries for user objects from scratch?

1: https://www.postgresql.org/message-id/AANLkTimm1c64=xkdpz5ji7Q-rH69zd3cMewmRpkH0WSf@mail.gmail.com
2: https://github.com/theory/pgtap/issues/201

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Nasby, Jim 2019-05-08 22:31:15 Re: New EXPLAIN option: ALL
Previous Message Andres Freund 2019-05-08 21:51:35 Re: Inconsistency between table am callback and table function names