@@ -13917,6 +13917,21 @@ SET search_path TO <replaceable>schema</> <optional>, <replaceable>schema</>, ..
13917
13917
<entry><type>boolean</type></entry>
13918
13918
<entry>does current user have privilege for tablespace</entry>
13919
13919
</row>
13920
+ <row>
13921
+ <entry><literal><function>has_type_privilege</function>(<parameter>user</parameter>,
13922
+ <parameter>type</parameter>,
13923
+ <parameter>privilege</parameter>)</literal>
13924
+ </entry>
13925
+ <entry><type>boolean</type></entry>
13926
+ <entry>does user have privilege for type</entry>
13927
+ </row>
13928
+ <row>
13929
+ <entry><literal><function>has_type_privilege</function>(<parameter>type</parameter>,
13930
+ <parameter>privilege</parameter>)</literal>
13931
+ </entry>
13932
+ <entry><type>boolean</type></entry>
13933
+ <entry>does current user have privilege for type</entry>
13934
+ </row>
13920
13935
<row>
13921
13936
<entry><literal><function>pg_has_role</function>(<parameter>user</parameter>,
13922
13937
<parameter>role</parameter>,
@@ -13969,6 +13984,9 @@ SET search_path TO <replaceable>schema</> <optional>, <replaceable>schema</>, ..
13969
13984
<indexterm>
13970
13985
<primary>has_tablespace_privilege</primary>
13971
13986
</indexterm>
13987
+ <indexterm>
13988
+ <primary>has_type_privilege</primary>
13989
+ </indexterm>
13972
13990
<indexterm>
13973
13991
<primary>pg_has_role</primary>
13974
13992
</indexterm>
@@ -14120,6 +14138,18 @@ SELECT has_function_privilege('joeuser', 'myfunc(int, text)', 'execute');
14120
14138
<literal>CREATE</literal>.
14121
14139
</para>
14122
14140
14141
+ <para>
14142
+ <function>has_type_privilege</function> checks whether a user
14143
+ can access a type in a particular way.
14144
+ Its argument possibilities
14145
+ are analogous to <function>has_table_privilege</function>.
14146
+ When specifying a type by a text string rather than by OID,
14147
+ the allowed input is the same as for the <type>regtype</> data type
14148
+ (see <xref linkend="datatype-oid">).
14149
+ The desired access privilege type must evaluate to
14150
+ <literal>USAGE</literal>.
14151
+ </para>
14152
+
14123
14153
<para>
14124
14154
<function>pg_has_role</function> checks whether a user
14125
14155
can access a role in a particular way.
0 commit comments