Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitfd5b397

Browse files
committed
Implement the information schema with_hierarchy column
In PostgreSQL, this is included in the SELECT privilege, so show YESor NO depending on whether SELECT is granted.
1 parent3104cc8 commitfd5b397

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

‎doc/src/sgml/information_schema.sgml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3684,7 +3684,14 @@ ORDER BY c.ordinal_position;
36843684
<row>
36853685
<entry><literal>with_hierarchy</literal></entry>
36863686
<entry><type>yes_or_no</type></entry>
3687-
<entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3687+
<entry>
3688+
In the SQL standard, <literal>WITH HIERARCHY OPTION</literal>
3689+
is a separate (sub-)privilege allowing certain operations on
3690+
table inheritance hierarchies. In PostgreSQL, this is included
3691+
in the <literal>SELECT</literal> privilege, so this column
3692+
shows <literal>YES</literal> if the privilege
3693+
is <literal>SELECT</literal>, else <literal>NO</literal>.
3694+
</entry>
36883695
</row>
36893696
</tbody>
36903697
</tgroup>
@@ -5364,7 +5371,14 @@ ORDER BY c.ordinal_position;
53645371
<row>
53655372
<entry><literal>with_hierarchy</literal></entry>
53665373
<entry><type>yes_or_no</type></entry>
5367-
<entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5374+
<entry>
5375+
In the SQL standard, <literal>WITH HIERARCHY OPTION</literal>
5376+
is a separate (sub-)privilege allowing certain operations on
5377+
table inheritance hierarchies. In PostgreSQL, this is included
5378+
in the <literal>SELECT</literal> privilege, so this column
5379+
shows <literal>YES</literal> if the privilege
5380+
is <literal>SELECT</literal>, else <literal>NO</literal>.
5381+
</entry>
53685382
</row>
53695383
</tbody>
53705384
</tgroup>

‎src/backend/catalog/information_schema.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1785,7 +1785,7 @@ CREATE VIEW table_privileges AS
17851785
pg_has_role(grantee.oid,c.relowner,'USAGE')
17861786
ORc.grantable
17871787
THEN'YES' ELSE'NO' ENDAS yes_or_no)AS is_grantable,
1788-
CAST('NO'AS yes_or_no)AS with_hierarchy
1788+
CAST(CASE WHENc.prtype='SELECT' THEN'YES' ELSE'NO' ENDAS yes_or_no)AS with_hierarchy
17891789

17901790
FROM (
17911791
SELECToid, relname, relnamespace, relkind, relowner, (aclexplode(relacl)).*FROM pg_class

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp