Re: [HACKERS] Allow replication roles to use file access functions

2015-12-15 Thread Artur Zakirov
On 03.09.2015 05:40, Michael Paquier wrote: Ah, OK. I thought that you were referring to a protocol where caller sends a single LSN from which it gets a differential backup that needs to scan all the relation files of the source cluster to get the data blocks with an LSN newer than the one sent,

Re: [HACKERS] Allow replication roles to use file access functions

2015-09-08 Thread Stephen Frost
Heikki, * Heikki Linnakangas (hlinn...@iki.fi) wrote: > On 09/04/2015 08:14 AM, Michael Paquier wrote: > >Of course, that's not mandatory to fetch them. It is as well not worth > >the complication to apply a filter to not fetch a portion of the > >files, and I think that's why Heikki took the appr

Re: [HACKERS] Allow replication roles to use file access functions

2015-09-04 Thread Heikki Linnakangas
On 09/04/2015 08:14 AM, Michael Paquier wrote: On Thu, Sep 3, 2015 at 9:53 PM, Stephen Frost wrote: * Michael Paquier (michael.paqu...@gmail.com) wrote: On Thu, Sep 3, 2015 at 11:20 AM, Stephen Frost wrote: Not only, +clog, configuration files, etc. Configuration files? Perhaps you could e

Re: [HACKERS] Allow replication roles to use file access functions

2015-09-03 Thread Michael Paquier
On Thu, Sep 3, 2015 at 9:53 PM, Stephen Frost wrote: > * Michael Paquier (michael.paqu...@gmail.com) wrote: >> On Thu, Sep 3, 2015 at 11:20 AM, Stephen Frost wrote: >> >> Not only, +clog, configuration files, etc. >> > >> > Configuration files? Perhaps you could elaborate? >> >> Sure. Sorry for b

Re: [HACKERS] Allow replication roles to use file access functions

2015-09-03 Thread Stephen Frost
* Michael Paquier (michael.paqu...@gmail.com) wrote: > On Thu, Sep 3, 2015 at 11:20 AM, Stephen Frost wrote: > >> Not only, +clog, configuration files, etc. > > > > Configuration files? Perhaps you could elaborate? > > Sure. Sorry for being unclear. It copies everything that is not a > relation f

Re: [HACKERS] Allow replication roles to use file access functions

2015-09-02 Thread Michael Paquier
On Thu, Sep 3, 2015 at 11:20 AM, Stephen Frost wrote: > * Michael Paquier wrote: >> 1) Use a differential backup to me, or the possibility to fetch a set >> of data block diffs from a source node using an LSN and then re-apply >> them on the target node. The major disadvantage of this approach is >

Re: [HACKERS] Allow replication roles to use file access functions

2015-09-02 Thread Stephen Frost
* Michael Paquier (michael.paqu...@gmail.com) wrote: > On Thu, Sep 3, 2015 at 10:05 AM, Stephen Frost wrote: > > * Michael Paquier (michael.paqu...@gmail.com) wrote: > >> On Thu, Sep 3, 2015 at 4:52 AM, Alvaro Herrera wrote: > > The replication role already has read-only access to everything > > (n

Re: [HACKERS] Allow replication roles to use file access functions

2015-09-02 Thread Michael Paquier
On Thu, Sep 3, 2015 at 10:05 AM, Stephen Frost wrote: > * Michael Paquier (michael.paqu...@gmail.com) wrote: >> On Thu, Sep 3, 2015 at 4:52 AM, Alvaro Herrera wrote: > The replication role already has read-only access to everything > (nearly?) in the PGDATA directory. The specific issue in this ca

Re: [HACKERS] Allow replication roles to use file access functions

2015-09-02 Thread Stephen Frost
Micahel, * Michael Paquier (michael.paqu...@gmail.com) wrote: > On Thu, Sep 3, 2015 at 4:52 AM, Alvaro Herrera > wrote: > > Michael Paquier wrote: > >> As of now, file access functions in genfile.c can only be used by > >> superusers. This proposal is to relax those functions so as > >> replicat

Re: [HACKERS] Allow replication roles to use file access functions

2015-09-02 Thread Michael Paquier
On Thu, Sep 3, 2015 at 8:59 AM, Andres Freund wrote: > On 2015-09-02 19:48:15 -0400, Tom Lane wrote: >> Just on general principles, this seems like a pretty horrid idea. >> To me replication privilege means the ability to transfer data out of >> the master, not to cause arbitrary state changes on

Re: [HACKERS] Allow replication roles to use file access functions

2015-09-02 Thread Andres Freund
On 2015-09-02 19:48:15 -0400, Tom Lane wrote: > Just on general principles, this seems like a pretty horrid idea. > To me replication privilege means the ability to transfer data out of > the master, not to cause arbitrary state changes on the master. It's not about the permission to trigger pg_re

Re: [HACKERS] Allow replication roles to use file access functions

2015-09-02 Thread Tom Lane
Michael Paquier writes: > On Thu, Sep 3, 2015 at 4:52 AM, Alvaro Herrera > wrote: >> Michael Paquier wrote: >>> The main argument for this change is that pg_rewind makes use of those >>> functions, forcing users to use a superuser role when rewinding a >>> node. >> Can this piggyback on Stephen

Re: [HACKERS] Allow replication roles to use file access functions

2015-09-02 Thread Michael Paquier
On Thu, Sep 3, 2015 at 4:52 AM, Alvaro Herrera wrote: > Michael Paquier wrote: >> Hi all, >> >> As of now, file access functions in genfile.c can only be used by >> superusers. This proposal is to relax those functions so as >> replication users can use them as well. Here are the functions aimed >

Re: [HACKERS] Allow replication roles to use file access functions

2015-09-02 Thread Michael Paquier
On Wed, Sep 2, 2015 at 11:32 PM, Fujii Masao wrote: > Did you confirm that replication user can complete pg_rewind > after this patch is applied? Yes. -- Michael -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.or

Re: [HACKERS] Allow replication roles to use file access functions

2015-09-02 Thread Alvaro Herrera
Michael Paquier wrote: > Hi all, > > As of now, file access functions in genfile.c can only be used by > superusers. This proposal is to relax those functions so as > replication users can use them as well. Here are the functions aimed > by this patch: > - pg_stat_file > - pg_read_binary_file > -

Re: [HACKERS] Allow replication roles to use file access functions

2015-09-02 Thread Fujii Masao
On Thu, Aug 27, 2015 at 10:50 AM, Michael Paquier wrote: > Hi all, > > As of now, file access functions in genfile.c can only be used by > superusers. This proposal is to relax those functions so as > replication users can use them as well. Here are the functions aimed > by this patch: > - pg_stat

[HACKERS] Allow replication roles to use file access functions

2015-08-26 Thread Michael Paquier
Hi all, As of now, file access functions in genfile.c can only be used by superusers. This proposal is to relax those functions so as replication users can use them as well. Here are the functions aimed by this patch: - pg_stat_file - pg_read_binary_file - pg_read_file - pg_ls_dir The main argumen