Re: How to use set/reset role in contrib_regression test? - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: How to use set/reset role in contrib_regression test?
Date
Msg-id CAB7nPqQeHj-t6sPcAV6rK1dSNz=9V6ia4mLr_7sDk7PyMUBBYg@mail.gmail.com
Whole thread Raw
In response to Re: How to use set/reset role in contrib_regression test?  ("David G. Johnston" <david.g.johnston@gmail.com>)
Responses Re: How to use set/reset role in contrib_regression test?
List pgsql-hackers
On Fri, Dec 8, 2017 at 8:12 AM, David G. Johnston
<david.g.johnston@gmail.com> wrote:
> Probably -bugs (or -general if you are unsure about the buggy-ness) would
> have been a more appropriate list since this is all direct SQL that looks to
> be broken.  No use moving it now, though.

On HEAD, REL_10_STABLE or REL9_6_STABLE, say with two users:
=# create role popo1 superuser login;
CREATE ROLE
Time: 9.400 ms
=# create role popo2 login;
CREATE ROLE

And then by creating objects:
=# select current_role;
 current_user
--------------
 popo1
(1 row)
=# set role popo2;
SET
=> select current_role;
 current_user
--------------
 popo2
(1 row)
=> create table aa (a int);
CREATE TABLE
=> select current_role;
 current_user
--------------
 popo2
(1 row)
=> reset role;
RESET
=# select current_role;
 current_user
--------------
 popo1
(1 row)

Per the information you are giving, I would have seen "popo2" as user
for the last query even after issuing a RESET ROLE. However I do not
see any problems.

> Reporting the version(s) you are running would be helpful.

Indeed.
-- 
Michael


pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: Usage of epoch in txid_current
Next
From: Masahiko Sawada
Date:
Subject: Re: User defined data types in Logical Replication