Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1csxYM-0003qP-Un for pgsql-hackers@arkaria.postgresql.org; Tue, 28 Mar 2017 20:17:19 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1csxYM-0001tH-EB for pgsql-hackers@arkaria.postgresql.org; Tue, 28 Mar 2017 20:17:18 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1csxYK-0001oq-VN for pgsql-hackers@postgresql.org; Tue, 28 Mar 2017 20:17:17 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1csxYI-0007fY-G5 for pgsql-hackers@postgresql.org; Tue, 28 Mar 2017 20:17:15 +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 v2SKHCec024604; Tue, 28 Mar 2017 16:17:12 -0400 From: Tom Lane To: Mark Dilger cc: Dave Page , Peter Eisentraut , Stephen Frost , Robert Haas , PostgreSQL Hackers Subject: Re: Monitoring roles patch In-reply-to: <248F178D-0A7F-4C6E-963C-BDEFB295CB67@gmail.com> References: <20170322131510.GC9812@tamriel.snowman.net> <20170323122335.GK9812@tamriel.snowman.net> <957FCA21-99DA-4477-9A6E-C86ACAC23E36@gmail.com> <7161672F-1EC5-478F-B307-FF28B01D0D62@gmail.com> <19369.1490727172@sss.pgh.pa.us> <248F178D-0A7F-4C6E-963C-BDEFB295! CB67@gmail.com> Comments: In-reply-to Mark Dilger message dated "Tue, 28 Mar 2017 12:30:40 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <24602.1490732232.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 28 Mar 2017 16:17:12 -0400 Message-ID: <24603.1490732232@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Mark Dilger writes: > I don't see anything wrong with adding roles in pg_authid.h with a #defin= e'd > Oid. That's actually pretty helpful for anyone writing code against the = database, > as they don't have to look up the Oid of the role. > But why not then grant privileges to that role in information_schema.sql?= =20 To the extent that the desired privileges can be represented at the SQL level, I agree that that's a better solution than hard-wiring checks in C code. The problem comes in with cases where that's not fine-grained enough. Consider a policy like "anybody can select from pg_stat_activity, but unless you have privilege X, the query column should read as nulls except for sessions belonging to you". That behavior can't realistically be represented as a separate SQL privilege. Right now we have "privilege X" for this purpose hard-coded as "is superuser", but it would be much better if it were associated with a grantable role. regards, tom lane --=20 Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers