Re: pg_upgrade fails with an error "object doesn't exist" - Mailing list pgsql-hackers

From Laurenz Albe
Subject Re: pg_upgrade fails with an error "object doesn't exist"
Date
Msg-id 8f7d90ef36c1be01e0111ec99493a8b4116c14ca.camel@cybertec.at
Whole thread Raw
In response to pg_upgrade fails with an error "object doesn't exist"  (Vaibhav Dalvi <vaibhav.dalvi@enterprisedb.com>)
List pgsql-hackers
On Fri, 2025-06-13 at 13:38 +0530, Vaibhav Dalvi wrote:
> I'm writing to share an observation regarding `pg_catalog` system objects
> and their privileges during `pg_upgrade`. It's known that `pg_catalog`
> system objects are not dumped, but their privileges are. However,
> if user-created objects are placed within `pg_catalog` and their privileges
> are altered, `pg_upgrade` can fail with an "object does not exist" error.

It is not supported to create objects in pg_catalog.  Don't do it.



> I believe one of the following approaches should be considered to prevent
> such failures:
>
> 1.  Restrict the creation of user objects within the `pg_catalog` schema.

That's already the case:

test=# CREATE TABLE pg_catalog.new ();
ERROR:  permission denied to create "pg_catalog.new"
DETAIL:  System catalog modifications are currently disallowed.

Yours,
Laurenz Albe



pgsql-hackers by date:

Previous
From: Vaibhav Dalvi
Date:
Subject: pg_upgrade fails with an error "object doesn't exist"
Next
From: Amit Kapila
Date:
Subject: Re: Question on error code selection in conflict detection