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

From: Vaibhav Dalvi <vaibhav(dot)dalvi(at)enterprisedb(dot)com>
To: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: pg_upgrade fails with an error "object doesn't exist"
Date: 2025-06-16 07:29:31
Message-ID: CA+vB=AG-RMr8EKm7vSk-pw-ShUTKs1R169Q3AzeCCEnBDa0efg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Laurenz,

Thanks for the response.

>
>
> > 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.
>
>
I'm able to create the object as shown in the below:

postgres=# CREATE OR REPLACE FUNCTION pg_catalog.nont_ext_func() RETURNS
char AS $$ BEGIN return 'v'; END; $$ LANGUAGE plpgsql;
CREATE FUNCTION

Why can't we strictly restrict object creation in pg_catalog?

Thanks,
Vaibhav

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Gustafsson 2025-06-16 07:57:09 Re: pg_upgrade fails with an error "object doesn't exist"
Previous Message Michael Paquier 2025-06-16 06:49:18 relrewrite not documented at the top of heap_create_with_catalog()