Re: Possibility to disable `ALTER SYSTEM` - Mailing list pgsql-hackers

From Greg Sabino Mullane
Subject Re: Possibility to disable `ALTER SYSTEM`
Date
Msg-id CAKAnmmJ_dcJNuB0AgvY+jXZZiSCeUhDg-=bdHZfv0FN9PGM5GQ@mail.gmail.com
Whole thread Raw
In response to Re: Possibility to disable `ALTER SYSTEM`  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Going to agree with Robert Treat here about an extension being a great solution. I resisted posting earlier as I wanted to see how this all pans out, but I wrote a quick little POC extension some months ago that does the disabling and works well (and cannot be easily worked around).

On Mon, Mar 18, 2024 at 4:59 PM Robert Haas <robertmhaas@gmail.com> wrote:
I think that all of this is true except for (c). I think we'd need a
new hook to make it work.

Seems we can just use ProcessUtility and:
if (IsA(parsetree, AlterSystemStmt) { ereport(ERROR, ...

When we know that a feature is
widely-needed, it's better to have one good implementation of it in
core than several perhaps not-so-good implementations out of core.

Meh, maybe. This one seems pretty dirt simple. Granted, I have expanded my original POC to allow *some* things to be changed by ALTER SYSTEM, but the original use case warrants a very small extension.

That allows us to focus all of our efforts on that one implementation
instead of splitting them across several -- which is the whole selling
point of open source, really -- and it makes it easier for users who
want the feature to get access to it.

Well, yeah, but they have to wait until version 18 at best, while an extension can run on any current version and probably be pretty future-proof as well.

Cheers,
Greg

pgsql-hackers by date:

Previous
From: John Naylor
Date:
Subject: Re: [PoC] Improve dead tuple storage for lazy vacuum
Next
From: Michael Paquier
Date:
Subject: Re: Autogenerate some wait events code and documentation