Home Explore Blog CI



postgresql

85th chunk of `doc/src/sgml/information_schema.sgml`
5b509d781e986bf7b0043ce52423894edc237cde34a16fd30000000100000fa0
 </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>udt_catalog</structfield> <type>sql_identifier</type>
      </para>
      <para>
       Name of the database containing the type (always the current database)
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>udt_schema</structfield> <type>sql_identifier</type>
      </para>
      <para>
       Name of the schema containing the type
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>udt_name</structfield> <type>sql_identifier</type>
      </para>
      <para>
       Name of the type
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>privilege_type</structfield> <type>character_data</type>
      </para>
      <para>
       Always <literal>TYPE USAGE</literal>
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>is_grantable</structfield> <type>yes_or_no</type>
      </para>
      <para>
       <literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not
      </para></entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>

 <sect1 id="infoschema-usage-privileges">
  <title><literal>usage_privileges</literal></title>

  <para>
   The view <literal>usage_privileges</literal> identifies
   <literal>USAGE</literal> privileges granted on various kinds of
   objects to a currently enabled role or by a currently enabled role.
   In <productname>PostgreSQL</productname>, this currently applies to
   collations, domains, foreign-data wrappers, foreign servers, and sequences.  There is one
   row for each combination of object, grantor, and grantee.
  </para>

  <para>
   Since collations do not have real privileges
   in <productname>PostgreSQL</productname>, this view shows implicit
   non-grantable <literal>USAGE</literal> privileges granted by the
   owner to <literal>PUBLIC</literal> for all collations.  The other
   object types, however, show real privileges.
  </para>

  <para>
   In PostgreSQL, sequences also support <literal>SELECT</literal>
   and <literal>UPDATE</literal> privileges in addition to
   the <literal>USAGE</literal> privilege.  These are nonstandard and therefore
   not visible in the information schema.
  </para>

  <table>
   <title><structname>usage_privileges</structname> Columns</title>
   <tgroup cols="1">
    <thead>
     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       Column Type
      </para>
      <para>
       Description
      </para></entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>grantor</structfield> <type>sql_identifier</type>
      </para>
      <para>
       Name of the role that granted the privilege
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>grantee</structfield> <type>sql_identifier</type>
      </para>
      <para>
       Name of the role that the privilege was granted to
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>object_catalog</structfield> <type>sql_identifier</type>
      </para>
      <para>
       Name of the database containing the object (always the current database)
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>object_schema</structfield> <type>sql_identifier</type>
      </para>
      <para>
       Name of the schema containing the object, if applicable,
       else an empty string
     

Title: Usage Privileges View
Summary
The usage_privileges view identifies USAGE privileges granted on various objects, including collations, domains, foreign-data wrappers, foreign servers, and sequences, to a currently enabled role or by a currently enabled role, with columns including grantor, grantee, object catalog, schema, and others.