Re: how to switch user in postgres - Mailing list pgsql-performance

From David G. Johnston
Subject Re: how to switch user in postgres
Date
Msg-id CAKFQuwaFHzyqZTPsiQRWyucy0jov9MpbvtcMGSyTE6nsBySLPQ@mail.gmail.com
Whole thread Raw
In response to how to switch user in postgres  (ikramuddin <ikram.amani815@gmail.com>)
Responses Re: how to switch user in postgres
List pgsql-performance
This seems quite misplaced on the -performance mailing list.

On Sat, Apr 11, 2026 at 10:55 AM ikramuddin <ikram.amani815@gmail.com> wrote:

As i was working through postgresql user and role privileges i faced an unexpected behavious when we revoke connect on database from a user then why still we need to revoke usage on schema basis and then revoke select , insert , update privileges at table table. second when i did all this one by one and then tried to connect to same database using \c database_name  user_name, it failed that is perfect which i expected but when i tried to connect through postgres as a superuser it connect still it is fine. but then i write the command set role simon it connected even i revoked the connect privileges from the role .
 
plz guide it is a bug or this behavious left intentionally.

Intentional, every object has its own permissions that are granted to roles independently of others.


finance=> reset role'
finance'> ;
finance'> ';
ERROR:  syntax error at or near "'
;
'"
LINE 1: reset role' 
                  ^
finance=> reset role;
RESET

You had a typo in the first attempt...

For everything else I really don't feel like trying to read your mind.  If you have questions about specific outcomes or whatnot please ask them directly.  But there are no known bugs here and I presume you haven't demonstrated any - everything is working as intended.

David J.

pgsql-performance by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: how to switch user in postgres
Next
From: Tom Lane
Date:
Subject: Re: how to switch user in postgres