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

From: Vitaly Burovoy <vitaly(dot)burovoy(at)gmail(dot)com>
To: John R Pierce <pierce(at)hogranch(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Only owners can ANALYZE tables...seems overly restrictive
Date: 2016-02-29 06:23:03
Message-ID: CAKOSWNkmc=EYnhCKjztGvx67gEm_UpCO==VCYfqLo-ju3_fN0w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 2/28/16, John R Pierce <pierce(at)hogranch(dot)com> wrote:
> I don't see why anyone with delete privileges shouldn't be able to
> truncate (after all, thats the same as deleting all records).

Firstly, because you can prevent deleting some rows by a trigger;
TRUNCATE doesn't deal with rows.
Secondary, TRUNCATE is _NOT_ MVCC. Even in a not yet finished
transaction other connections can see empty table.
Thirdly, TRUNCATE is often used for clearing most of (or even all) DB
tables for tests. Splitting privileges is one of possible protection
for running tests on a prod server (if config files are copied
wrongly).

>
> --
> john r pierce, recycling bits in santa cruz

--
Best regards,
Vitaly Burovoy

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Albe Laurenz 2016-02-29 09:52:33 Re: Only owners can ANALYZE tables...seems overly restrictive
Previous Message John R Pierce 2016-02-29 05:46:51 Re: Only owners can ANALYZE tables...seems overly restrictive