1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-31 22:04:40 +03:00

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.
This commit is contained in:
Peter Eisentraut
2013-09-09 22:25:37 -04:00
parent 71901ab6da
commit b34f8f409b
2 changed files with 6 additions and 3 deletions

View File

@ -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;