Re: Possibility to disable `ALTER SYSTEM`

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Gabriele Bartolini <gabriele(dot)bartolini(at)enterprisedb(dot)com>, Joel Jacobson <joel(at)compiler(dot)org>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Possibility to disable `ALTER SYSTEM`
Date: 2024-02-10 16:16:46
Message-ID: 63d0896e-e090-58dc-e1dd-886ea2f2d065@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 2024-02-07 We 05:37, Gabriele Bartolini wrote:
> Hi Joel,
>
> On Wed, 7 Feb 2024 at 10:00, Joel Jacobson <joel(at)compiler(dot)org> wrote:
>
> On Fri, Sep 8, 2023, at 16:17, Gabriele Bartolini wrote:
> > ```
> > postgres=# ALTER SYSTEM SET wal_level TO minimal;
> > ERROR:  could not open file "postgresql.auto.conf": Permission
> denied
> > ```
>
> +1 to simply mark postgresql.auto.conf file as not being writeable.
>
> To improve the UX experience, how about first checking if the file
> is not writeable, or catch EACCESS, and add a user-friendly hint?
>
> ```
> postgres=# ALTER SYSTEM SET wal_level TO minimal;
> ERROR:  could not open file "postgresql.auto.conf": Permission denied
> HINT: The ALTER SYSTEM command is effectively disabled as the
> configuration file is set to read-only.
> ```
>
>
> This would do - provided we fix the issue with pg_rewind not handling
> read-only files in PGDATA.
>

This seems like the simplest solution. And maybe we should be fixing
pg_rewind regardless of this issue?

cheers

andrew

--

Andrew Dunstan
EDB:https://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2024-02-10 16:19:21 Re: [PATCH] Add native windows on arm64 support
Previous Message Andrew Dunstan 2024-02-10 16:05:41 Re: What about Perl autodie?