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

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Jeff Davis <pgsql(at)j-davis(dot)com>, "Bossart, Nathan" <bossartn(at)amazon(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
Subject: Re: Predefined role pg_maintenance for VACUUM, ANALYZE, CHECKPOINT.
Date: 2021-11-02 18:26:14
Message-ID: 20211102182614.GC20998@tamriel.snowman.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Greetings,

* Jeff Davis (pgsql(at)j-davis(dot)com) wrote:
> On Tue, 2021-11-02 at 11:06 -0400, Robert Haas wrote:
> > Just as a sort of general comment on this endeavor, I suspect that
> > any
> > attempt to lump things together that seem closely related is doomed
> > to
> > backfire.
>
> Agreed, I think that is apparent from the different opinions in this
> thread.
>
> Robert had a good idea over here though:

Think you meant 'Stephen' there. ;)

> https://postgr.es/m/20211101165025.GS20998@tamriel.snowman.net
>
> which gives fine-grained control without the "clutter" of extra
> predefined roles.

Right.

* Bossart, Nathan (bossartn(at)amazon(dot)com) wrote:
> On 11/2/21, 10:29 AM, "Jeff Davis" <pgsql(at)j-davis(dot)com> wrote:
> > Great idea! Patch attached.
> >
> > This feels like a good pattern that we might want to use elsewhere, if
> > the need arises.
>
> The approach in the patch looks alright to me, but another one could
> be to build a SelectStmt when parsing CHECKPOINT. I think that'd
> simplify the standard_ProcessUtility() changes.

For my 2c, at least, I'm not really partial to either approach, though
I'd want to see what error messages end up looking like. Seems like we
might want to exercise a bit more control than we'd be able to if we
transformed it directly into a SelectStmt (that is, we might add a HINT:
roles with execute rights on pg_checkpoint() can run this command, or
something; maybe not too tho).

> Otherwise, I see a couple of warnings when compiling:
> xlogfuncs.c:54: warning: implicit declaration of function ‘RequestCheckpoint’
> xlogfuncs.c:56: warning: control reaches end of non-void function

Yeah, such things would need to be cleaned up, of course.

Thanks!

Stephen

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2021-11-02 18:33:31 Re: Eval expression R/O once time (src/backend/executor/execExpr.c)
Previous Message Jan Wieck 2021-11-02 18:19:49 Re: should we enable log_checkpoints out of the box?