Re: Default Roles

From: Noah Misch <noah(at)leadboat(dot)com>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, José Luis Tallón <jltallon(at)adv-solutions(dot)net>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Default Roles
Date: 2016-04-18 03:05:44
Message-ID: 20160418030544.GB1961272@tornado.leadboat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Apr 17, 2016 at 08:04:03PM -0400, Noah Misch wrote:
> On Thu, Apr 07, 2016 at 03:50:47PM -0400, Stephen Frost wrote:
> > I'm planning to continue going over the patch tomorrow morning with
> > plans to push this before the feature freeze deadline.
>
> > --- a/src/test/regress/expected/rolenames.out
> > +++ b/src/test/regress/expected/rolenames.out
>
> > +GRANT testrol0 TO pg_abc; -- error
> > +ERROR: role "pg_abc" is reserved
> > +DETAIL: Cannot GRANT roles to a reserved role.
>
> The server still accepts "ALTER ROLE testrol0 USER pg_signal_backend". It
> should block this ALTER ROLE if it blocks the corresponding GRANT.

One more thing:

> --- a/src/bin/pg_dump/pg_dumpall.c
> +++ b/src/bin/pg_dump/pg_dumpall.c
> @@ -665,7 +665,7 @@ dumpRoles(PGconn *conn)
> int i;
>
> /* note: rolconfig is dumped later */
> - if (server_version >= 90500)
> + if (server_version >= 90600)

This need distinct branches for 9.5 and for 9.6+. Today's code would treat a
9.5 cluster like a 9.1 cluster and fail to dump rolbypassrls attributes.

> printfPQExpBuffer(buf,
> "SELECT oid, rolname, rolsuper, rolinherit, "
> "rolcreaterole, rolcreatedb, "
> @@ -674,6 +674,7 @@ dumpRoles(PGconn *conn)
> "pg_catalog.shobj_description(oid, 'pg_authid') as rolcomment, "
> "rolname = current_user AS is_current_user "
> "FROM pg_authid "
> + "WHERE rolname !~ '^pg_' "
> "ORDER BY 2");
> else if (server_version >= 90100)
> printfPQExpBuffer(buf,

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2016-04-18 03:31:55 Re: Re: [COMMITTERS] pgsql: Add trigonometric functions that work in degrees.
Previous Message Noah Misch 2016-04-18 03:02:28 Re: pg_dump dump catalog ACLs