Re: Possibility to disable `ALTER SYSTEM`

Gabriele Bartolini <gabriele.bartolini@enterprisedb.com>

From: Gabriele Bartolini <gabriele.bartolini@enterprisedb.com>
To: Joel Jacobson <joel@compiler.org>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2024-02-07T10:37:20Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Add allow_alter_system GUC.

  2. Rename COMPAT_OPTIONS_CLIENT to COMPAT_OPTIONS_OTHER.

  3. Remove support for version-0 calling conventions.

Hi Joel,

On Wed, 7 Feb 2024 at 10:00, Joel Jacobson <joel@compiler.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.

Cheers,
Gabriele
-- 
Gabriele Bartolini
Vice President, Cloud Native at EDB
enterprisedb.com