Re: How to use set/reset role in contrib_regression test?

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: Jeremy Finzel <finzelj(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: How to use set/reset role in contrib_regression test?
Date: 2017-12-08 02:43:27
Message-ID: CAB7nPqQeHj-t6sPcAV6rK1dSNz=9V6ia4mLr_7sDk7PyMUBBYg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Dec 8, 2017 at 8:12 AM, David G. Johnston
<david(dot)g(dot)johnston(at)gmail(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2017-12-08 02:54:51 Re: PostgreSQL crashes with SIGSEGV
Previous Message Amit Kapila 2017-12-08 02:36:33 Re: Usage of epoch in txid_current