pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephen Frost <sfrost@snowman.net>
To: Bossart, Nathan <bossartn@amazon.com>
Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Jeff Davis <pgsql@j-davis.com>
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, 1 Nov 2021 13:42:35 -0400
Message-ID: <20211101174235.GU20998@tamriel.snowman.net> (raw)
In-Reply-To: <8B7DFC0A-9CF9-4620-9FDD-D1A4C8269B68@amazon.com>
References: <2f6c033019c3a1ec499b516e3e54022b7bcdb58a.camel@j-davis.com>
	<202110310026.zmhkxct6ka6c@alvherre.pgsql>
	<6498F6FC-714B-4AC2-B0E1-9A5321654277@amazon.com>
	<20211101165025.GS20998@tamriel.snowman.net>
	<8B7DFC0A-9CF9-4620-9FDD-D1A4C8269B68@amazon.com>

Greetings,

* Bossart, Nathan (bossartn@amazon.com) wrote:
> On 11/1/21, 9:51 AM, "Stephen Frost" <sfrost@snowman.net> wrote:
> > All that said, I wonder if we can have our cake and eat it too.  I
> > haven't looked into this at all yet and perhaps it's foolish on its
> > face, but, could we make CHECKPOINT; basically turn around and just run
> > select pg_checkpoint(); with the regular privilege checking happening?
> > Then we'd keep the existing syntax working, but if the user is allowed
> > to run the command would depend on if they've been GRANT'd EXECUTE
> > rights on the function or not.
> 
> I'd be worried about the behavior of CHECKPOINT changing because
> someone messed with the function.

Folks playing around in the catalog can break lots of things, I don't
really see this as an argument against the idea.

I do wonder if we should put a bit more effort into preventing people
from messing with functions and such in pg_catalog.  Being able to do
something like:

create or replace function xpath ( text, xml ) returns xml[]
as $$ begin return 'xml'; end; $$ language plpgsql;

(or with much worse functions..) strikes me as just a bit too easy to
mistakenly cause problems as a superuser.  Still, that's really an
independent issue from this discussion.  It's not like someone breaking
CHECKPOINT; would actually impact normal checkpoints anyway.

Thanks,

Stephen

Attachments:

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

view thread (65+ messages)  latest in thread

Message-ID: <20211101174235.GU20998@tamriel.snowman.net>
Permalink:  ../20211101174235.GU20998@tamriel.snowman.net/
Also on:    postgresql.org/message-id/20211101174235.GU20998@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, bossartn@amazon.com, alvherre@alvh.no-ip.org, pgsql@j-davis.com, bharath.rupireddyforpostgres@gmail.com
  Subject: Re: Predefined role pg_maintenance for VACUUM, ANALYZE, CHECKPOINT.
  In-Reply-To: <20211101174235.GU20998@tamriel.snowman.net>
  References: <2f6c033019c3a1ec499b516e3e54022b7bcdb58a.camel@j-davis.com> <202110310026.zmhkxct6ka6c@alvherre.pgsql> <6498F6FC-714B-4AC2-B0E1-9A5321654277@amazon.com> <20211101165025.GS20998@tamriel.snowman.net> <8B7DFC0A-9CF9-4620-9FDD-D1A4C8269B68@amazon.com> <20211101174235.GU20998@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