Re: how to switch user in postgres

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: ikramuddin <ikram(dot)amani815(at)gmail(dot)com>
Cc: pgsql-performance(at)lists(dot)postgresql(dot)org
Subject: Re: how to switch user in postgres
Date: 2026-04-11 18:33:58
Message-ID: CAKFQuwaFHzyqZTPsiQRWyucy0jov9MpbvtcMGSyTE6nsBySLPQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-performance

This seems quite misplaced on the -performance mailing list.

On Sat, Apr 11, 2026 at 10:55 AM ikramuddin <ikram(dot)amani815(at)gmail(dot)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.

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2026-04-11 19:29:06 Re: how to switch user in postgres
Previous Message Pavel Stehule 2026-04-11 18:00:31 Re: how to switch user in postgres