Home Explore Blog CI



postgresql

76th chunk of `doc/src/sgml/information_schema.sgml`
3654bd8c609dba584de9fd25694bcc39a141d677f1ae62c70000000100000fa3
 contains the table (always the current database)
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>table_schema</structfield> <type>sql_identifier</type>
      </para>
      <para>
       Name of the schema that contains the table
      </para></entry>
     </row>

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

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>constraint_type</structfield> <type>character_data</type>
      </para>
      <para>
       Type of the constraint: <literal>CHECK</literal> (includes not-null constraints),
       <literal>FOREIGN KEY</literal>, <literal>PRIMARY KEY</literal>,
       or <literal>UNIQUE</literal>
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>is_deferrable</structfield> <type>yes_or_no</type>
      </para>
      <para>
       <literal>YES</literal> if the constraint is deferrable, <literal>NO</literal> if not
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>initially_deferred</structfield> <type>yes_or_no</type>
      </para>
      <para>
       <literal>YES</literal> if the constraint is deferrable and initially deferred, <literal>NO</literal> if not
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>enforced</structfield> <type>yes_or_no</type>
      </para>
      <para>
       <literal>YES</literal> if the constraint is enforced, <literal>NO</literal> if not
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>nulls_distinct</structfield> <type>yes_or_no</type>
      </para>
      <para>
       If the constraint is a unique constraint, then <literal>YES</literal>
       if the constraint treats nulls as distinct or <literal>NO</literal> if
       it treats nulls as not distinct, otherwise null for other types of
       constraints.
      </para></entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>

 <sect1 id="infoschema-table-privileges">
  <title><literal>table_privileges</literal></title>

  <para>
   The view <literal>table_privileges</literal> identifies all
   privileges granted on tables or views to a currently enabled role
   or by a currently enabled role.  There is one row for each
   combination of table, grantor, and grantee.
  </para>

  <table>
   <title><structname>table_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>table_catalog</structfield> <type>sql_identifier</type>
      </para>
      <para>
       Name of the database that contains the table (always the current database)
      </para></entry>
     </row>

     <row>

Title: Information Schema: Table Constraints and Privileges
Summary
This section describes the table_constraints and table_privileges views in the information schema, which contain information about constraints on tables, including constraint types and deferrability, and privileges granted on tables or views to a currently enabled role, including the grantor, grantee, and table information.