Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hRrFS-0007OK-4E for pgsql-sql@arkaria.postgresql.org; Sat, 18 May 2019 04:47:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hRrFQ-000125-RN for pgsql-sql@arkaria.postgresql.org; Sat, 18 May 2019 04:47:04 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hRrFQ-00011y-G7 for pgsql-sql@lists.postgresql.org; Sat, 18 May 2019 04:47:04 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hRrFN-00007N-C7 for pgsql-sql@postgresql.org; Sat, 18 May 2019 04:47:03 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x4I4kvvS000526; Sat, 18 May 2019 00:46:57 -0400 From: Tom Lane To: rajan cc: pgsql-sql@postgresql.org Subject: Re: getting permission denied error for user2 while proper privileges are present In-reply-to: <1558152796956-0.post@n3.nabble.com> References: <1558152796956-0.post@n3.nabble.com> Comments: In-reply-to rajan message dated "Fri, 17 May 2019 21:13:16 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <524.1558154817.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Sat, 18 May 2019 00:46:57 -0400 Message-ID: <525.1558154817@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk rajan writes: > Please someone help me on the below. Unable to understand why user2 is not > having access. Because you said "noinherit". Per the CREATE ROLE man page: INHERIT NOINHERIT These clauses determine whether a role “inherits” the privileges of roles it is a member of. A role with the INHERIT attribute can automatically use whatever database privileges have been granted to all roles it is directly or indirectly a member of. Without INHERIT, membership in another role only grants the ability to SET ROLE to that other role; the privileges of the other role are only available after having done so. If not specified, INHERIT is the default. regards, tom lane