From fd5b397ca4963bf91a54678be51207bf827e512a Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Sat, 27 Aug 2011 15:03:02 +0300 Subject: [PATCH] Implement the information schema with_hierarchy column In PostgreSQL, this is included in the SELECT privilege, so show YES or NO depending on whether SELECT is granted. --- doc/src/sgml/information_schema.sgml | 18 ++++++++++++++++-- src/backend/catalog/information_schema.sql | 2 +- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/doc/src/sgml/information_schema.sgml b/doc/src/sgml/information_schema.sgml index 0f0cbfaa83a..8063d059c8d 100644 --- a/doc/src/sgml/information_schema.sgml +++ b/doc/src/sgml/information_schema.sgml @@ -3684,7 +3684,14 @@ ORDER BY c.ordinal_position; with_hierarchy yes_or_no - Applies to a feature not available in PostgreSQL + + In the SQL standard, WITH HIERARCHY OPTION + is a separate (sub-)privilege allowing certain operations on + table inheritance hierarchies. In PostgreSQL, this is included + in the SELECT privilege, so this column + shows YES if the privilege + is SELECT, else NO. + @@ -5364,7 +5371,14 @@ ORDER BY c.ordinal_position; with_hierarchy yes_or_no - Applies to a feature not available in PostgreSQL + + In the SQL standard, WITH HIERARCHY OPTION + is a separate (sub-)privilege allowing certain operations on + table inheritance hierarchies. In PostgreSQL, this is included + in the SELECT privilege, so this column + shows YES if the privilege + is SELECT, else NO. + diff --git a/src/backend/catalog/information_schema.sql b/src/backend/catalog/information_schema.sql index 47c48bfb275..e5555d6148e 100644 --- a/src/backend/catalog/information_schema.sql +++ b/src/backend/catalog/information_schema.sql @@ -1785,7 +1785,7 @@ CREATE VIEW table_privileges AS pg_has_role(grantee.oid, c.relowner, 'USAGE') OR c.grantable THEN 'YES' ELSE 'NO' END AS yes_or_no) AS is_grantable, - CAST('NO' AS yes_or_no) AS with_hierarchy + CAST(CASE WHEN c.prtype = 'SELECT' THEN 'YES' ELSE 'NO' END AS yes_or_no) AS with_hierarchy FROM ( SELECT oid, relname, relnamespace, relkind, relowner, (aclexplode(relacl)).* FROM pg_class