pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephen Frost <sfrost@snowman.net>
To: Andres Freund <andres@anarazel.de>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Jeff Davis <pgsql@j-davis.com>
Cc: Bossart, Nathan <bossartn@amazon.com>
Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: Predefined role pg_maintenance for VACUUM, ANALYZE, CHECKPOINT.
Date: Mon, 8 Nov 2021 12:47:23 -0500
Message-ID: <20211108174723.GI20998@tamriel.snowman.net> (raw)
In-Reply-To: <20211108173325.6ury6xflvxq7yqbn@alap3.anarazel.de>
References: <202110310026.zmhkxct6ka6c@alvherre.pgsql>
	<6498F6FC-714B-4AC2-B0E1-9A5321654277@amazon.com>
	<20211101165025.GS20998@tamriel.snowman.net>
	<5e7a618de1b49ba1ceede54ee1b1d073bd57f1f4.camel@j-davis.com>
	<20211104224204.ee5673h3qlzblh7e@alap3.anarazel.de>
	<ae70a6ff7700a821849be0da6cd0da69e0e4b05e.camel@j-davis.com>
	<CA+Tgmob9TxDV3X4+=eG9E+o80MW_qoJjTvvHhRt252OO=X9FbA@mail.gmail.com>
	<20211107184649.mpncdezkzfq2v4pb@alap3.anarazel.de>
	<20211108172318.GF20998@tamriel.snowman.net>
	<20211108173325.6ury6xflvxq7yqbn@alap3.anarazel.de>

Greetings,

* Andres Freund (andres@anarazel.de) wrote:
> On 2021-11-08 12:23:18 -0500, Stephen Frost wrote:
> > though I continue to feel like the function based approach is better.
> 
> I think it's a somewhat ugly hack.

I suppose we'll just have to disagree on that. :)

I don't feel as strongly as others apparently do on this point though,
and I'd rather have non-superusers able to run CHECKPOINT *somehow*
than not, so if the others feel like a predefined role is a better
approach then I'm alright with that.  Seems a bit overkill to me but
it's also not like it's actually all that much code or work to do.

> > then we must use such an approach no matter how we allow non-superusers to
> > run the command because any approach to that necessarily involves some
> > amount of catalog access.
> 
> As long as there's no additional catalog access when the user is known to be a
> superuser, then I think it's fine. There's a difference between doing one
> pg_authid read for superuser - with a fallback to automatically assuming a
> user if one couldn't be found - and doing a full pg_proc read with several
> subsidiary pg_type reads etc.

Yes, the approach I'm suggesting would make the superuser-run CHECKPOINT
be exactly the same as it is today, while a non-superuser trying to run
a CHECKPOINT would end up doing additional catalog accesses.

Thanks,

Stephen

Attachments:

  signature.asc (application/pgp-signature, 818B) download

view thread (65+ messages)  latest in thread

Message-ID: <20211108174723.GI20998@tamriel.snowman.net>
Permalink:  ../20211108174723.GI20998@tamriel.snowman.net/
Also on:    postgresql.org/message-id/20211108174723.GI20998@tamriel.snowman.net

 · 

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: sfrost@snowman.net, andres@anarazel.de, robertmhaas@gmail.com, pgsql@j-davis.com, bossartn@amazon.com, alvherre@alvh.no-ip.org, bharath.rupireddyforpostgres@gmail.com
  Subject: Re: Predefined role pg_maintenance for VACUUM, ANALYZE, CHECKPOINT.
  In-Reply-To: <20211108174723.GI20998@tamriel.snowman.net>
  References: <202110310026.zmhkxct6ka6c@alvherre.pgsql> <6498F6FC-714B-4AC2-B0E1-9A5321654277@amazon.com> <20211101165025.GS20998@tamriel.snowman.net> <5e7a618de1b49ba1ceede54ee1b1d073bd57f1f4.camel@j-davis.com> <20211104224204.ee5673h3qlzblh7e@alap3.anarazel.de> <ae70a6ff7700a821849be0da6cd0da69e0e4b05e.camel@j-davis.com> <CA+Tgmob9TxDV3X4+=eG9E+o80MW_qoJjTvvHhRt252OO=X9FbA@mail.gmail.com> <20211107184649.mpncdezkzfq2v4pb@alap3.anarazel.de> <20211108172318.GF20998@tamriel.snowman.net> <20211108173325.6ury6xflvxq7yqbn@alap3.anarazel.de> <20211108174723.GI20998@tamriel.snowman.net>

* 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