From: Julien Rouhaud <rjuju123@gmail.com>
To: vardan.pogosyn@yandex.ru
To: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #18251: Incorrect DROP VIEW pg_catalog.* behavior
Date: Sun, 17 Dec 2023 13:33:40 +0100
Message-ID: <ZX7qpJHzRyoKzqai@jrouhaud> (raw)
In-Reply-To: <18251-1f41c42bb11eace0@postgresql.org>
References: <18251-1f41c42bb11eace0@postgresql.org>
Hi,
On Sun, Dec 17, 2023 at 09:44:33AM +0000, PG Bug reporting form wrote:
>
> When i try to drop and create system view, i get following behavior:
>
> postgres=# DROP VIEW pg_catalog.pg_config;
> DROP VIEW
>
> postgres=# CREATE OR REPLACE VIEW pg_catalog.pg_config AS
> SELECT pg_config.name, pg_config.setting
> FROM pg_config() pg_config(name, setting);
> ERROR: permission denied to create "pg_catalog.pg_config"
> DETAIL: System catalog modifications are currently disallowed.
That's somewhat expected. System catalog modifications are only prevented
globally at the creation side, I guess mostly because we don't want user to
e.g. create an index or a trigger on a system catalog just to realize that it
won't be maintained, and things like that.
The fact that you can drop a system view is because you're using a superuser
connection, and there are so many things you can do as a superuser to mess up
the instance so there wouldn't be much value disallowing just this specific
case.
>
> I'm not sure, but it's look strange.
> When i connect to template1, i can use droped views. But if drop view on
> template1 problem repeats.
That's not surprising. You always need to use a database to create a new one.
The only different between a template database and a normal database is the
permissions needed on the source database side.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: rjuju123@gmail.com, vardan.pogosyn@yandex.ru, pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #18251: Incorrect DROP VIEW pg_catalog.* behavior
In-Reply-To: <ZX7qpJHzRyoKzqai@jrouhaud>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox