Re: new createuser option for replication role

From: Cédric Villemain <cedric(dot)villemain(dot)debian(at)gmail(dot)com>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: new createuser option for replication role
Date: 2011-09-22 13:55:44
Message-ID: CAF6yO=2pz8Vr1kqVQky_viRv+3W-71E+tLfHNfNi_tHiwp2jnQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello

Before doing the complete review, I hit a regression with 9.1 createrole.

the command ''createuser -e -s foo" produce :
CREATE ROLE foo SUPERUSER CREATEDB CREATEROLE INHERIT LOGIN NOREPLICATION;

before it was:
CREATE ROLE foo SUPERUSER CREATEDB CREATEROLE INHERIT LOGIN;

The REPLICATION was allowed by default to superuser, and the current
patch change the default to remove the right.

I believe we should add only the REPLICATION when --replication is
set, and NOREPLICATION when --no-replication is set.

2011/9/11 Fujii Masao <masao(dot)fujii(at)gmail(dot)com>:
> On Sat, Sep 10, 2011 at 11:50 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> Fujii Masao <masao(dot)fujii(at)gmail(dot)com> writes:
>>> Currently createuser cannot create a role with REPLICATION privilege
>>> because it doesn't have any option to do that. Which sometimes annoys
>>> me when setting up replication. I'd like to propose to add new options
>>> "-x (--replication)" and "-X (--no-replication)" into createuser. "-x" allows
>>> the new user to do replication, and "-X" disallows. The default is "-X".
>>> Is it worth creating the patch?
>>
>>> Though I'd like to use "-r" and "-R" as the option name, they have already
>>> been used for CREATEROLE privilege. So I'm thinking to use "-x" and
>>> "-X" derived from XLOG. But does anyone have better option name?
>>
>> Better solution: don't have a short form of the switch.
>
> That sounds better. I revised the patch so that it adds only "--replication"
> option to createuser.
>
> Regards,
>
> --
> Fujii Masao
> NIPPON TELEGRAPH AND TELEPHONE CORPORATION
> NTT Open Source Software Center
>
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
>
>

--
Cédric Villemain +33 (0)6 20 30 22 52
http://2ndQuadrant.fr/
PostgreSQL: Support 24x7 - Développement, Expertise et Formation

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kerem Kat 2011-09-22 14:03:26 Re: Adding CORRESPONDING to Set Operations
Previous Message Robert Haas 2011-09-22 13:55:35 Re: memory barriers (was: Yes, WaitLatch is vulnerable to weak-memory-ordering bugs)