Re: Predefined role pg_maintenance for VACUUM, ANALYZE, CHECKPOINT.

From: "Bossart, Nathan" <bossartn(at)amazon(dot)com>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Jeff Davis <pgsql(at)j-davis(dot)com>
Cc: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>, Stephen Frost <sfrost(at)snowman(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Predefined role pg_maintenance for VACUUM, ANALYZE, CHECKPOINT.
Date: 2021-10-31 01:05:47
Message-ID: 6498F6FC-714B-4AC2-B0E1-9A5321654277@amazon.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 10/30/21, 11:14 AM, "Jeff Davis" <pgsql(at)j-davis(dot)com> wrote:
> On Sat, 2021-10-30 at 13:24 +0530, Bharath Rupireddy wrote:
>> IMHO, moving away from SQL command "CHECKPOINT" to function
>> "pg_checkpoint()" isn't nice as the SQL command has been there for a
>> long time and all the applications or services that were/are being
>> built around the postgres ecosystem would have to adapt someday to
>> the
>> new function (if at all we deprecate the command and onboard the
>> function). This isn't good at all given the CHECKPOINT is one of the
>> mostly used commands in the apps or services layer. Moreover, if we
>> go
>> with the function pg_checkpoint(), we might see patches coming in for
>> pg_vacuum(), pg_reindex(), pg_cluster() and so on.
>
> I tend to agree with all of this. The CHECKPOINT command is already
> there and people already use it. If we are already chipping away at the
> need for superuser elsewhere, we should offer a way to use CHECKPOINT
> without being superuser.

I think Bharath brings up some good points. The simple fact is that
CHECKPOINT has been around for a while, and creating functions for
maintenance tasks would add just as much or more clutter than adding a
predefined role for each one. I do wonder what we would've done if
CHECKPOINT didn't already exist. Based on the goal of this thread, I
get the feeling that we might've seriously considered introducing it
as a function so that you can just GRANT EXECUTE as needed.

Nathan

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Etsuro Fujita 2021-10-31 09:05:44 postgres_fdw: commit remote (sub)transactions in parallel during pre-commit
Previous Message Alvaro Herrera 2021-10-31 00:26:26 Re: Predefined role pg_maintenance for VACUUM, ANALYZE, CHECKPOINT.