mirror of
				https://github.com/postgres/postgres.git
				synced 2025-10-31 00:03:57 -04:00 
			
		
		
		
	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.
This commit is contained in:
		
							parent
							
								
									3104cc89be
								
							
						
					
					
						commit
						fd5b397ca4
					
				| @ -3684,7 +3684,14 @@ ORDER BY c.ordinal_position; | |||||||
|      <row> |      <row> | ||||||
|       <entry><literal>with_hierarchy</literal></entry> |       <entry><literal>with_hierarchy</literal></entry> | ||||||
|       <entry><type>yes_or_no</type></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> |      </row> | ||||||
|     </tbody> |     </tbody> | ||||||
|    </tgroup> |    </tgroup> | ||||||
| @ -5364,7 +5371,14 @@ ORDER BY c.ordinal_position; | |||||||
|      <row> |      <row> | ||||||
|       <entry><literal>with_hierarchy</literal></entry> |       <entry><literal>with_hierarchy</literal></entry> | ||||||
|       <entry><type>yes_or_no</type></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> |      </row> | ||||||
|     </tbody> |     </tbody> | ||||||
|    </tgroup> |    </tgroup> | ||||||
|  | |||||||
| @ -1785,7 +1785,7 @@ CREATE VIEW table_privileges AS | |||||||
|                   pg_has_role(grantee.oid, c.relowner, 'USAGE') |                   pg_has_role(grantee.oid, c.relowner, 'USAGE') | ||||||
|                   OR c.grantable |                   OR c.grantable | ||||||
|                   THEN 'YES' ELSE 'NO' END AS yes_or_no) AS is_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 ( |     FROM ( | ||||||
|             SELECT oid, relname, relnamespace, relkind, relowner, (aclexplode(relacl)).* FROM pg_class |             SELECT oid, relname, relnamespace, relkind, relowner, (aclexplode(relacl)).* FROM pg_class | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user