git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3104cc8)
Implement the information schema with_hierarchy column
2011年8月27日 12:03:02 +0000 (15:03 +0300)
2011年8月27日 12:03:02 +0000 (15:03 +0300)
In PostgreSQL, this is included in the SELECT privilege, so show YES
or NO depending on whether SELECT is granted.


diff --git a/doc/src/sgml/information_schema.sgml b/doc/src/sgml/information_schema.sgml
index 0f0cbfaa83a5007426ac42e83654d2ee5e0a0bd1..8063d059c8d98ae52bd2d2a5a8b729aa49f7cffc 100644 (file)
--- a/doc/src/sgml/information_schema.sgml
+++ b/doc/src/sgml/information_schema.sgml
@@ -3684,7 +3684,14 @@ ORDER BY c.ordinal_position;
<row>
<entry><literal>with_hierarchy</literal></entry>
<entry><type>yes_or_no</type></entry>
- <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
+ <entry>
+ In the SQL standard, <literal>WITH HIERARCHY OPTION</literal>
+ is a separate (sub-)privilege allowing certain operations on
+ table inheritance hierarchies. In PostgreSQL, this is included
+ in the <literal>SELECT</literal> privilege, so this column
+ shows <literal>YES</literal> if the privilege
+ is <literal>SELECT</literal>, else <literal>NO</literal>.
+ </entry>
</row>
</tbody>
</tgroup>
@@ -5364,7 +5371,14 @@ ORDER BY c.ordinal_position;
<row>
<entry><literal>with_hierarchy</literal></entry>
<entry><type>yes_or_no</type></entry>
- <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
+ <entry>
+ In the SQL standard, <literal>WITH HIERARCHY OPTION</literal>
+ is a separate (sub-)privilege allowing certain operations on
+ table inheritance hierarchies. In PostgreSQL, this is included
+ in the <literal>SELECT</literal> privilege, so this column
+ shows <literal>YES</literal> if the privilege
+ is <literal>SELECT</literal>, else <literal>NO</literal>.
+ </entry>
</row>
</tbody>
</tgroup>
diff --git a/src/backend/catalog/information_schema.sql b/src/backend/catalog/information_schema.sql
index 47c48bfb275f93e6ee73ad24fa6078dae01c279f..e5555d6148e94311e75683339951d7a90b536e5f 100644 (file)
--- 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
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /