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

Commitd34e142

Browse files
committed
Add information schema views role_udt_grants, udt_privileges, user_defined_types
1 parent2c262ea commitd34e142

File tree

2 files changed

+442
-8
lines changed

2 files changed

+442
-8
lines changed

‎doc/src/sgml/information_schema.sgml

Lines changed: 367 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3509,6 +3509,81 @@ ORDER BY c.ordinal_position;
35093509
</table>
35103510
</sect1>
35113511

3512+
<sect1 id="infoschema-role-udt-grants">
3513+
<title><literal>role_udt_grants</literal></title>
3514+
3515+
<para>
3516+
The view <literal>role_udt_grants</literal> is intended to identify
3517+
<literal>USAGE</literal> privileges granted on user-defined types
3518+
where the grantor or grantee is a currently enabled role. Further
3519+
information can be found under
3520+
<literal>udt_privileges</literal>. The only effective difference
3521+
between this view and <literal>udt_privileges</literal> is that
3522+
this view omits objects that have been made accessible to the
3523+
current user by way of a grant to <literal>PUBLIC</literal>. Since
3524+
data types do not have real privileges in PostgreSQL, but only an
3525+
implicit grant to <literal>PUBLIC</literal>, this view is empty.
3526+
</para>
3527+
3528+
<table>
3529+
<title><literal>role_udt_grants</literal> Columns</title>
3530+
3531+
<tgroup cols="3">
3532+
<thead>
3533+
<row>
3534+
<entry>Name</entry>
3535+
<entry>Data Type</entry>
3536+
<entry>Description</entry>
3537+
</row>
3538+
</thead>
3539+
3540+
<tbody>
3541+
<row>
3542+
<entry><literal>grantor</literal></entry>
3543+
<entry><type>sql_identifier</type></entry>
3544+
<entry>The name of the role that granted the privilege</entry>
3545+
</row>
3546+
3547+
<row>
3548+
<entry><literal>grantee</literal></entry>
3549+
<entry><type>sql_identifier</type></entry>
3550+
<entry>The name of the role that the privilege was granted to</entry>
3551+
</row>
3552+
3553+
<row>
3554+
<entry><literal>udt_catalog</literal></entry>
3555+
<entry><type>sql_identifier</type></entry>
3556+
<entry>Name of the database containing the type (always the current database)</entry>
3557+
</row>
3558+
3559+
<row>
3560+
<entry><literal>udt_schema</literal></entry>
3561+
<entry><type>sql_identifier</type></entry>
3562+
<entry>Name of the schema containing the type</entry>
3563+
</row>
3564+
3565+
<row>
3566+
<entry><literal>udt_name</literal></entry>
3567+
<entry><type>sql_identifier</type></entry>
3568+
<entry>Name of the type</entry>
3569+
</row>
3570+
3571+
<row>
3572+
<entry><literal>privilege_type</literal></entry>
3573+
<entry><type>character_data</type></entry>
3574+
<entry>Always <literal>TYPE USAGE</literal></entry>
3575+
</row>
3576+
3577+
<row>
3578+
<entry><literal>is_grantable</literal></entry>
3579+
<entry><type>yes_or_no</type></entry>
3580+
<entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
3581+
</row>
3582+
</tbody>
3583+
</tgroup>
3584+
</table>
3585+
</sect1>
3586+
35123587
<sect1 id="infoschema-role-usage-grants">
35133588
<title><literal>role_usage_grants</literal></title>
35143589

@@ -5499,6 +5574,80 @@ ORDER BY c.ordinal_position;
54995574
</note>
55005575
</sect1>
55015576

5577+
<sect1 id="infoschema-udt-privileges">
5578+
<title><literal>udt_privileges</literal></title>
5579+
5580+
<para>
5581+
The view <literal>udt_privileges</literal> is intended to identify
5582+
<literal>USAGE</literal> privileges granted on user-defined types
5583+
to a currently enabled role or by a currently enabled role. Since
5584+
data types do not have real privileges
5585+
in <productname>PostgreSQL</productname>, this view shows implicit
5586+
non-grantable <literal>USAGE</literal> privileges granted by the
5587+
owner to <literal>PUBLIC</literal> for all types, including
5588+
built-in ones (except domains,
5589+
see <xref linkend="infoschema-usage-privileges"> for that).
5590+
</para>
5591+
5592+
<table>
5593+
<title><literal>udt_privileges</literal> Columns</title>
5594+
5595+
<tgroup cols="3">
5596+
<thead>
5597+
<row>
5598+
<entry>Name</entry>
5599+
<entry>Data Type</entry>
5600+
<entry>Description</entry>
5601+
</row>
5602+
</thead>
5603+
5604+
<tbody>
5605+
<row>
5606+
<entry><literal>grantor</literal></entry>
5607+
<entry><type>sql_identifier</type></entry>
5608+
<entry>Name of the role that granted the privilege</entry>
5609+
</row>
5610+
5611+
<row>
5612+
<entry><literal>grantee</literal></entry>
5613+
<entry><type>sql_identifier</type></entry>
5614+
<entry>Name of the role that the privilege was granted to</entry>
5615+
</row>
5616+
5617+
<row>
5618+
<entry><literal>udt_catalog</literal></entry>
5619+
<entry><type>sql_identifier</type></entry>
5620+
<entry>Name of the database containing the type (always the current database)</entry>
5621+
</row>
5622+
5623+
<row>
5624+
<entry><literal>udt_schema</literal></entry>
5625+
<entry><type>sql_identifier</type></entry>
5626+
<entry>Name of the schema containing the type</entry>
5627+
</row>
5628+
5629+
<row>
5630+
<entry><literal>udt_name</literal></entry>
5631+
<entry><type>sql_identifier</type></entry>
5632+
<entry>Name of the type</entry>
5633+
</row>
5634+
5635+
<row>
5636+
<entry><literal>privilege_type</literal></entry>
5637+
<entry><type>character_data</type></entry>
5638+
<entry>Always <literal>TYPE USAGE</literal></entry>
5639+
</row>
5640+
5641+
<row>
5642+
<entry><literal>is_grantable</literal></entry>
5643+
<entry><type>yes_or_no</type></entry>
5644+
<entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
5645+
</row>
5646+
</tbody>
5647+
</tgroup>
5648+
</table>
5649+
</sect1>
5650+
55025651
<sect1 id="infoschema-usage-privileges">
55035652
<title><literal>usage_privileges</literal></title>
55045653

@@ -5585,6 +5734,224 @@ ORDER BY c.ordinal_position;
55855734
</table>
55865735
</sect1>
55875736

5737+
<sect1 id="infoschema-user-defined-types">
5738+
<title><literal>user_defined_types</literal></title>
5739+
5740+
<para>
5741+
The view <literal>user_defined_types</literal> currently contains
5742+
all composite types defined in the current database.
5743+
</para>
5744+
5745+
<para>
5746+
SQL knows about two kinds of user-defined types: structured types
5747+
(also known as composite types
5748+
in <productname>PostgreSQL</productname>) and distinct types (not
5749+
implemented in <productname>PostgreSQL</productname>). To be
5750+
future-proof, use the
5751+
column <literal>user_defined_type_category</literal> to
5752+
differentiate between these. Other user-defined types such as base
5753+
types and enums, which are <productname>PostgreSQL</productname>
5754+
extensions, are not shown here. For domains,
5755+
see <xref linkend="infoschema-domains"> instead.
5756+
</para>
5757+
5758+
<table>
5759+
<title><literal>user_defined_types</literal> Columns</title>
5760+
5761+
<tgroup cols="3">
5762+
<thead>
5763+
<row>
5764+
<entry>Name</entry>
5765+
<entry>Data Type</entry>
5766+
<entry>Description</entry>
5767+
</row>
5768+
</thead>
5769+
5770+
<tbody>
5771+
<row>
5772+
<entry><literal>user_defined_type_catalog</literal></entry>
5773+
<entry><type>sql_identifier</type></entry>
5774+
<entry>Name of the database that contains the type (always the current database)</entry>
5775+
</row>
5776+
5777+
<row>
5778+
<entry><literal>user_defined_type_schema</literal></entry>
5779+
<entry><type>sql_identifier</type></entry>
5780+
<entry>Name of the schema that contains the type</entry>
5781+
</row>
5782+
5783+
<row>
5784+
<entry><literal>user_defined_type_name</literal></entry>
5785+
<entry><type>sql_identifier</type></entry>
5786+
<entry>Name of the type</entry>
5787+
</row>
5788+
5789+
<row>
5790+
<entry><literal>user_defined_type_category</literal></entry>
5791+
<entry><type>character_data</type></entry>
5792+
<entry>
5793+
Currently always <literal>STRUCTURED</literal>
5794+
</entry>
5795+
</row>
5796+
5797+
<row>
5798+
<entry><literal>is_instantiable</literal></entry>
5799+
<entry><type>yes_or_no</type></entry>
5800+
<entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5801+
</row>
5802+
5803+
<row>
5804+
<entry><literal>is_final</literal></entry>
5805+
<entry><type>yes_or_no</type></entry>
5806+
<entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5807+
</row>
5808+
5809+
<row>
5810+
<entry><literal>ordering_form</literal></entry>
5811+
<entry><type>character_data</type></entry>
5812+
<entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5813+
</row>
5814+
5815+
<row>
5816+
<entry><literal>ordering_category</literal></entry>
5817+
<entry><type>character_data</type></entry>
5818+
<entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5819+
</row>
5820+
5821+
<row>
5822+
<entry><literal>ordering_routine_catalog</literal></entry>
5823+
<entry><type>sql_identifier</type></entry>
5824+
<entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5825+
</row>
5826+
5827+
<row>
5828+
<entry><literal>ordering_routine_schema</literal></entry>
5829+
<entry><type>sql_identifier</type></entry>
5830+
<entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5831+
</row>
5832+
5833+
<row>
5834+
<entry><literal>ordering_routine_name</literal></entry>
5835+
<entry><type>sql_identifier</type></entry>
5836+
<entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5837+
</row>
5838+
5839+
<row>
5840+
<entry><literal>reference_type</literal></entry>
5841+
<entry><type>character_data</type></entry>
5842+
<entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5843+
</row>
5844+
5845+
<row>
5846+
<entry><literal>data_type</literal></entry>
5847+
<entry><type>character_data</type></entry>
5848+
<entry>
5849+
Always <literal>USER-DEFINED TYPE</literal> (for joining
5850+
against <literal>object_type</literal> columns in other
5851+
views)
5852+
</entry>
5853+
</row>
5854+
5855+
<row>
5856+
<entry><literal>character_maximum_length</literal></entry>
5857+
<entry><type>cardinal_number</type></entry>
5858+
<entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5859+
</row>
5860+
5861+
<row>
5862+
<entry><literal>character_octet_length</literal></entry>
5863+
<entry><type>cardinal_number</type></entry>
5864+
<entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5865+
</row>
5866+
5867+
<row>
5868+
<entry><literal>character_set_catalog</literal></entry>
5869+
<entry><type>sql_identifier</type></entry>
5870+
<entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5871+
</row>
5872+
5873+
<row>
5874+
<entry><literal>character_set_schema</literal></entry>
5875+
<entry><type>sql_identifier</type></entry>
5876+
<entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5877+
</row>
5878+
5879+
<row>
5880+
<entry><literal>character_set_name</literal></entry>
5881+
<entry><type>sql_identifier</type></entry>
5882+
<entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5883+
</row>
5884+
5885+
<row>
5886+
<entry><literal>collation_catalog</literal></entry>
5887+
<entry><type>sql_identifier</type></entry>
5888+
<entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5889+
</row>
5890+
5891+
<row>
5892+
<entry><literal>collation_schema</literal></entry>
5893+
<entry><type>sql_identifier</type></entry>
5894+
<entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5895+
</row>
5896+
5897+
<row>
5898+
<entry><literal>collation_name</literal></entry>
5899+
<entry><type>sql_identifier</type></entry>
5900+
<entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5901+
</row>
5902+
5903+
<row>
5904+
<entry><literal>numeric_precision</literal></entry>
5905+
<entry><type>cardinal_number</type></entry>
5906+
<entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5907+
</row>
5908+
5909+
<row>
5910+
<entry><literal>numeric_precision_radix</literal></entry>
5911+
<entry><type>cardinal_number</type></entry>
5912+
<entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5913+
</row>
5914+
5915+
<row>
5916+
<entry><literal>numeric_scale</literal></entry>
5917+
<entry><type>cardinal_number</type></entry>
5918+
<entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5919+
</row>
5920+
5921+
<row>
5922+
<entry><literal>datetime_precision</literal></entry>
5923+
<entry><type>cardinal_number</type></entry>
5924+
<entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5925+
</row>
5926+
5927+
<row>
5928+
<entry><literal>interval_type</literal></entry>
5929+
<entry><type>character_data</type></entry>
5930+
<entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5931+
</row>
5932+
5933+
<row>
5934+
<entry><literal>interval_precision</literal></entry>
5935+
<entry><type>character_data</type></entry>
5936+
<entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5937+
</row>
5938+
5939+
<row>
5940+
<entry><literal>source_dtd_identifier</literal></entry>
5941+
<entry><type>sql_identifier</type></entry>
5942+
<entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5943+
</row>
5944+
5945+
<row>
5946+
<entry><literal>ref_dtd_identifier</literal></entry>
5947+
<entry><type>sql_identifier</type></entry>
5948+
<entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5949+
</row>
5950+
</tbody>
5951+
</tgroup>
5952+
</table>
5953+
</sect1>
5954+
55885955
<sect1 id="infoschema-user-mapping-options">
55895956
<title><literal>user_mapping_options</literal></title>
55905957

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp