Re: [GENERAL] Only owners can ANALYZE tables...seems overly restrictive

2016-03-25 Thread Stephen Frost
David, * David G. Johnston (david.g.johns...@gmail.com) wrote: > On Thu, Mar 24, 2016 at 4:51 AM, Stephen Frost wrote: > > I don't see any reason why the patch itself would be terribly difficult, > > but are we sure we'd want just ANALYZE and not VACUUM also? Which would > >

Re: [GENERAL] Only owners can ANALYZE tables...seems overly restrictive

2016-03-24 Thread David G. Johnston
On Thu, Mar 24, 2016 at 4:51 AM, Stephen Frost wrote: > David, > > * David G. Johnston (david.g.johns...@gmail.com) wrote: > > Which means that, aside from effort, the main blocking factors here are > > code complexity (which I understand) and limited grant "bits" as Stephen

Re: [GENERAL] Only owners can ANALYZE tables...seems overly restrictive

2016-03-24 Thread Stephen Frost
David, * David G. Johnston (david.g.johns...@gmail.com) wrote: > Which means that, aside from effort, the main blocking factors here are > code complexity (which I understand) and limited grant "bits" as Stephen > puts it. So I pose the question: do any of the committers consider a grant > bit

Re: [GENERAL] Only owners can ANALYZE tables...seems overly restrictive

2016-03-23 Thread David G. Johnston
On Mon, Feb 29, 2016 at 6:31 AM, Stephen Frost wrote: If we had plenty more bits to allow ANALYZE to be independently GRANT'able, then maybe, but those are a limited resource. ​ On Mon, Feb 29, 2016 at 10:35 AM, Joshua D. Drake wrote: ​3. This can

Re: [GENERAL] Only owners can ANALYZE tables...seems overly restrictive

2016-02-29 Thread David G. Johnston
On Mon, Feb 29, 2016 at 11:50 AM, David G. Johnston < david.g.johns...@gmail.com> wrote: > On Mon, Feb 29, 2016 at 10:39 AM, Tom Lane wrote: > >> "David G. Johnston" writes: >> > On Mon, Feb 29, 2016 at 9:27 AM, Albe Laurenz

Re: [GENERAL] Only owners can ANALYZE tables...seems overly restrictive

2016-02-29 Thread David G. Johnston
On Mon, Feb 29, 2016 at 10:39 AM, Tom Lane wrote: > "David G. Johnston" writes: > > On Mon, Feb 29, 2016 at 9:27 AM, Albe Laurenz > > wrote: > >> See http://www.postgresql.org/docs/current/static/planner-stats.html > >>

Re: [GENERAL] Only owners can ANALYZE tables...seems overly restrictive

2016-02-29 Thread David G. Johnston
On Mon, Feb 29, 2016 at 10:36 AM, Adrian Klaver wrote: > ​So the typical user doesn't know or even care that what they just did >> needs to be analyzed. The situation is no worse than it is today. But >> as someone who writes many scripts and applications to perform

Re: [GENERAL] Only owners can ANALYZE tables...seems overly restrictive

2016-02-29 Thread David G. Johnston
On Mon, Feb 29, 2016 at 10:35 AM, Joshua D. Drake wrote: > 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

Re: [GENERAL] Only owners can ANALYZE tables...seems overly restrictive

2016-02-29 Thread Joshua D. Drake
On 02/29/2016 10:06 AM, Alvaro Herrera wrote: Joshua D. Drake wrote: On 02/29/2016 05:31 AM, Stephen Frost wrote: Realistically, ANALYZE is a background/maintenance task that autovacuum should be handling for you. Incorrect. That would be autoanalyze and although they are similar they are

Re: [GENERAL] Only owners can ANALYZE tables...seems overly restrictive

2016-02-29 Thread Alvaro Herrera
Joshua D. Drake wrote: > On 02/29/2016 05:31 AM, Stephen Frost wrote: > >Realistically, ANALYZE is a background/maintenance task that autovacuum > >should be handling for you. > > Incorrect. That would be autoanalyze and although they are similar they are > not the same. ANALYZE is used for a

Re: [GENERAL] Only owners can ANALYZE tables...seems overly restrictive

2016-02-29 Thread Tom Lane
"David G. Johnston" writes: > On Mon, Feb 29, 2016 at 9:27 AM, Albe Laurenz > wrote: >> See http://www.postgresql.org/docs/current/static/planner-stats.html >> "The amount of information stored in pg_statistic by ANALYZE, in >> particular the

Re: [GENERAL] Only owners can ANALYZE tables...seems overly restrictive

2016-02-29 Thread Adrian Klaver
On 02/29/2016 08:13 AM, David G. Johnston wrote: On Mon, Feb 29, 2016 at 8:28 AM, Stephen Frost >wrote: * David G. Johnston (david.g.johns...@gmail.com ) wrote: > On Mon, Feb 29, 2016 at 6:31 AM,

Re: [GENERAL] Only owners can ANALYZE tables...seems overly restrictive

2016-02-29 Thread Joshua D. Drake
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

Re: [GENERAL] Only owners can ANALYZE tables...seems overly restrictive

2016-02-29 Thread Bosco Rama
On 02/29/16 06:20, Vik Fearing wrote: > > Hmm. How are you not the owner of a temporary table? After 'set session authorization ...' -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] Only owners can ANALYZE tables...seems overly restrictive

2016-02-29 Thread David G. Johnston
On Mon, Feb 29, 2016 at 9:27 AM, Albe Laurenz wrote: > David G. Johnston wrote: > In a production environment you don't want a user to change your table > statistics. > > They could just set default_statistics_target to something stupid, > run

Re: [GENERAL] Only owners can ANALYZE tables...seems overly restrictive

2016-02-29 Thread Joshua D. Drake
On 02/29/2016 05:31 AM, Stephen Frost wrote: * David G. Johnston (david.g.johns...@gmail.com) wrote: Given the amount of damage a person with write access to a table can get into it seems pointless to not allow them to analyze the table after their updates - since best practices would say that

Re: [GENERAL] Only owners can ANALYZE tables...seems overly restrictive

2016-02-29 Thread Albe Laurenz
David G. Johnston wrote: In a production environment you don't want a user to change your table statistics. They could just set default_statistics_target to something stupid, run ANALYZE and wreck the statistics for everyone. And then come back to the DBA and complain

Re: [GENERAL] Only owners can ANALYZE tables...seems overly restrictive

2016-02-29 Thread David G. Johnston
On Mon, Feb 29, 2016 at 8:46 AM, Albe Laurenz wrote: > David G. Johnston wrote: > > On Mon, Feb 29, 2016 at 2:52 AM, Albe Laurenz > wrote: > >> John R Pierce wrote: > >>> analyze has arguably fewer side effects, its a performance enhancement, >

Re: [GENERAL] Only owners can ANALYZE tables...seems overly restrictive

2016-02-29 Thread David G. Johnston
On Mon, Feb 29, 2016 at 8:28 AM, Stephen Frost wrote: > * David G. Johnston (david.g.johns...@gmail.com) wrote: > > On Mon, Feb 29, 2016 at 6:31 AM, Stephen Frost > wrote: > > > > > * David G. Johnston (david.g.johns...@gmail.com) wrote: > > > > Given the

Re: [GENERAL] Only owners can ANALYZE tables...seems overly restrictive

2016-02-29 Thread Albe Laurenz
David G. Johnston wrote: > On Mon, Feb 29, 2016 at 2:52 AM, Albe Laurenz wrote: >> John R Pierce wrote: >>> analyze has arguably fewer side effects, its a performance enhancement, >>> its neither altering the schema or changing the data. >> In a production environment

Re: [GENERAL] Only owners can ANALYZE tables...seems overly restrictive

2016-02-29 Thread Stephen Frost
* David G. Johnston (david.g.johns...@gmail.com) wrote: > On Mon, Feb 29, 2016 at 6:31 AM, Stephen Frost wrote: > > > * David G. Johnston (david.g.johns...@gmail.com) wrote: > > > Given the amount of damage a person with write access to a table can get > > > into it seems

Re: [GENERAL] Only owners can ANALYZE tables...seems overly restrictive

2016-02-29 Thread David G. Johnston
On Mon, Feb 29, 2016 at 2:52 AM, Albe Laurenz wrote: > John R Pierce wrote: > > On 2/28/2016 8:58 PM, Tom Lane wrote: > I should the check for whether a given user can or cannot analyze a > table > should be whether the user has INSERT, UPDATE, or DELETE

Re: [GENERAL] Only owners can ANALYZE tables...seems overly restrictive

2016-02-29 Thread David G. Johnston
On Mon, Feb 29, 2016 at 6:31 AM, Stephen Frost wrote: > * David G. Johnston (david.g.johns...@gmail.com) wrote: > > Given the amount of damage a person with write access to a table can get > > into it seems pointless to not allow them to analyze the table after > their > >

Re: [GENERAL] Only owners can ANALYZE tables...seems overly restrictive

2016-02-29 Thread Guillaume Lelarge
2016-02-29 15:20 GMT+01:00 Vik Fearing : > On 02/29/2016 03:15 PM, Guillaume Lelarge wrote: > > 2016-02-29 14:31 GMT+01:00 Stephen Frost > >: > > > > Realistically, ANALYZE is a background/maintenance task that > autovacuum

Re: [GENERAL] Only owners can ANALYZE tables...seems overly restrictive

2016-02-29 Thread Vik Fearing
On 02/29/2016 03:15 PM, Guillaume Lelarge wrote: > 2016-02-29 14:31 GMT+01:00 Stephen Frost >: > > Realistically, ANALYZE is a background/maintenance task that autovacuum > should be handling for you. > > Realistically, that can't happen

Re: [GENERAL] Only owners can ANALYZE tables...seems overly restrictive

2016-02-29 Thread Guillaume Lelarge
2016-02-29 14:31 GMT+01:00 Stephen Frost : > * David G. Johnston (david.g.johns...@gmail.com) wrote: > > Given the amount of damage a person with write access to a table can get > > into it seems pointless to not allow them to analyze the table after > their > > updates -

Re: [GENERAL] Only owners can ANALYZE tables...seems overly restrictive

2016-02-29 Thread Stephen Frost
* David G. Johnston (david.g.johns...@gmail.com) wrote: > Given the amount of damage a person with write access to a table can get > into it seems pointless to not allow them to analyze the table after their > updates - since best practices would say that normal work with a table > should not be

Re: [GENERAL] Only owners can ANALYZE tables...seems overly restrictive

2016-02-29 Thread Albe Laurenz
John R Pierce wrote: > On 2/28/2016 8:58 PM, Tom Lane wrote: I should the check for whether a given user can or cannot analyze a table should be whether the user has INSERT, UPDATE, or DELETE privileges. >> By that argument, we should allow anyone with any write access to do >>

Re: [GENERAL] Only owners can ANALYZE tables...seems overly restrictive

2016-02-28 Thread Vitaly Burovoy
On 2/28/16, John R Pierce 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,

Re: [GENERAL] Only owners can ANALYZE tables...seems overly restrictive

2016-02-28 Thread John R Pierce
On 2/28/2016 8:58 PM, Tom Lane wrote: >I should the check for whether a given user can or cannot analyze a table >should be whether the user has INSERT, UPDATE, or DELETE privileges. By that argument, we should allow anyone with any write access to do TRUNCATE. Or perhaps even DROP TABLE. I'm

Re: [GENERAL] Only owners can ANALYZE tables...seems overly restrictive

2016-02-28 Thread David G. Johnston
On Sun, Feb 28, 2016 at 9:58 PM, Tom Lane wrote: > "David G. Johnston" writes: > > Given the amount of damage a person with write access to a table can get > > into it seems pointless to not allow them to analyze the table after > their > >

Re: [GENERAL] Only owners can ANALYZE tables...seems overly restrictive

2016-02-28 Thread Tom Lane
"David G. Johnston" writes: > Given the amount of damage a person with write access to a table can get > into it seems pointless to not allow them to analyze the table after their > updates - since best practices would say that normal work with a table > should not be

[GENERAL] Only owners can ANALYZE tables...seems overly restrictive

2016-02-28 Thread David G. Johnston
Given the amount of damage a person with write access to a table can get into it seems pointless to not allow them to analyze the table after their updates - since best practices would say that normal work with a table should not be performed by an owner. I should the check for whether a given