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

From: Vaibhav Dalvi <vaibhav(dot)dalvi(at)enterprisedb(dot)com>
To: Daniel Gustafsson <daniel(at)yesql(dot)se>
Cc: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, pgsql-hackers(at)lists(dot)postgresql(dot)org, Vaibhav Dalvi <vaibhav(dot)dalvi(at)enterprisedb(dot)com>
Subject: Re: pg_upgrade fails with an error "object doesn't exist"
Date: 2025-06-16 08:59:23
Message-ID: CA+vB=AGCxuAkbXLJ195aaBwSvyihMMNNP0Nc954obRhsMOwGSw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Daniel,

Thanks for your response.

On Mon, Jun 16, 2025 at 1:27 PM Daniel Gustafsson <daniel(at)yesql(dot)se> wrote:

> > On 16 Jun 2025, at 09:29, Vaibhav Dalvi <vaibhav(dot)dalvi(at)enterprisedb(dot)com>
> wrote:
>
> > 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?
>
> Do you have allow_system_table_mods set to ON by any chance? As Laurenz
> said,
> such creation is already restricted, but it can be circumvented by using
> said
> GUC (which is *not* intended for production usage).
>
> --
> Daniel Gustafsson
>

It's OFF.
postgres=# select version();
version

----------------------------------------------------------------------------------------------------------------
PostgreSQL 18beta1 on aarch64-unknown-linux-gnu, compiled by gcc (Ubuntu
14.2.0-4ubuntu2~24.04) 14.2.0, 64-bit
(1 row)
postgres=# show allow_system_table_mods ;
allow_system_table_mods
-------------------------
off
(1 row)
postgres=# CREATE FUNCTION pg_catalog.nont_ext_func() RETURNS char AS $$
BEGIN return 'v'; END; $$ LANGUAGE plpgsql;
CREATE FUNCTION
postgres=# \df+ nont_ext_func

List of functions
Schema | Name | Result data type | Argument data types | Type
| Volatility | Parallel | Owner | Security | Lea
kproof? | Access privileges | Language | Internal name | Description
------------+---------------+------------------+---------------------+------+------------+----------+---------+----------+----
--------+-------------------+----------+---------------+-------------
pg_catalog | nont_ext_func | character | | func
| volatile | unsafe | vaibhav | invoker | no
| | plpgsql | |
(1 row)

Regards,
Vaibhav

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Gustafsson 2025-06-16 09:00:47 Re: No error checking when reading from file using zstd in pg_dump
Previous Message Потапов Александр 2025-06-16 08:56:58 Re: Init connection time grows quadratically