pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jeff Davis <pgsql@j-davis.com>
To: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
To: Bossart, Nathan <bossartn@amazon.com>
Cc: Stephen Frost <sfrost@snowman.net>
Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: Predefined role pg_maintenance for VACUUM, ANALYZE, CHECKPOINT.
Date: Sat, 30 Oct 2021 11:14:35 -0700
Message-ID: <2f6c033019c3a1ec499b516e3e54022b7bcdb58a.camel@j-davis.com> (raw)
In-Reply-To: <CALj2ACUJAYD1GDiRvbH-+gY2pyOFdQU7CSGc9oij1r-rK16u1w@mail.gmail.com>
References: <202110252055.soecywkiu6gi@alvherre.pgsql>
	<baebf454bf12de663c57021715d965641f679209.camel@j-davis.com>
	<0282D099-11ED-45AE-93DB-E0B974F485DF@amazon.com>
	<06ee895767b46f631327d7e029d46106a8a6fbe9.camel@j-davis.com>
	<20211026200255.GO20998@tamriel.snowman.net>
	<423ff64d88c6817551ea81e0b554202992184bac.camel@j-davis.com>
	<55A4CF15-D562-4F1F-B078-DAF19A39CBF4@amazon.com>
	<CALj2ACUJAYD1GDiRvbH-+gY2pyOFdQU7CSGc9oij1r-rK16u1w@mail.gmail.com>

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.

If the purpose[0] of predefined roles is that they allow you to do
things that can't be expressed by GRANT, a predefined role
pg_checkpointer seems to fit the bill.

The main argument against[1] having a pg_checkpointer predefined role
is that it creates a clutter of predefined roles. But it seems like
just another part of the clutter of having a special SQL command merely
for requesting a checkpoint.

The alternative of creating a new function doesn't seem to alleviate
the clutter. Some people will use the function and some will use the
command, creating inconsistency in examples and scripts, and people
will wonder which one is the "right" one.

Regards,
	Jeff Davis

[0] 
https://postgr.es/m/CA+TgmobQoWZn62qWRX+OOFjBPhdubxYTBeO-GSNPcLvBHh4ZvA@mail.gmail.com

[1] https://postgr.es/m/8C661979-AF85-4AE1-9E2B-2A091DA3DB22@amazon.com






view thread (65+ messages)  latest in thread

Message-ID: <2f6c033019c3a1ec499b516e3e54022b7bcdb58a.camel@j-davis.com>
Permalink:  ../2f6c033019c3a1ec499b516e3e54022b7bcdb58a.camel@j-davis.com/
Also on:    postgresql.org/message-id/2f6c033019c3a1ec499b516e3e54022b7bcdb58a.camel@j-davis.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: pgsql@j-davis.com, bharath.rupireddyforpostgres@gmail.com, bossartn@amazon.com, sfrost@snowman.net, alvherre@alvh.no-ip.org
  Subject: Re: Predefined role pg_maintenance for VACUUM, ANALYZE, CHECKPOINT.
  In-Reply-To: <2f6c033019c3a1ec499b516e3e54022b7bcdb58a.camel@j-davis.com>
  References: <202110252055.soecywkiu6gi@alvherre.pgsql> <baebf454bf12de663c57021715d965641f679209.camel@j-davis.com> <0282D099-11ED-45AE-93DB-E0B974F485DF@amazon.com> <06ee895767b46f631327d7e029d46106a8a6fbe9.camel@j-davis.com> <20211026200255.GO20998@tamriel.snowman.net> <423ff64d88c6817551ea81e0b554202992184bac.camel@j-davis.com> <55A4CF15-D562-4F1F-B078-DAF19A39CBF4@amazon.com> <CALj2ACUJAYD1GDiRvbH-+gY2pyOFdQU7CSGc9oij1r-rK16u1w@mail.gmail.com> <2f6c033019c3a1ec499b516e3e54022b7bcdb58a.camel@j-davis.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox