diff options
author | Peter Eisentraut <peter_e@gmx.net> | 2013-09-09 22:25:37 -0400 |
---|---|---|
committer | Peter Eisentraut <peter_e@gmx.net> | 2013-09-09 22:25:37 -0400 |
commit | b34f8f409bec4921d260ac84668917f5fff04319 (patch) | |
tree | ef325d32b353ca3f88c50d9d6746acd4024a140c /src | |
parent | 71901ab6daaad65c0168c05e016e4208efe5b71a (diff) | |
download | postgresql-b34f8f409bec4921d260ac84668917f5fff04319.tar.gz postgresql-b34f8f409bec4921d260ac84668917f5fff04319.zip |
Show schemas in information_schema.schemata that the current has access to
Before, it would only show schemas that the current user owns. Per
discussion, the new behavior is more useful and consistent for PostgreSQL.
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/catalog/information_schema.sql | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/backend/catalog/information_schema.sql b/src/backend/catalog/information_schema.sql index 95f267f224e..c5f7a8b2100 100644 --- a/src/backend/catalog/information_schema.sql +++ b/src/backend/catalog/information_schema.sql @@ -1502,7 +1502,9 @@ CREATE VIEW schemata AS CAST(null AS sql_identifier) AS default_character_set_name, CAST(null AS character_data) AS sql_path FROM pg_namespace n, pg_authid u - WHERE n.nspowner = u.oid AND pg_has_role(n.nspowner, 'USAGE'); + WHERE n.nspowner = u.oid + AND (pg_has_role(n.nspowner, 'USAGE') + OR has_schema_privilege(n.oid, 'CREATE, USAGE')); GRANT SELECT ON schemata TO PUBLIC; |