Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Wu8iP-0001Ix-T8 for pgsql-bugs@arkaria.postgresql.org; Mon, 09 Jun 2014 23:10:58 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Wu8iP-0007cF-Dh for pgsql-bugs@arkaria.postgresql.org; Mon, 09 Jun 2014 23:10:57 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Wu8iO-0007c8-CW for pgsql-bugs@postgresql.org; Mon, 09 Jun 2014 23:10:56 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Wu8iL-0006l7-CE for pgsql-bugs@postgresql.org; Mon, 09 Jun 2014 23:10:54 +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 s59NApRF029284; Mon, 9 Jun 2014 19:10:51 -0400 From: Tom Lane To: tysonzwicker@gmail.com cc: pgsql-bugs@postgresql.org Subject: Re: BUG #10588: inconsistent permissions for InformationSchema tables.. In-reply-to: <20140609223526.2583.43153@wrigleys.postgresql.org> References: <20140609223526.2583.43153@wrigleys.postgresql.org> Comments: In-reply-to tysonzwicker@gmail.com message dated "Mon, 09 Jun 2014 22:35:26 -0000" Date: Mon, 09 Jun 2014 19:10:51 -0400 Message-ID: <29283.1402355451@sss.pgh.pa.us> X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org tysonzwicker@gmail.com writes: > In InformationSchema the "constraint_column_usage" table is only accessible > via the super user account, despite other tables (I tested table_constraints > and key_column_usage) being accessible to any account that was GRANTed ALL > permissions. It's accessible enough, unless you changed the default: GRANT SELECT ON constraint_column_usage TO PUBLIC; > Furthermore, attempting to select from "constraint_column_usage" did not > throw an error of any kind, it just returned 0 rows. Once I did the same > query logged in as "postgres" the query returned rows. This view follows the SQL standard, which says you can only see rows that describe tables you own. A superuser is considered to belong to any owning role, which is why "postgres" can always see all rows in this view. > I feel that a> An error should be thrown rather than returning 0 rows and > that b> the access of tables in InformationSchema should be consistent > across ALL of the tables. A pretty large fraction of the information_schema views have comparable visibility restrictions. In any case, since the entire point of information_schema is to present a standards-compliant view of the database, we're not going to go against the clear requirement of the standard. You're welcome to define your own views that behave however you like, of course; the underlying pg_catalog tables are all world-readable. (Which is something we've gotten flak about from other parties, but whatever ...) regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs