Skip to content

Allow users to disable ALTER SYSTEM #2725

Closed

Description

@gbartolini

Background information: I have submitted a patch for PostgreSQL to disable ALTER SYSTEM at startup time. For more information and also the reason behind it, please refer to the thread in the pgsql-hackers mailing list below:

https://www.postgresql.org/message-id/CA%2BVUV5rEKt2%2BCdC_KUaPoihMu%2Bi5ChT4WVNTr4CD5-xXZUfuQw%40mail.gmail.com

If ever, this patch will not land in PostgreSQL before version 17. There are chances though that it will never land.

In the meantime, it would be good to introduce a workaround for all currently available Postgres versions, including the upcoming 16. Add a new option in the cluster's spec called enableAlterSystem with a current default value of true for back-compatibility (in 1.22 we should make the default change to false).

The idea is that the postgresql.auto.conf file is made read-only. Add proper documentation too.

Activity

  1. leonardoce commented on Sep 11, 2023

    @leonardoce
    Contributor

    I'd disable ALTER SYSTEM in CNPG. I can't imagine a case where this should be used when the cluster is working.

    I understand this would be useful to fix a broken cluster, but in this case, the user could:

    1. Fence the instances
    2. Update the postgres.conf file as needed

    By doing this the user will have total control over the GUCs, and over where/which configuration file we include.

  2. gbartolini commented on Sep 11, 2023

    @gbartolini
    ContributorAuthor

    That makes sense, but I am worried about current users who rely on it. We can't just simply disable it from dusk to dawn. I propose that for 1.21 (so v1 of the API) we add the enableAlterSystem option and set it to false by default (with proper warning message for those who update). And then we remove it in v2.

  3. added a commit that references this issue on Dec 13, 2023
    d96b3bb
  4. added a commit that references this issue on Dec 13, 2023
    2dd11ee
  5. added a commit that references this issue on Dec 13, 2023
    19e3661
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

good first issue

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions