Re: pg_basebackup issue

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: chiru r <chirupg(at)gmail(dot)com>
Cc: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, John R Pierce <pierce(at)hogranch(dot)com>, Forums postgresql <pgsql-general(at)postgresql(dot)org>
Subject: Re: pg_basebackup issue
Date: 2017-04-23 15:57:14
Message-ID: b058faa3-fb76-ceb3-f908-8851ad892db4@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 04/23/2017 04:52 AM, chiru r wrote:
> Thank you for your reply.
>
> I agree, However we are planning, users not to have any direct
> privileges on database objects or default roles(like
> SUPERUSER,CREATEDB,REPLICATION..etc) in postgres.
>
> looking to create users(LOGIN) only and Grant all the privileges through
> roles like below.
>
> *Steps: *
> Create User
> Create role
> GRANT required privileges/default attributes(SUPERUSER,REPLICATION etc)
> to Role
> GRANT role to Users.

Yes, but in your original setup:

postgres=#
postgres=# create user backup_admin password 'XXXXX';
CREATE ROLE
postgres=# create role dba_admin SUPERUSER REPLICATION;
CREATE ROLE
postgres=# grant dba_admin to backup_admin;
GRANT ROLE
postgres=# alter user backup_admin set role to dba_admin;
ALTER ROLE

the practical effect is to have a user(backup_admin) with SUPERUSER
REPLICATION attributes every time they logged in(the exception being in
the pg_basebackup case, as well as other commands that follow the same
path). Not sure how that is different from just setting up a user with
the REPLICATION attribute.

>
> So,If I follow above process I am not able to do pg_basebackup.
> Now I have only options left either I have to use postgres user or
> create a user directly with replication role(Which we are not interested
> in).
>
> In future is there possibility to allow a user(using above steps) to do
> pg_basebackup?.
>
>
> Thanks,
> Chiru
>
>
>

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Guyren Howe 2017-04-23 17:12:54 Does a view not define a composite type?
Previous Message Adrian Klaver 2017-04-23 15:44:47 Re: pg_basebackup issue