Re: Possibility to disable `ALTER SYSTEM`

From: Greg Sabino Mullane <htamfids(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Robert Treat <rob(at)xzilla(dot)net>, Joel Jacobson <joel(at)compiler(dot)org>, Andrew Dunstan <andrew(at)dunslane(dot)net>, Gabriele Bartolini <gabriele(dot)bartolini(at)enterprisedb(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Magnus Hagander <magnus(dot)hagander(at)redpill-linpro(dot)com>, "daniel(at)yesql(dot)se" <daniel(at)yesql(dot)se>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: Possibility to disable `ALTER SYSTEM`
Date: 2024-03-18 23:38:07
Message-ID: CAKAnmmJ_dcJNuB0AgvY+jXZZiSCeUhDg-=bdHZfv0FN9PGM5GQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)gmail(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2024-03-18 23:39:11 Re: Autogenerate some wait events code and documentation
Previous Message John Naylor 2024-03-18 23:35:39 Re: [PoC] Improve dead tuple storage for lazy vacuum