Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1flHs4-0000tt-3h for pgsql-sql@arkaria.postgresql.org; Thu, 02 Aug 2018 17:58:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1flHs2-0001ww-El for pgsql-sql@arkaria.postgresql.org; Thu, 02 Aug 2018 17:58:42 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1flHs2-0001wl-7t; Thu, 02 Aug 2018 17:58:42 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1flHrz-0003ka-Px; Thu, 02 Aug 2018 17:58:41 +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 w72HwbGF030053; Thu, 2 Aug 2018 13:58:37 -0400 From: Tom Lane To: Suresh Raja cc: pgsql-general@postgresql.org, pgsql-sql@postgresql.org Subject: Re: List user who have access to schema In-reply-to: References: Comments: In-reply-to Suresh Raja message dated "Thu, 02 Aug 2018 12:49:00 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <30051.1533232717.1@sss.pgh.pa.us> Date: Thu, 02 Aug 2018 13:58:37 -0400 Message-ID: <30052.1533232717@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Suresh Raja writes: > I'm looking for query which can list all users who have access to a > particular schema. Something involving SELECT ... FROM pg_user WHERE has_schema_privilege(usename, 'schema-of-interest', 'usage'); would probably be what you want. regards, tom lane