Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wBdAG-001EmS-0M for pgsql-performance@arkaria.postgresql.org; Sat, 11 Apr 2026 18:34:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wBdAD-00HXC7-0I for pgsql-performance@arkaria.postgresql.org; Sat, 11 Apr 2026 18:34:37 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wBdAC-00HXBx-28 for pgsql-performance@lists.postgresql.org; Sat, 11 Apr 2026 18:34:37 +0000 Received: from mail-yx1-xb12c.google.com ([2607:f8b0:4864:20::b12c]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wBdAB-00000000Whh-0pQx for pgsql-performance@lists.postgresql.org; Sat, 11 Apr 2026 18:34:36 +0000 Received: by mail-yx1-xb12c.google.com with SMTP id 956f58d0204a3-6501d242e3fso2874735d50.0 for ; Sat, 11 Apr 2026 11:34:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1775932475; cv=none; d=google.com; s=arc-20240605; b=PtKIw3MDwPGTBf6w/ohjGoi5NSFAgDM8UDOvimey3c9Hm2SUbQ4AXmNh++DY1mZm83 wTM1T+hWKD71Iaqk/zfPMPWwTjjujuqEUsyuJNmy2JHcdCw0ML+rPduii/LW3WHqf7hS Ugd6LWRW8fxZkfWYDBKV8v+ozT7dGaczWpBmCaQACNpAO//ImkTwMQI5Dpwfy+CEe4y9 e/KdnlhIxwpTgcqtgvIoMH1NM2PqNgyl8JvLBr550n59Clm6XARdc+YnFXL2NZ6HLs+Y zgMFO7Ex131Qa4DuO4nl0WPHv6iMwqBJ35cLff2oUt3168dUSlF6U9ht5eVAMC+u9mqn wSkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=ueBd0HUhLkh8mkD9L1ROfbue8oAoB6hQI6TqTcVD+D4=; fh=xZR9MjjhJNvQm6hkfxlTf8sxhjNaxOABb9E5jAhW0do=; b=FXLQ9YPzdazMvc0/edBjuStckFeulAYnPn3tJAMZdsCJYshntKzugFrQNoHX706t5X oQjOYt0dHkZ20ubpCrOR6I6IlYSj8r80o9Uymk3+S9vG1Tq+zpAKssDX1PgKhBceMR7n krR3pef+T1Xf0R5xqX5GchUCxKrkLoIUyNPmc3wtT8lZ12lBmfk+xjSPe5JNF29OTHYp Bkt23ScopTYk/5xC4+1OrwlZGdjmIOShvZnZ/OlT0q+lpEvUKQhlISPgKDJHjwyi8jEG cOsfbk/goz10TleimR01qT2uSHXS3PIlAYVAvcp7puHlgZywq96bNbV+ysYLPA0Z8pYK dG6w==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1775932475; x=1776537275; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=ueBd0HUhLkh8mkD9L1ROfbue8oAoB6hQI6TqTcVD+D4=; b=idaRTJN3obOwVWysZlzlr8DEBkfEv72UKCd8g1IdYwwuVLKwHvqNq31Jz5IzOUTLsj hMQrBo3gnmiLbX6Z4Jr/mWH2kNKeC283/f1lfpoiOQaJXDCcDOAe1JJHGtitHgZIgP1L 4v1LP3QUJaZR8/aihgXjiLze03bj6Uh5BYIvSP/BzYxlvUrueBfFMTOVP/4yR8rcYs9y uWjWKIgqultHA1GnfMpW+WH3/C3siNpMdD8sK8Y0mwNoaB9bhQa9ShzZkPCxq3QF+HLK Bd3rat09adovqOpLdlCgUAFmrsttjMuW2xg+0UHBELD4jgV40qGYpmSdGGZbyhyv+ofo 867Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775932475; x=1776537275; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ueBd0HUhLkh8mkD9L1ROfbue8oAoB6hQI6TqTcVD+D4=; b=aqqd3Q+1HC95f2n6Hz+4/vggueOcB1XRPWm1MvWQr2+7/++WmWHsXCjtWljuHu2YMO UJ3GQUkwNEyIRu06jBG7fYFT9BFuIvGw7TPOyAQnu6jwx47y7p+zQcaIgD3WhjYbe/PR ir8ilfyktWRi6or+zHgudRoMcqRrN/WiganTLZhM9gSwjXggbqu5ucueq3Mkp2PTLRks vIW5yaJ6sl5hUwPFdSAOXaNm8kgWEjK+jdsfuvn48yCxFj9dfzEkvtISwiig92K4OlkX kVY86EEKVbbZwbnhd5Rr/VZ5+1M4JJ6+jlLyxWTmBygNqyJWnLR1DBIRyZyiP4KwhZU/ dY4g== X-Gm-Message-State: AOJu0YzX8SMkEeXtIR3aOagso3VZUZVdZbM/gmsl6sXBnUfr1RWhSqwO TgqVWu/Fsj1Dn9IqjIv60boA/OIVsGzjlTu0oECttM3F4zw1xyGPlpt+HmDEWfMj0LnzR/8zus2 ePZsbyuEq1EgvRBO8pYKjdtFhIUAdqYw= X-Gm-Gg: AeBDiet6Qo0rBXPqo3sFcbPTY6cAE4IWh0Z6EE17x5KunsiOk4/svQxLA7ztHoDdd/Q H3fLVRk4rWHJu4czNRB+Qw9wWrzbV5aNL4eb6EA3hzgYq0RCgsCg5W+/SOJHfO9x+zR8HymSZPX UV9dKFkp5rytj92pepJxanZr5KFnP6ObGOwgDeG5ISASSAlAleOh+u44CuJnXhKWRH86jq1jO7R 2ovOWQ7OBpGHjuqk/pQPJYpXLtsZtBWFBIrbRryJjD6mPFMHwg54r8HQclcvC7FIAEGvvaKhyLu 31ph+KQ= X-Received: by 2002:a05:690e:d5a:b0:64e:8b35:e24 with SMTP id 956f58d0204a3-65198ad0411mr6869892d50.29.1775932474815; Sat, 11 Apr 2026 11:34:34 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: "David G. Johnston" Date: Sat, 11 Apr 2026 11:33:58 -0700 X-Gm-Features: AQROBzD9_aqtC2YCUXdh-_49mdAxdjEEXth_ntXNQVmt96f57DQrOAPS6jXPDDg Message-ID: Subject: Re: how to switch user in postgres To: ikramuddin Cc: pgsql-performance@lists.postgresql.org Content-Type: multipart/alternative; boundary="0000000000004e8103064f3380fe" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000004e8103064f3380fe Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable This seems quite misplaced on the -performance mailing list. On Sat, Apr 11, 2026 at 10:55=E2=80=AFAM ikramuddin 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=3D> reset role' > finance'> ; > finance'> '; > ERROR: syntax error at or near "' > ; > '" > LINE 1: reset role' > ^ > finance=3D> 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. --0000000000004e8103064f3380fe Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
This=C2=A0seems quite misplaced on the= -performance mailing list.

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

As i was working thr= ough postgresql user and role privileges=C2=A0i faced an unexpected behavio= us=C2=A0when we revoke connect on database from a user then why still we ne= ed to revoke usage on schema basis and then revoke select , insert , update= =C2=A0privileges at table table. second when i did all this one by one and = then tried to connect to same database using \c database_name=C2=A0 user_na= me, 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 wri= te the command set role simon it connected even i revoked the connect privi= leges from the role .
=C2=A0
plz guide it i= s a bug or this behavious=C2=A0left intentionally.
=

Intentional, every object has its own permissions that ar= e granted=C2=A0to roles independently of others.


finance= =3D> reset role'
finance'> ;
finance'> ';ERROR: =C2=A0syntax error at or near "'
;
'"
LI= NE 1: reset role'=C2=A0
=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ^
finance=3D> reset role;
R= ESET

You had a typo in the fi= rst attempt...

For everything else I really don't = feel like trying to read your mind.=C2=A0 If you have questions about speci= fic outcomes or whatnot please ask them directly.=C2=A0 But there are no kn= own bugs here and I presume you haven't demonstrated any - everything i= s working as intended.

David J.

--0000000000004e8103064f3380fe--