Re: pg_upgrade fails with an error "object doesn't exist"

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: Vaibhav Dalvi <vaibhav(dot)dalvi(at)enterprisedb(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: pg_upgrade fails with an error "object doesn't exist"
Date: 2025-06-13 08:37:49
Message-ID: 8f7d90ef36c1be01e0111ec99493a8b4116c14ca.camel@cybertec.at
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dilip Kumar 2025-06-13 09:47:53 Re: Question on error code selection in conflict detection
Previous Message Vaibhav Dalvi 2025-06-13 08:08:52 pg_upgrade fails with an error "object doesn't exist"