Re: Only owners can ANALYZE tables...seems overly restrictive

From: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>
Cc: John R Pierce *EXTERN* <pierce(at)hogranch(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Only owners can ANALYZE tables...seems overly restrictive
Date: 2016-02-29 17:35:26
Message-ID: 56D4815E.2080108@commandprompt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 02/29/2016 09:09 AM, David G. Johnston wrote:
> ​
> Being able to run ANALYZE on a table in no way implies that ​I should be
> allowed to run ALTER TABLE SET STATISTICS on the same.
> ​
>
> Only table owners should be allowed to execute ALTER TABLE while, in my
> opinion, anyone with write capabilities on a table should be allowed to
> execute ANALYZE.​ I would accept a GRANT permission if that could get
> committed but I find the status-quo mildly annoying.

I think a better question at this point is: What is the problem you are
trying to solve? Think about the following:

1. When you run ANALYZE it will update the statistics.
2. Anyone can run SET, which means that if any user can run ANALYZE, any
user can greatly modify the statistics.
3. This can already be handled by GRANT:

* psql -U jd -h localhost;
* create table foo (id text);
* create role jd_role;
* alter table foo owner to jd_role;
* grant jd_role to boo;
* \c jd boo
* analyze foo;

Sincerely,

JD

--
Command Prompt, Inc. http://the.postgres.company/
+1-503-667-4564
PostgreSQL Centered full stack support, consulting and development.
Everyone appreciates your honesty, until you are honest with them.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2016-02-29 17:36:41 Re: Only owners can ANALYZE tables...seems overly restrictive
Previous Message Bosco Rama 2016-02-29 17:27:43 Re: Only owners can ANALYZE tables...seems overly restrictive