From: Tom Lane <tgl@sss.pgh.pa.us>
To: tysonzwicker@gmail.com
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #10588: inconsistent permissions for InformationSchema tables..
Date: Mon, 09 Jun 2014 19:10:51 -0400
Message-ID: <29283.1402355451@sss.pgh.pa.us> (raw)
In-Reply-To: <20140609223526.2583.43153@wrigleys.postgresql.org>
References: <20140609223526.2583.43153@wrigleys.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, tysonzwicker@gmail.com
Subject: Re: BUG #10588: inconsistent permissions for InformationSchema tables..
In-Reply-To: <29283.1402355451@sss.pgh.pa.us>
References: <20140609223526.2583.43153@wrigleys.postgresql.org> <29283.1402355451@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox