public inbox for pgsql-performance@postgresql.org  
help / color / mirror / Atom feed
From: David G. Johnston <david.g.johnston@gmail.com>
To: ikramuddin <ikram.amani815@gmail.com>
Cc: pgsql-performance@lists.postgresql.org
Subject: Re: how to switch user in postgres
Date: Sat, 11 Apr 2026 11:33:58 -0700
Message-ID: <CAKFQuwaFHzyqZTPsiQRWyucy0jov9MpbvtcMGSyTE6nsBySLPQ@mail.gmail.com> (raw)
In-Reply-To: <CAL9MbytWDzHYHPo31AeR=-ZcCKfQr8uXQitFNe0nehAvLze7PA@mail.gmail.com>
References: <CAL9MbytWDzHYHPo31AeR=-ZcCKfQr8uXQitFNe0nehAvLze7PA@mail.gmail.com>

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.


reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: david.g.johnston@gmail.com, ikram.amani815@gmail.com, pgsql-performance@lists.postgresql.org
  Subject: Re: how to switch user in postgres
  In-Reply-To: <CAKFQuwaFHzyqZTPsiQRWyucy0jov9MpbvtcMGSyTE6nsBySLPQ@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox