<!-- doc/src/sgml/information_schema.sgml -->

<chapter id="information-schema">
 <title>The Information Schema</title>

 <indexterm zone="information-schema">
  <primary>information schema</primary>
 </indexterm>

 <para>
  The information schema consists of a set of views that contain
  information about the objects defined in the current database.  The
  information schema is defined in the SQL standard and can therefore
  be expected to be portable and remain stable &mdash; unlike the system
  catalogs, which are specific to
  <productname>PostgreSQL</productname> and are modeled after
  implementation concerns.  The information schema views do not,
  however, contain information about
  <productname>PostgreSQL</productname>-specific features; to inquire
  about those you need to query the system catalogs or other
  <productname>PostgreSQL</productname>-specific views.
 </para>

 <note>
  <para>
   When querying the database for constraint information, it is possible
   for a standard-compliant query that expects to return one row to
   return several.  This is because the SQL standard requires constraint
   names to be unique within a schema, but
   <productname>PostgreSQL</productname> does not enforce this
   restriction.  <productname>PostgreSQL</productname>
   automatically-generated constraint names avoid duplicates in the
   same schema, but users can specify such duplicate names.
  </para>

  <para>
   This problem can appear when querying information schema views such
   as <literal>check_constraint_routine_usage</>,
   <literal>check_constraints</>, <literal>domain_constraints</>, and
   <literal>referential_constraints</>.  Some other views have similar
   issues but contain the table name to help distinguish duplicate
   rows, e.g., <literal>constraint_column_usage</>,
   <literal>constraint_table_usage</>, <literal>table_constraints</>.
  </para>
 </note>


 <sect1 id="infoschema-schema">
  <title>The Schema</title>

  <para>
   The information schema itself is a schema named
   <literal>information_schema</literal>.  This schema automatically
   exists in all databases.  The owner of this schema is the initial
   database user in the cluster, and that user naturally has all the
   privileges on this schema, including the ability to drop it (but
   the space savings achieved by that are minuscule).
  </para>

  <para>
   By default, the information schema is not in the schema search
   path, so you need to access all objects in it through qualified
   names.  Since the names of some of the objects in the information
   schema are generic names that might occur in user applications, you
   should be careful if you want to put the information schema in the
   path.
  </para>
 </sect1>

 <sect1 id="infoschema-datatypes">
  <title>Data Types</title>

  <para>
   The columns of the information schema views use special data types
   that are defined in the information schema.  These are defined as
   simple domains over ordinary built-in types.  You should not use
   these types for work outside the information schema, but your
   applications must be prepared for them if they select from the
   information schema.
  </para>

  <para>
   These types are:

   <variablelist>
    <varlistentry>
     <term><type>cardinal_number</type></term>
     <listitem>
      <para>
       A nonnegative integer.
      </para>
     </listitem>
    </varlistentry>

    <varlistentry>
     <term><type>character_data</type></term>
     <listitem>
      <para>
       A character string (without specific maximum length).
      </para>
     </listitem>
    </varlistentry>

    <varlistentry>
     <term><type>sql_identifier</type></term>
     <listitem>
      <para>
       A character string.  This type is used for SQL identifiers, the
       type <type>character_data</type> is used for any other kind of
       text data.
      </para>
     </listitem>
    </varlistentry>

    <varlistentry>
     <term><type>time_stamp</type></term>
     <listitem>
      <para>
       A domain over the type <type>timestamp with time zone</type>
      </para>
     </listitem>
    </varlistentry>

    <varlistentry>
     <term><type>yes_or_no</type></term>
     <listitem>
      <para>
       A character string domain that contains
       either <literal>YES</literal> or <literal>NO</literal>.  This
       is used to represent Boolean (true/false) data in the
       information schema.  (The information schema was invented
       before the type <type>boolean</type> was added to the SQL
       standard, so this convention is necessary to keep the
       information schema backward compatible.)
      </para>
     </listitem>
    </varlistentry>
   </variablelist>

   Every column in the information schema has one of these five types.
  </para>
 </sect1>

 <sect1 id="infoschema-information-schema-catalog-name">
  <title><literal>information_schema_catalog_name</literal></title>

  <para>
   <literal>information_schema_catalog_name</literal> is a table that
   always contains one row and one column containing the name of the
   current database (current catalog, in SQL terminology).
  </para>

  <table>
   <title><literal>information_schema_catalog_name</literal> Columns</title>

   <tgroup cols="3">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Data Type</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><literal>catalog_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the database that contains this information schema</entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>

 <sect1 id="infoschema-administrable-role-authorizations">
  <title><literal>administrable_role_authorizations</literal></title>

  <para>
   The view <literal>administrable_role_authorizations</literal>
   identifies all roles that the current user has the admin option
   for.
  </para>

  <table>
   <title><literal>administrable_role_authorizations</literal> Columns</title>

   <tgroup cols="3">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Data Type</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><literal>grantee</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>
       Name of the role to which this role membership was granted (can
       be the current user, or a different role in case of nested role
       memberships)
      </entry>
     </row>

     <row>
      <entry><literal>role_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of a role</entry>
     </row>

     <row>
      <entry><literal>is_grantable</literal></entry>
      <entry><type>yes_or_no</type></entry>
      <entry>Always <literal>YES</literal></entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>

 <sect1 id="infoschema-applicable-roles">
  <title><literal>applicable_roles</literal></title>

  <para>
   The view <literal>applicable_roles</literal> identifies all roles
   whose privileges the current user can use.  This means there is
   some chain of role grants from the current user to the role in
   question.  The current user itself is also an applicable role.  The
   set of applicable roles is generally used for permission checking.
   <indexterm><primary>applicable role</primary></indexterm>
   <indexterm><primary>role</primary><secondary>applicable</secondary></indexterm>
  </para>

  <table>
   <title><literal>applicable_roles</literal> Columns</title>

   <tgroup cols="3">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Data Type</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><literal>grantee</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>
       Name of the role to which this role membership was granted (can
       be the current user, or a different role in case of nested role
       memberships)
      </entry>
     </row>

     <row>
      <entry><literal>role_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of a role</entry>
     </row>

     <row>
      <entry><literal>is_grantable</literal></entry>
      <entry><type>yes_or_no</type></entry>
      <entry>
       <literal>YES</literal> if the grantee has the admin option on
       the role, <literal>NO</literal> if not
      </entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>

 <sect1 id="infoschema-attributes">
  <title><literal>attributes</literal></title>

  <para>
   The view <literal>attributes</literal> contains information about
   the attributes of composite data types defined in the database.
   (Note that the view does not give information about table columns,
   which are sometimes called attributes in PostgreSQL contexts.)
   Only those attributes are shown that the current user has access to (by way
   of being the owner of or having some privilege on the type).
  </para>

  <table>
   <title><literal>attributes</literal> Columns</title>

   <tgroup cols="3">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Data Type</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><literal>udt_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the database containing the data type (always the current database)</entry>
     </row>

     <row>
      <entry><literal>udt_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the schema containing the data type</entry>
     </row>

     <row>
      <entry><literal>udt_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the data type</entry>
     </row>

     <row>
      <entry><literal>attribute_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the attribute</entry>
     </row>

     <row>
      <entry><literal>ordinal_position</literal></entry>
      <entry><type>cardinal_number</type></entry>
      <entry>Ordinal position of the attribute within the data type (count starts at 1)</entry>
     </row>

     <row>
      <entry><literal>attribute_default</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>Default expression of the attribute</entry>
     </row>

     <row>
      <entry><literal>is_nullable</literal></entry>
      <entry><type>yes_or_no</type></entry>
      <entry>
       <literal>YES</literal> if the attribute is possibly nullable,
       <literal>NO</literal> if it is known not nullable.
      </entry>
     </row>

     <row>
      <entry><literal>data_type</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>
       Data type of the attribute, if it is a built-in type, or
       <literal>ARRAY</literal> if it is some array (in that case, see
       the view <literal>element_types</literal>), else
       <literal>USER-DEFINED</literal> (in that case, the type is
       identified in <literal>attribute_udt_name</literal> and
       associated columns).
      </entry>
     </row>

     <row>
      <entry><literal>character_maximum_length</literal></entry>
      <entry><type>cardinal_number</type></entry>
      <entry>
       If <literal>data_type</literal> identifies a character or bit
       string type, the declared maximum length; null for all other
       data types or if no maximum length was declared.
      </entry>
     </row>

     <row>
      <entry><literal>character_octet_length</literal></entry>
      <entry><type>cardinal_number</type></entry>
      <entry>
       If <literal>data_type</literal> identifies a character type,
       the maximum possible length in octets (bytes) of a datum; null
       for all other data types.  The maximum octet length depends on
       the declared character maximum length (see above) and the
       server encoding.
      </entry>
     </row>

     <row>
      <entry><literal>character_set_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>character_set_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>character_set_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>collation_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>
       Name of the database containing the collation of the attribute
       (always the current database), null if default or the data type
       of the attribute is not collatable
      </entry>
     </row>

     <row>
      <entry><literal>collation_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>
       Name of the schema containing the collation of the attribute,
       null if default or the data type of the attribute is not
       collatable
      </entry>
     </row>

     <row>
      <entry><literal>collation_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>
       Name of the collation of the attribute, null if default or the
       data type of the attribute is not collatable
      </entry>
     </row>

     <row>
      <entry><literal>numeric_precision</literal></entry>
      <entry><type>cardinal_number</type></entry>
      <entry>
       If <literal>data_type</literal> identifies a numeric type, this
       column contains the (declared or implicit) precision of the
       type for this attribute.  The precision indicates the number of
       significant digits.  It can be expressed in decimal (base 10)
       or binary (base 2) terms, as specified in the column
       <literal>numeric_precision_radix</literal>.  For all other data
       types, this column is null.
      </entry>
     </row>

     <row>
      <entry><literal>numeric_precision_radix</literal></entry>
      <entry><type>cardinal_number</type></entry>
      <entry>
       If <literal>data_type</literal> identifies a numeric type, this
       column indicates in which base the values in the columns
       <literal>numeric_precision</literal> and
       <literal>numeric_scale</literal> are expressed.  The value is
       either 2 or 10.  For all other data types, this column is null.
      </entry>
     </row>

     <row>
      <entry><literal>numeric_scale</literal></entry>
      <entry><type>cardinal_number</type></entry>
      <entry>
       If <literal>data_type</literal> identifies an exact numeric
       type, this column contains the (declared or implicit) scale of
       the type for this attribute.  The scale indicates the number of
       significant digits to the right of the decimal point.  It can
       be expressed in decimal (base 10) or binary (base 2) terms, as
       specified in the column
       <literal>numeric_precision_radix</literal>.  For all other data
       types, this column is null.
      </entry>
     </row>

     <row>
      <entry><literal>datetime_precision</literal></entry>
      <entry><type>cardinal_number</type></entry>
      <entry>
       If <literal>data_type</literal> identifies a date, time,
       timestamp, or interval type, this column contains the (declared
       or implicit) fractional seconds precision of the type for this
       attribute, that is, the number of decimal digits maintained
       following the decimal point in the seconds value.  For all
       other data types, this column is null.
      </entry>
     </row>

     <row>
      <entry><literal>interval_type</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>
       If <literal>data_type</literal> identifies an interval type,
       this column contains the specification which fields the
       intervals include for this attribute, e.g., <literal>YEAR TO
       MONTH</literal>, <literal>DAY TO SECOND</literal>, etc.  If no
       field restrictions were specified (that is, the interval
       accepts all fields), and for all other data types, this field
       is null.
      </entry>
     </row>

     <row>
      <entry><literal>interval_precision</literal></entry>
      <entry><type>cardinal_number</type></entry>
      <entry>
       Applies to a feature not available
       in <productname>PostgreSQL</productname>
       (see <literal>datetime_precision</literal> for the fractional
       seconds precision of interval type attributes)
      </entry>
     </row>

     <row>
      <entry><literal>attribute_udt_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>
       Name of the database that the attribute data type is defined in
       (always the current database)
      </entry>
     </row>

     <row>
      <entry><literal>attribute_udt_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>
       Name of the schema that the attribute data type is defined in
      </entry>
     </row>

     <row>
      <entry><literal>attribute_udt_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>
       Name of the attribute data type
      </entry>
     </row>

     <row>
      <entry><literal>scope_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>scope_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>scope_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>maximum_cardinality</literal></entry>
      <entry><type>cardinal_number</type></entry>
      <entry>Always null, because arrays always have unlimited maximum cardinality in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>dtd_identifier</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>
       An identifier of the data type descriptor of the column, unique
       among the data type descriptors pertaining to the table.  This
       is mainly useful for joining with other instances of such
       identifiers.  (The specific format of the identifier is not
       defined and not guaranteed to remain the same in future
       versions.)
      </entry>
     </row>

     <row>
      <entry><literal>is_derived_reference_attribute</literal></entry>
      <entry><type>yes_or_no</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>
    </tbody>
   </tgroup>
  </table>

  <para>
   See also under <xref linkend="infoschema-columns">, a similarly
   structured view, for further information on some of the columns.
  </para>
 </sect1>

 <sect1 id="infoschema-character-sets">
  <title><literal>character_sets</literal></title>

  <para>
   The view <literal>character_sets</literal> identifies the character
   sets available in the current database.  Since PostgreSQL does not
   support multiple character sets within one database, this view only
   shows one, which is the database encoding.
  </para>

  <para>
   Take note of how the following terms are used in the SQL standard:
   <variablelist>
    <varlistentry>
     <term>character repertoire</term>
     <listitem>
      <para>
       An abstract collection of characters, for
       example <literal>UNICODE</literal>, <literal>UCS</literal>, or
       <literal>LATIN1</literal>.  Not exposed as an SQL object, but
       visible in this view.
      </para>
     </listitem>
    </varlistentry>

    <varlistentry>
     <term>character encoding form</term>
     <listitem>
      <para>
       An encoding of some character repertoire.  Most older character
       repertoires only use one encoding form, and so there are no
       separate names for them (e.g., <literal>LATIN1</literal> is an
       encoding form applicable to the <literal>LATIN1</literal>
       repertoire).  But for example Unicode has the encoding forms
       <literal>UTF8</literal>, <literal>UTF16</literal>, etc. (not
       all supported by PostgreSQL).  Encoding forms are not exposed
       as an SQL object, but are visible in this view.
      </para>
     </listitem>
    </varlistentry>

    <varlistentry>
     <term>character set</term>
     <listitem>
      <para>
       A named SQL object that identifies a character repertoire, a
       character encoding, and a default collation.  A predefined
       character set would typically have the same name as an encoding
       form, but users could define other names.  For example, the
       character set <literal>UTF8</literal> would typically identify
       the character repertoire <literal>UCS</literal>, encoding
       form <literal>UTF8</literal>, and some default collation.
      </para>
     </listitem>
    </varlistentry>
   </variablelist>

   You can think of an <quote>encoding</quote> in PostgreSQL either as
   a character set or a character encoding form.  They will have the
   same name, and there can only be one in one database.
  </para>

  <table>
   <title><literal>character_sets</literal> Columns</title>

   <tgroup cols="3">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Data Type</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><literal>character_set_catalog</literal></entry>
      <entry><literal>sql_identifier</literal></entry>
      <entry>Character sets are currently not implemented as schema objects, so this column is null.</entry>
     </row>

     <row>
      <entry><literal>character_set_schema</literal></entry>
      <entry><literal>sql_identifier</literal></entry>
      <entry>Character sets are currently not implemented as schema objects, so this column is null.</entry>
     </row>

     <row>
      <entry><literal>character_set_name</literal></entry>
      <entry><literal>sql_identifier</literal></entry>
      <entry>Name of the character set, currently implemented as showing the name of the database encoding</entry>
     </row>

     <row>
      <entry><literal>character_repertoire</literal></entry>
      <entry><literal>sql_identifier</literal></entry>
      <entry>Character repertoire, showing <literal>UCS</literal> if the encoding is <literal>UTF8</literal>, else just the encoding name</entry>
     </row>

     <row>
      <entry><literal>form_of_use</literal></entry>
      <entry><literal>sql_identifier</literal></entry>
      <entry>Character encoding form, same as the database encoding</entry>
     </row>

     <row>
      <entry><literal>default_collate_catalog</literal></entry>
      <entry><literal>sql_identifier</literal></entry>
      <entry>Name of the database containing the default collation (always the current database, if any collation is identified)</entry>
     </row>

     <row>
      <entry><literal>default_collate_schema</literal></entry>
      <entry><literal>sql_identifier</literal></entry>
      <entry>Name of the schema containing the default collation</entry>
     </row>

     <row>
      <entry><literal>default_collate_name</literal></entry>
      <entry><literal>sql_identifier</literal></entry>
      <entry>
       Name of the default collation.  The default collation is
       identified as the collation that matches
       the <literal>COLLATE</literal> and <literal>CTYPE</literal>
       settings of the current database.  If there is no such
       collation, then this column and the associated schema and
       catalog columns are null.
      </entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>

 <sect1 id="infoschema-check-constraint-routine-usage">
  <title><literal>check_constraint_routine_usage</literal></title>

  <para>
   The view <literal>check_constraint_routine_usage</literal>
   identifies routines (functions and procedures) that are used by a
   check constraint.  Only those routines are shown that are owned by
   a currently enabled role.
  </para>

  <table>
   <title><literal>check_constraint_routine_usage</literal> Columns</title>

   <tgroup cols="3">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Data Type</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><literal>constraint_catalog</literal></entry>
      <entry><literal>sql_identifier</literal></entry>
      <entry>Name of the database containing the constraint (always the current database)</entry>
     </row>

     <row>
      <entry><literal>constraint_schema</literal></entry>
      <entry><literal>sql_identifier</literal></entry>
      <entry>Name of the schema containing the constraint</entry>
     </row>

     <row>
      <entry><literal>constraint_name</literal></entry>
      <entry><literal>sql_identifier</literal></entry>
      <entry>Name of the constraint</entry>
     </row>

     <row>
      <entry><literal>specific_catalog</literal></entry>
      <entry><literal>sql_identifier</literal></entry>
      <entry>Name of the database containing the function (always the current database)</entry>
     </row>

     <row>
      <entry><literal>specific_schema</literal></entry>
      <entry><literal>sql_identifier</literal></entry>
      <entry>Name of the schema containing the function</entry>
     </row>

     <row>
      <entry><literal>specific_name</literal></entry>
      <entry><literal>sql_identifier</literal></entry>
      <entry>
       The <quote>specific name</quote> of the function.  See <xref
       linkend="infoschema-routines"> for more information.
      </entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>

 <sect1 id="infoschema-check-constraints">
  <title><literal>check_constraints</literal></title>

  <para>
   The view <literal>check_constraints</literal> contains all check
   constraints, either defined on a table or on a domain, that are
   owned by a currently enabled role.  (The owner of the table or
   domain is the owner of the constraint.)
  </para>

  <table>
   <title><literal>check_constraints</literal> Columns</title>

   <tgroup cols="3">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Data Type</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><literal>constraint_catalog</literal></entry>
      <entry><literal>sql_identifier</literal></entry>
      <entry>Name of the database containing the constraint (always the current database)</entry>
     </row>

     <row>
      <entry><literal>constraint_schema</literal></entry>
      <entry><literal>sql_identifier</literal></entry>
      <entry>Name of the schema containing the constraint</entry>
     </row>

     <row>
      <entry><literal>constraint_name</literal></entry>
      <entry><literal>sql_identifier</literal></entry>
      <entry>Name of the constraint</entry>
     </row>

     <row>
      <entry><literal>check_clause</literal></entry>
      <entry><literal>character_data</literal></entry>
      <entry>The check expression of the check constraint</entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>

 <sect1 id="infoschema-collations">
  <title><literal>collations</literal></title>

  <para>
   The view <literal>collations</literal> contains the collations
   available in the current database.
  </para>

  <table>
   <title><literal>collations</literal> Columns</title>

   <tgroup cols="3">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Data Type</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><literal>collation_catalog</literal></entry>
      <entry><literal>sql_identifier</literal></entry>
      <entry>Name of the database containing the collation (always the current database)</entry>
     </row>

     <row>
      <entry><literal>collation_schema</literal></entry>
      <entry><literal>sql_identifier</literal></entry>
      <entry>Name of the schema containing the collation</entry>
     </row>

     <row>
      <entry><literal>collation_name</literal></entry>
      <entry><literal>sql_identifier</literal></entry>
      <entry>Name of the default collation</entry>
     </row>

     <row>
      <entry><literal>pad_attribute</literal></entry>
      <entry><literal>character_data</literal></entry>
      <entry>
       Always <literal>NO PAD</literal> (The alternative <literal>PAD
       SPACE</literal> is not supported by PostgreSQL.)
      </entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>

 <sect1 id="infoschema-collation-character-set-applicab"> <!-- max 44 characters -->
  <title><literal>collation_character_set_applicability</literal></title>

  <para>
   The view <literal>collation_character_set_applicability</literal>
   identifies which character set the available collations are
   applicable to.  In PostgreSQL, there is only one character set per
   database (see explanation
   in <xref linkend="infoschema-character-sets">), so this view does
   not provide much useful information.
  </para>

  <table>
   <title><literal>collation_character_set_applicability</literal> Columns</title>

   <tgroup cols="3">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Data Type</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><literal>collation_catalog</literal></entry>
      <entry><literal>sql_identifier</literal></entry>
      <entry>Name of the database containing the collation (always the current database)</entry>
     </row>

     <row>
      <entry><literal>collation_schema</literal></entry>
      <entry><literal>sql_identifier</literal></entry>
      <entry>Name of the schema containing the collation</entry>
     </row>

     <row>
      <entry><literal>collation_name</literal></entry>
      <entry><literal>sql_identifier</literal></entry>
      <entry>Name of the default collation</entry>
     </row>

     <row>
      <entry><literal>character_set_catalog</literal></entry>
      <entry><literal>sql_identifier</literal></entry>
      <entry>Character sets are currently not implemented as schema objects, so this column is null</entry>
     </row>

     <row>
      <entry><literal>character_set_schema</literal></entry>
      <entry><literal>sql_identifier</literal></entry>
      <entry>Character sets are currently not implemented as schema objects, so this column is null</entry>
     </row>

     <row>
      <entry><literal>character_set_name</literal></entry>
      <entry><literal>sql_identifier</literal></entry>
      <entry>Name of the character set</entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>

 <sect1 id="infoschema-column-domain-usage">
  <title><literal>column_domain_usage</literal></title>

  <para>
   The view <literal>column_domain_usage</literal> identifies all
   columns (of a table or a view) that make use of some domain defined
   in the current database and owned by a currently enabled role.
  </para>

  <table>
   <title><literal>column_domain_usage</literal> Columns</title>

   <tgroup cols="3">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Data Type</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><literal>domain_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the database containing the domain (always the current database)</entry>
     </row>

     <row>
      <entry><literal>domain_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the schema containing the domain</entry>
     </row>

     <row>
      <entry><literal>domain_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the domain</entry>
     </row>

     <row>
      <entry><literal>table_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the database containing the table (always the current database)</entry>
     </row>

     <row>
      <entry><literal>table_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the schema containing the table</entry>
     </row>

     <row>
      <entry><literal>table_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the table</entry>
     </row>

     <row>
      <entry><literal>column_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the column</entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>

 <sect1 id="infoschema-column-options">
  <title><literal>column_options</literal></title>

  <para>
   The view <literal>column_options</literal> contains all the
   options defined for foreign table columns in the current database.  Only
   those foreign table columns are shown that the current user has access to
   (by way of being the owner or having some privilege).
  </para>

  <table>
   <title><literal>column_options</literal> Columns</title>

   <tgroup cols="3">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Data Type</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><literal>table_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the database that contains the foreign table (always the current database)</entry>
     </row>

     <row>
      <entry><literal>table_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the schema that contains the foreign table</entry>
     </row>

     <row>
      <entry><literal>table_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the foreign table</entry>
     </row>

     <row>
      <entry><literal>column_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the column</entry>
     </row>

     <row>
      <entry><literal>option_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of an option</entry>
     </row>

     <row>
      <entry><literal>option_value</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>Value of the option</entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>

 <sect1 id="infoschema-column-privileges">
  <title><literal>column_privileges</literal></title>

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

  <para>
   If a privilege has been granted on an entire table, it will show up in
   this view as a grant for each column, but only for the
   privilege types where column granularity is possible:
   <literal>SELECT</literal>, <literal>INSERT</literal>,
   <literal>UPDATE</literal>, <literal>REFERENCES</literal>.
  </para>

  <table>
   <title><literal>column_privileges</literal> Columns</title>

   <tgroup cols="3">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Data Type</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><literal>grantor</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the role that granted the privilege</entry>
     </row>

     <row>
      <entry><literal>grantee</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the role that the privilege was granted to</entry>
     </row>

     <row>
      <entry><literal>table_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the database that contains the table that contains the column (always the current database)</entry>
     </row>

     <row>
      <entry><literal>table_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the schema that contains the table that contains the column</entry>
     </row>

     <row>
      <entry><literal>table_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the table that contains the column</entry>
     </row>

     <row>
      <entry><literal>column_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the column</entry>
     </row>

     <row>
      <entry><literal>privilege_type</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>
       Type of the privilege: <literal>SELECT</literal>,
       <literal>INSERT</literal>, <literal>UPDATE</literal>, or
       <literal>REFERENCES</literal>
      </entry>
     </row>

     <row>
      <entry><literal>is_grantable</literal></entry>
      <entry><type>yes_or_no</type></entry>
      <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>

 <sect1 id="infoschema-column-udt-usage">
  <title><literal>column_udt_usage</literal></title>

  <para>
   The view <literal>column_udt_usage</literal> identifies all columns
   that use data types owned by a currently enabled role.  Note that in
   <productname>PostgreSQL</productname>, built-in data types behave
   like user-defined types, so they are included here as well.  See
   also <xref linkend="infoschema-columns"> for details.
  </para>

  <table>
   <title><literal>column_udt_usage</literal> Columns</title>

   <tgroup cols="3">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Data Type</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><literal>udt_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>
       Name of the database that the column data type (the underlying
       type of the domain, if applicable) is defined in (always the
       current database)
      </entry>
     </row>

     <row>
      <entry><literal>udt_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>
       Name of the schema that the column data type (the underlying
       type of the domain, if applicable) is defined in
      </entry>
     </row>

     <row>
      <entry><literal>udt_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>
       Name of the column data type (the underlying type of the
       domain, if applicable)
      </entry>
     </row>

     <row>
      <entry><literal>table_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the database containing the table (always the current database)</entry>
     </row>

     <row>
      <entry><literal>table_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the schema containing the table</entry>
     </row>

     <row>
      <entry><literal>table_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the table</entry>
     </row>

     <row>
      <entry><literal>column_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the column</entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>

 <sect1 id="infoschema-columns">
  <title><literal>columns</literal></title>

  <para>
   The view <literal>columns</literal> contains information about all
   table columns (or view columns) in the database.  System columns
   (<literal>oid</>, etc.) are not included.  Only those columns are
   shown that the current user has access to (by way of being the
   owner or having some privilege).
  </para>

  <table>
   <title><literal>columns</literal> Columns</title>

   <tgroup cols="3">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Data Type</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><literal>table_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the database containing the table (always the current database)</entry>
     </row>

     <row>
      <entry><literal>table_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the schema containing the table</entry>
     </row>

     <row>
      <entry><literal>table_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the table</entry>
     </row>

     <row>
      <entry><literal>column_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the column</entry>
     </row>

     <row>
      <entry><literal>ordinal_position</literal></entry>
      <entry><type>cardinal_number</type></entry>
      <entry>Ordinal position of the column within the table (count starts at 1)</entry>
     </row>

     <row>
      <entry><literal>column_default</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>Default expression of the column</entry>
     </row>

     <row>
      <entry><literal>is_nullable</literal></entry>
      <entry><type>yes_or_no</type></entry>
      <entry>
       <literal>YES</literal> if the column is possibly nullable,
       <literal>NO</literal> if it is known not nullable.  A not-null
       constraint is one way a column can be known not nullable, but
       there can be others.
      </entry>
     </row>

     <row>
      <entry><literal>data_type</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>
       Data type of the column, if it is a built-in type, or
       <literal>ARRAY</literal> if it is some array (in that case, see
       the view <literal>element_types</literal>), else
       <literal>USER-DEFINED</literal> (in that case, the type is
       identified in <literal>udt_name</literal> and associated
       columns).  If the column is based on a domain, this column
       refers to the type underlying the domain (and the domain is
       identified in <literal>domain_name</literal> and associated
       columns).
      </entry>
     </row>

     <row>
      <entry><literal>character_maximum_length</literal></entry>
      <entry><type>cardinal_number</type></entry>
      <entry>
       If <literal>data_type</literal> identifies a character or bit
       string type, the declared maximum length; null for all other
       data types or if no maximum length was declared.
      </entry>
     </row>

     <row>
      <entry><literal>character_octet_length</literal></entry>
      <entry><type>cardinal_number</type></entry>
      <entry>
       If <literal>data_type</literal> identifies a character type,
       the maximum possible length in octets (bytes) of a datum; null
       for all other data types.  The maximum octet length depends on
       the declared character maximum length (see above) and the
       server encoding.
      </entry>
     </row>

     <row>
      <entry><literal>numeric_precision</literal></entry>
      <entry><type>cardinal_number</type></entry>
      <entry>
       If <literal>data_type</literal> identifies a numeric type, this
       column contains the (declared or implicit) precision of the
       type for this column.  The precision indicates the number of
       significant digits.  It can be expressed in decimal (base 10)
       or binary (base 2) terms, as specified in the column
       <literal>numeric_precision_radix</literal>.  For all other data
       types, this column is null.
      </entry>
     </row>

     <row>
      <entry><literal>numeric_precision_radix</literal></entry>
      <entry><type>cardinal_number</type></entry>
      <entry>
       If <literal>data_type</literal> identifies a numeric type, this
       column indicates in which base the values in the columns
       <literal>numeric_precision</literal> and
       <literal>numeric_scale</literal> are expressed.  The value is
       either 2 or 10.  For all other data types, this column is null.
      </entry>
     </row>

     <row>
      <entry><literal>numeric_scale</literal></entry>
      <entry><type>cardinal_number</type></entry>
      <entry>
       If <literal>data_type</literal> identifies an exact numeric
       type, this column contains the (declared or implicit) scale of
       the type for this column.  The scale indicates the number of
       significant digits to the right of the decimal point.  It can
       be expressed in decimal (base 10) or binary (base 2) terms, as
       specified in the column
       <literal>numeric_precision_radix</literal>.  For all other data
       types, this column is null.
      </entry>
     </row>

     <row>
      <entry><literal>datetime_precision</literal></entry>
      <entry><type>cardinal_number</type></entry>
      <entry>
       If <literal>data_type</literal> identifies a date, time,
       timestamp, or interval type, this column contains the (declared
       or implicit) fractional seconds precision of the type for this
       column, that is, the number of decimal digits maintained
       following the decimal point in the seconds value.  For all
       other data types, this column is null.
      </entry>
     </row>

     <row>
      <entry><literal>interval_type</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>
       If <literal>data_type</literal> identifies an interval type,
       this column contains the specification which fields the
       intervals include for this column, e.g., <literal>YEAR TO
       MONTH</literal>, <literal>DAY TO SECOND</literal>, etc.  If no
       field restrictions were specified (that is, the interval
       accepts all fields), and for all other data types, this field
       is null.
      </entry>
     </row>

     <row>
      <entry><literal>interval_precision</literal></entry>
      <entry><type>cardinal_number</type></entry>
      <entry>
       Applies to a feature not available
       in <productname>PostgreSQL</productname>
       (see <literal>datetime_precision</literal> for the fractional
       seconds precision of interval type columns)
      </entry>
     </row>

     <row>
      <entry><literal>character_set_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>character_set_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>character_set_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>collation_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>
       Name of the database containing the collation of the column
       (always the current database), null if default or the data type
       of the column is not collatable
      </entry>
     </row>

     <row>
      <entry><literal>collation_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>
       Name of the schema containing the collation of the column, null
       if default or the data type of the column is not collatable
      </entry>
     </row>

     <row>
      <entry><literal>collation_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>
       Name of the collation of the column, null if default or the
       data type of the column is not collatable
      </entry>
     </row>

     <row>
      <entry><literal>domain_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>
       If the column has a domain type, the name of the database that
       the domain is defined in (always the current database), else
       null.
      </entry>
     </row>

     <row>
      <entry><literal>domain_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>
       If the column has a domain type, the name of the schema that
       the domain is defined in, else null.
      </entry>
     </row>

     <row>
      <entry><literal>domain_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>If the column has a domain type, the name of the domain, else null.</entry>
     </row>

     <row>
      <entry><literal>udt_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>
       Name of the database that the column data type (the underlying
       type of the domain, if applicable) is defined in (always the
       current database)
      </entry>
     </row>

     <row>
      <entry><literal>udt_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>
       Name of the schema that the column data type (the underlying
       type of the domain, if applicable) is defined in
      </entry>
     </row>

     <row>
      <entry><literal>udt_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>
       Name of the column data type (the underlying type of the
       domain, if applicable)
      </entry>
     </row>

     <row>
      <entry><literal>scope_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>scope_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>scope_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>maximum_cardinality</literal></entry>
      <entry><type>cardinal_number</type></entry>
      <entry>Always null, because arrays always have unlimited maximum cardinality in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>dtd_identifier</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>
       An identifier of the data type descriptor of the column, unique
       among the data type descriptors pertaining to the table.  This
       is mainly useful for joining with other instances of such
       identifiers.  (The specific format of the identifier is not
       defined and not guaranteed to remain the same in future
       versions.)
      </entry>
     </row>

     <row>
      <entry><literal>is_self_referencing</literal></entry>
      <entry><type>yes_or_no</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>is_identity</literal></entry>
      <entry><type>yes_or_no</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>identity_generation</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>identity_start</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>identity_increment</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>identity_maximum</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>identity_minimum</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>identity_cycle</literal></entry>
      <entry><type>yes_or_no</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>is_generated</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>generation_expression</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>is_updatable</literal></entry>
      <entry><type>yes_or_no</type></entry>
      <entry>
       <literal>YES</literal> if the column is updatable,
       <literal>NO</literal> if not (Columns in base tables are always
       updatable, columns in views not necessarily)
      </entry>
     </row>
    </tbody>
   </tgroup>
  </table>

  <para>
   Since data types can be defined in a variety of ways in SQL, and
   <productname>PostgreSQL</productname> contains additional ways to
   define data types, their representation in the information schema
   can be somewhat difficult.  The column <literal>data_type</literal>
   is supposed to identify the underlying built-in type of the column.
   In <productname>PostgreSQL</productname>, this means that the type
   is defined in the system catalog schema
   <literal>pg_catalog</literal>.  This column might be useful if the
   application can handle the well-known built-in types specially (for
   example, format the numeric types differently or use the data in
   the precision columns).  The columns <literal>udt_name</literal>,
   <literal>udt_schema</literal>, and <literal>udt_catalog</literal>
   always identify the underlying data type of the column, even if the
   column is based on a domain.  (Since
   <productname>PostgreSQL</productname> treats built-in types like
   user-defined types, built-in types appear here as well.  This is an
   extension of the SQL standard.)  These columns should be used if an
   application wants to process data differently according to the
   type, because in that case it wouldn't matter if the column is
   really based on a domain.  If the column is based on a domain, the
   identity of the domain is stored in the columns
   <literal>domain_name</literal>, <literal>domain_schema</literal>,
   and <literal>domain_catalog</literal>.  If you want to pair up
   columns with their associated data types and treat domains as
   separate types, you could write <literal>coalesce(domain_name,
   udt_name)</literal>, etc.
  </para>
 </sect1>

 <sect1 id="infoschema-constraint-column-usage">
  <title><literal>constraint_column_usage</literal></title>

  <para>
   The view <literal>constraint_column_usage</literal> identifies all
   columns in the current database that are used by some constraint.
   Only those columns are shown that are contained in a table owned by
   a currently enabled role.  For a check constraint, this view
   identifies the columns that are used in the check expression.  For
   a foreign key constraint, this view identifies the columns that the
   foreign key references.  For a unique or primary key constraint,
   this view identifies the constrained columns.
  </para>

  <table>
   <title><literal>constraint_column_usage</literal> Columns</title>

   <tgroup cols="3">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Data Type</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><literal>table_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>
       Name of the database that contains the table that contains the
       column that is used by some constraint (always the current
       database)
      </entry>
     </row>

     <row>
      <entry><literal>table_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>
       Name of the schema that contains the table that contains the
       column that is used by some constraint
      </entry>
     </row>

     <row>
      <entry><literal>table_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>
       Name of the table that contains the column that is used by some
       constraint
      </entry>
     </row>

     <row>
      <entry><literal>column_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>
       Name of the column that is used by some constraint
      </entry>
     </row>

     <row>
      <entry><literal>constraint_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the database that contains the constraint (always the current database)</entry>
     </row>

     <row>
      <entry><literal>constraint_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the schema that contains the constraint</entry>
     </row>

     <row>
      <entry><literal>constraint_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the constraint</entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>

 <sect1 id="infoschema-constraint-table-usage">
  <title><literal>constraint_table_usage</literal></title>

  <para>
   The view <literal>constraint_table_usage</literal> identifies all
   tables in the current database that are used by some constraint and
   are owned by a currently enabled role.  (This is different from the
   view <literal>table_constraints</literal>, which identifies all
   table constraints along with the table they are defined on.)  For a
   foreign key constraint, this view identifies the table that the
   foreign key references.  For a unique or primary key constraint,
   this view simply identifies the table the constraint belongs to.
   Check constraints and not-null constraints are not included in this
   view.
  </para>

  <table>
   <title><literal>constraint_table_usage</literal> Columns</title>

   <tgroup cols="3">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Data Type</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><literal>table_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>
       Name of the database that contains the table that is used by
       some constraint (always the current database)
      </entry>
     </row>

     <row>
      <entry><literal>table_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>
       Name of the schema that contains the table that is used by some
       constraint
      </entry>
     </row>

     <row>
      <entry><literal>table_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the table that is used by some constraint</entry>
     </row>

     <row>
      <entry><literal>constraint_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the database that contains the constraint (always the current database)</entry>
     </row>

     <row>
      <entry><literal>constraint_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the schema that contains the constraint</entry>
     </row>

     <row>
      <entry><literal>constraint_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the constraint</entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>

 <sect1 id="infoschema-data-type-privileges">
  <title><literal>data_type_privileges</literal></title>

  <para>
   The view <literal>data_type_privileges</literal> identifies all
   data type descriptors that the current user has access to, by way
   of being the owner of the described object or having some privilege
   for it.  A data type descriptor is generated whenever a data type
   is used in the definition of a table column, a domain, or a
   function (as parameter or return type) and stores some information
   about how the data type is used in that instance (for example, the
   declared maximum length, if applicable).  Each data type
   descriptor is assigned an arbitrary identifier that is unique
   among the data type descriptor identifiers assigned for one object
   (table, domain, function).  This view is probably not useful for
   applications, but it is used to define some other views in the
   information schema.
  </para>

  <table>
   <title><literal>data_type_privileges</literal> Columns</title>

   <tgroup cols="3">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Data Type</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><literal>object_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the database that contains the described object (always the current database)</entry>
     </row>

     <row>
      <entry><literal>object_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the schema that contains the described object</entry>
     </row>

     <row>
      <entry><literal>object_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the described object</entry>
     </row>

     <row>
      <entry><literal>object_type</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>
       The type of the described object: one of
       <literal>TABLE</literal> (the data type descriptor pertains to
       a column of that table), <literal>DOMAIN</literal> (the data
       type descriptors pertains to that domain),
       <literal>ROUTINE</literal> (the data type descriptor pertains
       to a parameter or the return data type of that function).
      </entry>
     </row>

     <row>
      <entry><literal>dtd_identifier</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>
       The identifier of the data type descriptor, which is unique
       among the data type descriptors for that same object.
      </entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>

 <sect1 id="infoschema-domain-constraints">
  <title><literal>domain_constraints</literal></title>

  <para>
   The view <literal>domain_constraints</literal> contains all constraints
   belonging to domains defined in the current database.  Only those domains
   are shown that the current user has access to (by way of being the owner or
   having some privilege).
  </para>

  <table>
   <title><literal>domain_constraints</literal> Columns</title>

   <tgroup cols="3">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Data Type</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><literal>constraint_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the database that contains the constraint (always the current database)</entry>
     </row>

     <row>
      <entry><literal>constraint_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the schema that contains the constraint</entry>
     </row>

     <row>
      <entry><literal>constraint_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the constraint</entry>
     </row>

     <row>
      <entry><literal>domain_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the database that contains the domain (always the current database)</entry>
     </row>

     <row>
      <entry><literal>domain_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the schema that contains the domain</entry>
     </row>

     <row>
      <entry><literal>domain_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the domain</entry>
     </row>

     <row>
      <entry><literal>is_deferrable</literal></entry>
      <entry><type>yes_or_no</type></entry>
      <entry><literal>YES</literal> if the constraint is deferrable, <literal>NO</literal> if not</entry>
     </row>

     <row>
      <entry><literal>initially_deferred</literal></entry>
      <entry><type>yes_or_no</type></entry>
      <entry><literal>YES</literal> if the constraint is deferrable and initially deferred, <literal>NO</literal> if not</entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>

 <sect1 id="infoschema-domain-udt-usage">
  <title><literal>domain_udt_usage</literal></title>

  <para>
   The view <literal>domain_udt_usage</literal> identifies all domains
   that are based on data types owned by a currently enabled role.
   Note that in <productname>PostgreSQL</productname>, built-in data
   types behave like user-defined types, so they are included here as
   well.
  </para>

  <table>
   <title><literal>domain_udt_usage</literal> Columns</title>

   <tgroup cols="3">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Data Type</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><literal>udt_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the database that the domain data type is defined in (always the current database)</entry>
     </row>

     <row>
      <entry><literal>udt_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the schema that the domain data type is defined in</entry>
     </row>

     <row>
      <entry><literal>udt_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the domain data type</entry>
     </row>

     <row>
      <entry><literal>domain_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the database that contains the domain (always the current database)</entry>
     </row>

     <row>
      <entry><literal>domain_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the schema that contains the domain</entry>
     </row>

     <row>
      <entry><literal>domain_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the domain</entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>

 <sect1 id="infoschema-domains">
  <title><literal>domains</literal></title>

  <para>
   The view <literal>domains</literal> contains all domains defined in the
   current database.  Only those domains are shown that the current user has
   access to (by way of being the owner or having some privilege).
  </para>

  <table>
   <title><literal>domains</literal> Columns</title>

   <tgroup cols="3">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Data Type</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><literal>domain_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the database that contains the domain (always the current database)</entry>
     </row>

     <row>
      <entry><literal>domain_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the schema that contains the domain</entry>
     </row>

     <row>
      <entry><literal>domain_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the domain</entry>
     </row>

     <row>
      <entry><literal>data_type</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>
       Data type of the domain, if it is a built-in type, or
       <literal>ARRAY</literal> if it is some array (in that case, see
       the view <literal>element_types</literal>), else
       <literal>USER-DEFINED</literal> (in that case, the type is
       identified in <literal>udt_name</literal> and associated
       columns).
      </entry>
     </row>

     <row>
      <entry><literal>character_maximum_length</literal></entry>
      <entry><type>cardinal_number</type></entry>
      <entry>
       If the domain has a character or bit string type, the declared
       maximum length; null for all other data types or if no maximum
       length was declared.
      </entry>
     </row>

     <row>
      <entry><literal>character_octet_length</literal></entry>
      <entry><type>cardinal_number</type></entry>
      <entry>
       If the domain has a character type, the maximum possible length
       in octets (bytes) of a datum; null for all other data types.
       The maximum octet length depends on the declared character
       maximum length (see above) and the server encoding.
      </entry>
     </row>

     <row>
      <entry><literal>character_set_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>character_set_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>character_set_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>collation_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>
       Name of the database containing the collation of the domain
       (always the current database), null if default or the data type
       of the domain is not collatable
      </entry>
     </row>

     <row>
      <entry><literal>collation_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>
       Name of the schema containing the collation of the domain, null
       if default or the data type of the domain is not collatable
      </entry>
     </row>

     <row>
      <entry><literal>collation_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>
       Name of the collation of the domain, null if default or the
       data type of the domain is not collatable
      </entry>
     </row>

     <row>
      <entry><literal>numeric_precision</literal></entry>
      <entry><type>cardinal_number</type></entry>
      <entry>
       If the domain has a numeric type, this column contains the
       (declared or implicit) precision of the type for this domain.
       The precision indicates the number of significant digits.  It
       can be expressed in decimal (base 10) or binary (base 2) terms,
       as specified in the column
       <literal>numeric_precision_radix</literal>.  For all other data
       types, this column is null.
      </entry>
     </row>

     <row>
      <entry><literal>numeric_precision_radix</literal></entry>
      <entry><type>cardinal_number</type></entry>
      <entry>
       If the domain has a numeric type, this column indicates in
       which base the values in the columns
       <literal>numeric_precision</literal> and
       <literal>numeric_scale</literal> are expressed.  The value is
       either 2 or 10.  For all other data types, this column is null.
      </entry>
     </row>

     <row>
      <entry><literal>numeric_scale</literal></entry>
      <entry><type>cardinal_number</type></entry>
      <entry>
       If the domain has an exact numeric type, this column contains
       the (declared or implicit) scale of the type for this domain.
       The scale indicates the number of significant digits to the
       right of the decimal point.  It can be expressed in decimal
       (base 10) or binary (base 2) terms, as specified in the column
       <literal>numeric_precision_radix</literal>.  For all other data
       types, this column is null.
      </entry>
     </row>

     <row>
      <entry><literal>datetime_precision</literal></entry>
      <entry><type>cardinal_number</type></entry>
      <entry>
       If <literal>data_type</literal> identifies a date, time,
       timestamp, or interval type, this column contains the (declared
       or implicit) fractional seconds precision of the type for this
       domain, that is, the number of decimal digits maintained
       following the decimal point in the seconds value.  For all
       other data types, this column is null.
      </entry>
     </row>

     <row>
      <entry><literal>interval_type</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>
       If <literal>data_type</literal> identifies an interval type,
       this column contains the specification which fields the
       intervals include for this domain, e.g., <literal>YEAR TO
       MONTH</literal>, <literal>DAY TO SECOND</literal>, etc.  If no
       field restrictions were specified (that is, the interval
       accepts all fields), and for all other data types, this field
       is null.
      </entry>
     </row>

     <row>
      <entry><literal>interval_precision</literal></entry>
      <entry><type>cardinal_number</type></entry>
      <entry>
       Applies to a feature not available
       in <productname>PostgreSQL</productname>
       (see <literal>datetime_precision</literal> for the fractional
       seconds precision of interval type domains)
      </entry>
     </row>

     <row>
      <entry><literal>domain_default</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>Default expression of the domain</entry>
     </row>

     <row>
      <entry><literal>udt_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the database that the domain data type is defined in (always the current database)</entry>
     </row>

     <row>
      <entry><literal>udt_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the schema that the domain data type is defined in</entry>
     </row>

     <row>
      <entry><literal>udt_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the domain data type</entry>
     </row>

     <row>
      <entry><literal>scope_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>scope_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>scope_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>maximum_cardinality</literal></entry>
      <entry><type>cardinal_number</type></entry>
      <entry>Always null, because arrays always have unlimited maximum cardinality in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>dtd_identifier</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>
       An identifier of the data type descriptor of the domain, unique
       among the data type descriptors pertaining to the domain (which
       is trivial, because a domain only contains one data type
       descriptor).  This is mainly useful for joining with other
       instances of such identifiers.  (The specific format of the
       identifier is not defined and not guaranteed to remain the same
       in future versions.)
      </entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>

 <sect1 id="infoschema-element-types">
  <title><literal>element_types</literal></title>

  <para>
   The view <literal>element_types</literal> contains the data type
   descriptors of the elements of arrays.  When a table column, composite-type attribute,
   domain, function parameter, or function return value is defined to
   be of an array type, the respective information schema view only
   contains <literal>ARRAY</literal> in the column
   <literal>data_type</literal>.  To obtain information on the element
   type of the array, you can join the respective view with this view.
   For example, to show the columns of a table with data types and
   array element types, if applicable, you could do:
<programlisting>
SELECT c.column_name, c.data_type, e.data_type AS element_type
FROM information_schema.columns c LEFT JOIN information_schema.element_types e
     ON ((c.table_catalog, c.table_schema, c.table_name, 'TABLE', c.dtd_identifier)
       = (e.object_catalog, e.object_schema, e.object_name, e.object_type, e.collection_type_identifier))
WHERE c.table_schema = '...' AND c.table_name = '...'
ORDER BY c.ordinal_position;
</programlisting>
   This view only includes objects that the current user has access
   to, by way of being the owner or having some privilege.
  </para>

  <table>
   <title><literal>element_types</literal> Columns</title>

   <tgroup cols="3">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Data Type</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><literal>object_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>
       Name of the database that contains the object that uses the
       array being described (always the current database)
      </entry>
     </row>

     <row>
      <entry><literal>object_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>
       Name of the schema that contains the object that uses the array
       being described
      </entry>
     </row>

     <row>
      <entry><literal>object_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>
       Name of the object that uses the array being described
      </entry>
     </row>

     <row>
      <entry><literal>object_type</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>
       The type of the object that uses the array being described: one
       of <literal>TABLE</literal> (the array is used by a column of
       that table), <literal>USER-DEFINED TYPE</literal> (the array is
       used by an attribute of that composite type),
       <literal>DOMAIN</literal> (the array is used by that domain),
       <literal>ROUTINE</literal> (the array is used by a parameter or
       the return data type of that function).
      </entry>
     </row>

     <row>
      <entry><literal>collection_type_identifier</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>
       The identifier of the data type descriptor of the array being
       described.  Use this to join with the
       <literal>dtd_identifier</literal> columns of other information
       schema views.
      </entry>
     </row>

     <row>
      <entry><literal>data_type</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>
       Data type of the array elements, if it is a built-in type, else
       <literal>USER-DEFINED</literal> (in that case, the type is
       identified in <literal>udt_name</literal> and associated
       columns).
      </entry>
     </row>

     <row>
      <entry><literal>character_maximum_length</literal></entry>
      <entry><type>cardinal_number</type></entry>
      <entry>Always null, since this information is not applied to array element data types in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>character_octet_length</literal></entry>
      <entry><type>cardinal_number</type></entry>
      <entry>Always null, since this information is not applied to array element data types in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>character_set_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>character_set_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>character_set_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>collation_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>
       Name of the database containing the collation of the element
       type (always the current database), null if default or the data
       type of the element is not collatable
      </entry>
     </row>

     <row>
      <entry><literal>collation_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>
       Name of the schema containing the collation of the element
       type, null if default or the data type of the element is not
       collatable
      </entry>
     </row>

     <row>
      <entry><literal>collation_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>
       Name of the collation of the element type, null if default or
       the data type of the element is not collatable
      </entry>
     </row>

     <row>
      <entry><literal>numeric_precision</literal></entry>
      <entry><type>cardinal_number</type></entry>
      <entry>Always null, since this information is not applied to array element data types in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>numeric_precision_radix</literal></entry>
      <entry><type>cardinal_number</type></entry>
      <entry>Always null, since this information is not applied to array element data types in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>numeric_scale</literal></entry>
      <entry><type>cardinal_number</type></entry>
      <entry>Always null, since this information is not applied to array element data types in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>datetime_precision</literal></entry>
      <entry><type>cardinal_number</type></entry>
      <entry>Always null, since this information is not applied to array element data types in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>interval_type</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>Always null, since this information is not applied to array element data types in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>interval_precision</literal></entry>
      <entry><type>cardinal_number</type></entry>
      <entry>Always null, since this information is not applied to array element data types in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>domain_default</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>Not yet implemented</entry>
     </row>

     <row>
      <entry><literal>udt_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>
       Name of the database that the data type of the elements is
       defined in (always the current database)
      </entry>
     </row>

     <row>
      <entry><literal>udt_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>
       Name of the schema that the data type of the elements is
       defined in
      </entry>
     </row>

     <row>
      <entry><literal>udt_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>
       Name of the data type of the elements
      </entry>
     </row>

     <row>
      <entry><literal>scope_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>scope_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>scope_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>maximum_cardinality</literal></entry>
      <entry><type>cardinal_number</type></entry>
      <entry>Always null, because arrays always have unlimited maximum cardinality in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>dtd_identifier</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>
       An identifier of the data type descriptor of the element.  This
       is currently not useful.
      </entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>

 <sect1 id="infoschema-enabled-roles">
  <title><literal>enabled_roles</literal></title>

  <para>
   The view <literal>enabled_roles</literal> identifies the currently
   <quote>enabled roles</quote>.  The enabled roles are recursively
   defined as the current user together with all roles that have been
   granted to the enabled roles with automatic inheritance.  In other
   words, these are all roles that the current user has direct or
   indirect, automatically inheriting membership in.
   <indexterm><primary>enabled role</primary></indexterm>
   <indexterm><primary>role</primary><secondary>enabled</secondary></indexterm>
  </para>

  <para>
   For permission checking, the set of <quote>applicable roles</quote>
   is applied, which can be broader than the set of enabled roles.  So
   generally, it is better to use the view
   <literal>applicable_roles</literal> instead of this one; see also
   there.
  </para>

  <table>
   <title><literal>enabled_roles</literal> Columns</title>

   <tgroup cols="3">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Data Type</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><literal>role_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of a role</entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>

 <sect1 id="infoschema-foreign-data-wrapper-options">
  <title><literal>foreign_data_wrapper_options</literal></title>

  <para>
   The view <literal>foreign_data_wrapper_options</literal> contains
   all the options defined for foreign-data wrappers in the current
   database.  Only those foreign-data wrappers are shown that the
   current user has access to (by way of being the owner or having
   some privilege).
  </para>

  <table>
   <title><literal>foreign_data_wrapper_options</literal> Columns</title>

   <tgroup cols="3">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Data Type</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><literal>foreign_data_wrapper_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the database that the foreign-data wrapper is defined in (always the current database)</entry>
     </row>

     <row>
      <entry><literal>foreign_data_wrapper_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the foreign-data wrapper</entry>
     </row>

     <row>
      <entry><literal>option_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of an option</entry>
     </row>

     <row>
      <entry><literal>option_value</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>Value of the option</entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>

 <sect1 id="infoschema-foreign-data-wrappers">
  <title><literal>foreign_data_wrappers</literal></title>

  <para>
   The view <literal>foreign_data_wrappers</literal> contains all
   foreign-data wrappers defined in the current database.  Only those
   foreign-data wrappers are shown that the current user has access to
   (by way of being the owner or having some privilege).
  </para>

  <table>
   <title><literal>foreign_data_wrappers</literal> Columns</title>

   <tgroup cols="3">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Data Type</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><literal>foreign_data_wrapper_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the database that contains the foreign-data
      wrapper (always the current database)</entry>
     </row>

     <row>
      <entry><literal>foreign_data_wrapper_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the foreign-data wrapper</entry>
     </row>

     <row>
      <entry><literal>authorization_identifier</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the owner of the foreign server</entry>
     </row>

     <row>
      <entry><literal>library_name</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>File name of the library that implementing this foreign-data wrapper</entry>
     </row>

     <row>
      <entry><literal>foreign_data_wrapper_language</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>Language used to implement this foreign-data wrapper</entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>

 <sect1 id="infoschema-foreign-server-options">
  <title><literal>foreign_server_options</literal></title>

  <para>
   The view <literal>foreign_server_options</literal> contains all the
   options defined for foreign servers in the current database.  Only
   those foreign servers are shown that the current user has access to
   (by way of being the owner or having some privilege).
  </para>

  <table>
   <title><literal>foreign_server_options</literal> Columns</title>

   <tgroup cols="3">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Data Type</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><literal>foreign_server_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the database that the foreign server is defined in (always the current database)</entry>
     </row>

     <row>
      <entry><literal>foreign_server_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the foreign server</entry>
     </row>

     <row>
      <entry><literal>option_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of an option</entry>
     </row>

     <row>
      <entry><literal>option_value</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>Value of the option</entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>

 <sect1 id="infoschema-foreign-servers">
  <title><literal>foreign_servers</literal></title>

  <para>
   The view <literal>foreign_servers</literal> contains all foreign
   servers defined in the current database.  Only those foreign
   servers are shown that the current user has access to (by way of
   being the owner or having some privilege).
  </para>

  <table>
   <title><literal>foreign_servers</literal> Columns</title>

   <tgroup cols="3">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Data Type</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><literal>foreign_server_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the database that the foreign server is defined in (always the current database)</entry>
     </row>

     <row>
      <entry><literal>foreign_server_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the foreign server</entry>
     </row>

     <row>
      <entry><literal>foreign_data_wrapper_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the database that contains the foreign-data
      wrapper used by the foreign server (always the current database)</entry>
     </row>

     <row>
      <entry><literal>foreign_data_wrapper_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the foreign-data wrapper used by the foreign server</entry>
     </row>

     <row>
      <entry><literal>foreign_server_type</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>Foreign server type information, if specified upon creation</entry>
     </row>

     <row>
      <entry><literal>foreign_server_version</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>Foreign server version information, if specified upon creation</entry>
     </row>

     <row>
      <entry><literal>authorization_identifier</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the owner of the foreign server</entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>

 <sect1 id="infoschema-foreign-table-options">
  <title><literal>foreign_table_options</literal></title>

  <para>
   The view <literal>foreign_table_options</literal> contains all the
   options defined for foreign tables in the current database.  Only
   those foreign tables are shown that the current user has access to
   (by way of being the owner or having some privilege).
  </para>

  <table>
   <title><literal>foreign_table_options</literal> Columns</title>

   <tgroup cols="3">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Data Type</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><literal>foreign_table_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the database that contains the foreign table (always the current database)</entry>
     </row>

     <row>
      <entry><literal>foreign_table_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the schema that contains the foreign table</entry>
     </row>

     <row>
      <entry><literal>foreign_table_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the foreign table</entry>
     </row>

     <row>
      <entry><literal>option_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of an option</entry>
     </row>

     <row>
      <entry><literal>option_value</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>Value of the option</entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>

 <sect1 id="infoschema-foreign-tables">
  <title><literal>foreign_tables</literal></title>

  <para>
   The view <literal>foreign_tables</literal> contains all foreign
   tables defined in the current database.  Only those foreign
   tables are shown that the current user has access to (by way of
   being the owner or having some privilege).
  </para>

  <table>
   <title><literal>foreign_tables</literal> Columns</title>

   <tgroup cols="3">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Data Type</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><literal>foreign_table_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the database that the foreign table is defined in (always the current database)</entry>
     </row>

     <row>
      <entry><literal>foreign_table_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the schema that contains the foreign table</entry>
     </row>

     <row>
      <entry><literal>foreign_table_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the foreign table</entry>
     </row>

     <row>
      <entry><literal>foreign_server_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the database that the foreign server is defined in (always the current database)</entry>
     </row>

     <row>
      <entry><literal>foreign_server_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the foreign server</entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>

 <sect1 id="infoschema-key-column-usage">
  <title><literal>key_column_usage</literal></title>

  <para>
   The view <literal>key_column_usage</literal> identifies all columns
   in the current database that are restricted by some unique, primary
   key, or foreign key constraint.  Check constraints are not included
   in this view.  Only those columns are shown that the current user
   has access to, by way of being the owner or having some privilege.
  </para>

  <table>
   <title><literal>key_column_usage</literal> Columns</title>

   <tgroup cols="3">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Data Type</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><literal>constraint_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the database that contains the constraint (always the current database)</entry>
     </row>

     <row>
      <entry><literal>constraint_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the schema that contains the constraint</entry>
     </row>

     <row>
      <entry><literal>constraint_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the constraint</entry>
     </row>

     <row>
      <entry><literal>table_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>
       Name of the database that contains the table that contains the
       column that is restricted by this constraint (always the
       current database)
      </entry>
     </row>

     <row>
      <entry><literal>table_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>
       Name of the schema that contains the table that contains the
       column that is restricted by this constraint
      </entry>
     </row>

     <row>
      <entry><literal>table_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>
       Name of the table that contains the column that is restricted
       by this constraint
      </entry>
     </row>

     <row>
      <entry><literal>column_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>
       Name of the column that is restricted by this constraint
      </entry>
     </row>

     <row>
      <entry><literal>ordinal_position</literal></entry>
      <entry><type>cardinal_number</type></entry>
      <entry>
       Ordinal position of the column within the constraint key (count
       starts at 1)
      </entry>
     </row>

     <row>
      <entry><literal>position_in_unique_constraint</literal></entry>
      <entry><type>cardinal_number</type></entry>
      <entry>
       For a foreign-key constraint, ordinal position of the referenced
       column within its unique constraint (count starts at 1);
       otherwise null
      </entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>

 <sect1 id="infoschema-parameters">
  <title><literal>parameters</literal></title>

  <para>
   The view <literal>parameters</literal> contains information about
   the parameters (arguments) of all functions in the current database.
   Only those functions are shown that the current user has access to
   (by way of being the owner or having some privilege).
  </para>

  <table>
   <title><literal>parameters</literal> Columns</title>

   <tgroup cols="3">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Data Type</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><literal>specific_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the database containing the function (always the current database)</entry>
     </row>

     <row>
      <entry><literal>specific_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the schema containing the function</entry>
     </row>

     <row>
      <entry><literal>specific_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>
       The <quote>specific name</quote> of the function.  See <xref
       linkend="infoschema-routines"> for more information.
      </entry>
     </row>

     <row>
      <entry><literal>ordinal_position</literal></entry>
      <entry><type>cardinal_number</type></entry>
      <entry>
       Ordinal position of the parameter in the argument list of the
       function (count starts at 1)
      </entry>
     </row>

     <row>
      <entry><literal>parameter_mode</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>
       <literal>IN</literal> for input parameter,
       <literal>OUT</literal> for output parameter,
       and <literal>INOUT</literal> for input/output parameter.
      </entry>
     </row>

     <row>
      <entry><literal>is_result</literal></entry>
      <entry><type>yes_or_no</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>as_locator</literal></entry>
      <entry><type>yes_or_no</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>parameter_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the parameter, or null if the parameter has no name</entry>
     </row>

     <row>
      <entry><literal>data_type</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>
       Data type of the parameter, if it is a built-in type, or
       <literal>ARRAY</literal> if it is some array (in that case, see
       the view <literal>element_types</literal>), else
       <literal>USER-DEFINED</literal> (in that case, the type is
       identified in <literal>udt_name</literal> and associated
       columns).
      </entry>
     </row>

     <row>
      <entry><literal>character_maximum_length</literal></entry>
      <entry><type>cardinal_number</type></entry>
      <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>character_octet_length</literal></entry>
      <entry><type>cardinal_number</type></entry>
      <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>character_set_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>character_set_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>character_set_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>collation_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>collation_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>collation_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>numeric_precision</literal></entry>
      <entry><type>cardinal_number</type></entry>
      <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>numeric_precision_radix</literal></entry>
      <entry><type>cardinal_number</type></entry>
      <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>numeric_scale</literal></entry>
      <entry><type>cardinal_number</type></entry>
      <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>datetime_precision</literal></entry>
      <entry><type>cardinal_number</type></entry>
      <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>interval_type</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>interval_precision</literal></entry>
      <entry><type>cardinal_number</type></entry>
      <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>udt_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>
       Name of the database that the data type of the parameter is
       defined in (always the current database)
      </entry>
     </row>

     <row>
      <entry><literal>udt_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>
       Name of the schema that the data type of the parameter is
       defined in
      </entry>
     </row>

     <row>
      <entry><literal>udt_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>
       Name of the data type of the parameter
      </entry>
     </row>

     <row>
      <entry><literal>scope_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>scope_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>scope_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>maximum_cardinality</literal></entry>
      <entry><type>cardinal_number</type></entry>
      <entry>Always null, because arrays always have unlimited maximum cardinality in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>dtd_identifier</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>
       An identifier of the data type descriptor of the parameter,
       unique among the data type descriptors pertaining to the
       function.  This is mainly useful for joining with other
       instances of such identifiers.  (The specific format of the
       identifier is not defined and not guaranteed to remain the same
       in future versions.)
      </entry>
     </row>

     <row>
      <entry><literal>parameter_default</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>
       The default expression of the parameter, or null if none or if the
       function is not owned by a currently enabled role.
      </entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>

 <sect1 id="infoschema-referential-constraints">
  <title><literal>referential_constraints</literal></title>

  <para>
   The view <literal>referential_constraints</literal> contains all
   referential (foreign key) constraints in the current database.
   Only those constraints are shown for which the current user has
   write access to the referencing table (by way of being the
   owner or having some privilege other than <literal>SELECT</literal>).
  </para>

  <table>
   <title><literal>referential_constraints</literal> Columns</title>

   <tgroup cols="3">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Data Type</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><literal>constraint_catalog</literal></entry>
      <entry><literal>sql_identifier</literal></entry>
      <entry>Name of the database containing the constraint (always the current database)</entry>
     </row>

     <row>
      <entry><literal>constraint_schema</literal></entry>
      <entry><literal>sql_identifier</literal></entry>
      <entry>Name of the schema containing the constraint</entry>
     </row>

     <row>
      <entry><literal>constraint_name</literal></entry>
      <entry><literal>sql_identifier</literal></entry>
      <entry>Name of the constraint</entry>
     </row>

     <row>
      <entry><literal>unique_constraint_catalog</literal></entry>
      <entry><literal>sql_identifier</literal></entry>
      <entry>
       Name of the database that contains the unique or primary key
       constraint that the foreign key constraint references (always
       the current database)
      </entry>
     </row>

     <row>
      <entry><literal>unique_constraint_schema</literal></entry>
      <entry><literal>sql_identifier</literal></entry>
      <entry>
       Name of the schema that contains the unique or primary key
       constraint that the foreign key constraint references
      </entry>
     </row>

     <row>
      <entry><literal>unique_constraint_name</literal></entry>
      <entry><literal>sql_identifier</literal></entry>
      <entry>
       Name of the unique or primary key constraint that the foreign
       key constraint references
      </entry>
     </row>

     <row>
      <entry><literal>match_option</literal></entry>
      <entry><literal>character_data</literal></entry>
      <entry>
       Match option of the foreign key constraint:
       <literal>FULL</literal>, <literal>PARTIAL</literal>, or
       <literal>NONE</literal>.
      </entry>
     </row>

     <row>
      <entry><literal>update_rule</literal></entry>
      <entry><literal>character_data</literal></entry>
      <entry>
       Update rule of the foreign key constraint:
       <literal>CASCADE</literal>, <literal>SET NULL</literal>,
       <literal>SET DEFAULT</literal>, <literal>RESTRICT</literal>, or
       <literal>NO ACTION</literal>.
      </entry>
     </row>

     <row>
      <entry><literal>delete_rule</literal></entry>
      <entry><literal>character_data</literal></entry>
      <entry>
       Delete rule of the foreign key constraint:
       <literal>CASCADE</literal>, <literal>SET NULL</literal>,
       <literal>SET DEFAULT</literal>, <literal>RESTRICT</literal>, or
       <literal>NO ACTION</literal>.
      </entry>
     </row>
    </tbody>
   </tgroup>
  </table>

 </sect1>

 <sect1 id="infoschema-role-column-grants">
  <title><literal>role_column_grants</literal></title>

  <para>
   The view <literal>role_column_grants</literal> identifies all
   privileges granted on columns where the grantor or grantee is a
   currently enabled role.  Further information can be found under
   <literal>column_privileges</literal>.  The only effective
   difference between this view
   and <literal>column_privileges</literal> is that this view omits
   columns that have been made accessible to the current user by way
   of a grant to <literal>PUBLIC</literal>.
  </para>

  <table>
   <title><literal>role_column_grants</literal> Columns</title>

   <tgroup cols="3">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Data Type</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><literal>grantor</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the role that granted the privilege</entry>
     </row>

     <row>
      <entry><literal>grantee</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the role that the privilege was granted to</entry>
     </row>

     <row>
      <entry><literal>table_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the database that contains the table that contains the column (always the current database)</entry>
     </row>

     <row>
      <entry><literal>table_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the schema that contains the table that contains the column</entry>
     </row>

     <row>
      <entry><literal>table_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the table that contains the column</entry>
     </row>

     <row>
      <entry><literal>column_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the column</entry>
     </row>

     <row>
      <entry><literal>privilege_type</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>
       Type of the privilege: <literal>SELECT</literal>,
       <literal>INSERT</literal>, <literal>UPDATE</literal>, or
       <literal>REFERENCES</literal>
      </entry>
     </row>

     <row>
      <entry><literal>is_grantable</literal></entry>
      <entry><type>yes_or_no</type></entry>
      <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>

 <sect1 id="infoschema-role-routine-grants">
  <title><literal>role_routine_grants</literal></title>

  <para>
   The view <literal>role_routine_grants</literal> identifies all
   privileges granted on functions where the grantor or grantee is a
   currently enabled role.  Further information can be found under
   <literal>routine_privileges</literal>.  The only effective
   difference between this view
   and <literal>routine_privileges</literal> is that this view omits
   functions that have been made accessible to the current user by way
   of a grant to <literal>PUBLIC</literal>.
  </para>

  <table>
   <title><literal>role_routine_grants</literal> Columns</title>

   <tgroup cols="3">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Data Type</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><literal>grantor</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the role that granted the privilege</entry>
     </row>

     <row>
      <entry><literal>grantee</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the role that the privilege was granted to</entry>
     </row>

     <row>
      <entry><literal>specific_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the database containing the function (always the current database)</entry>
     </row>

     <row>
      <entry><literal>specific_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the schema containing the function</entry>
     </row>

     <row>
      <entry><literal>specific_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>
       The <quote>specific name</quote> of the function.  See <xref
       linkend="infoschema-routines"> for more information.
      </entry>
     </row>

     <row>
      <entry><literal>routine_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the database containing the function (always the current database)</entry>
     </row>

     <row>
      <entry><literal>routine_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the schema containing the function</entry>
     </row>

     <row>
      <entry><literal>routine_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the function (might be duplicated in case of overloading)</entry>
     </row>

     <row>
      <entry><literal>privilege_type</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>Always <literal>EXECUTE</literal> (the only privilege type for functions)</entry>
     </row>

     <row>
      <entry><literal>is_grantable</literal></entry>
      <entry><type>yes_or_no</type></entry>
      <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>

 <sect1 id="infoschema-role-table-grants">
  <title><literal>role_table_grants</literal></title>

  <para>
   The view <literal>role_table_grants</literal> identifies all
   privileges granted on tables or views where the grantor or grantee
   is a currently enabled role.  Further information can be found
   under <literal>table_privileges</literal>.  The only effective
   difference between this view
   and <literal>table_privileges</literal> is that this view omits
   tables that have been made accessible to the current user by way of
   a grant to <literal>PUBLIC</literal>.
  </para>

  <table>
   <title><literal>role_table_grants</literal> Columns</title>

   <tgroup cols="3">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Data Type</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><literal>grantor</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the role that granted the privilege</entry>
     </row>

     <row>
      <entry><literal>grantee</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the role that the privilege was granted to</entry>
     </row>

     <row>
      <entry><literal>table_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the database that contains the table (always the current database)</entry>
     </row>

     <row>
      <entry><literal>table_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the schema that contains the table</entry>
     </row>

     <row>
      <entry><literal>table_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the table</entry>
     </row>

     <row>
      <entry><literal>privilege_type</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>
       Type of the privilege: <literal>SELECT</literal>,
       <literal>INSERT</literal>, <literal>UPDATE</literal>,
       <literal>DELETE</literal>, <literal>TRUNCATE</literal>,
       <literal>REFERENCES</literal>, or <literal>TRIGGER</literal>
      </entry>
     </row>

     <row>
      <entry><literal>is_grantable</literal></entry>
      <entry><type>yes_or_no</type></entry>
      <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
     </row>

     <row>
      <entry><literal>with_hierarchy</literal></entry>
      <entry><type>yes_or_no</type></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>
    </tbody>
   </tgroup>
  </table>
 </sect1>

 <sect1 id="infoschema-role-udt-grants">
  <title><literal>role_udt_grants</literal></title>

  <para>
   The view <literal>role_udt_grants</literal> is intended to identify
   <literal>USAGE</literal> privileges granted on user-defined types
   where the grantor or grantee is a currently enabled role.  Further
   information can be found under
   <literal>udt_privileges</literal>.  The only effective difference
   between this view and <literal>udt_privileges</literal> is that
   this view omits objects that have been made accessible to the
   current user by way of a grant to <literal>PUBLIC</literal>.  Since
   data types do not have real privileges in PostgreSQL, but only an
   implicit grant to <literal>PUBLIC</literal>, this view is empty.
  </para>

  <table>
   <title><literal>role_udt_grants</literal> Columns</title>

   <tgroup cols="3">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Data Type</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><literal>grantor</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>The name of the role that granted the privilege</entry>
     </row>

     <row>
      <entry><literal>grantee</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>The name of the role that the privilege was granted to</entry>
     </row>

     <row>
      <entry><literal>udt_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the database containing the type (always the current database)</entry>
     </row>

     <row>
      <entry><literal>udt_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the schema containing the type</entry>
     </row>

     <row>
      <entry><literal>udt_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the type</entry>
     </row>

     <row>
      <entry><literal>privilege_type</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>Always <literal>TYPE USAGE</literal></entry>
     </row>

     <row>
      <entry><literal>is_grantable</literal></entry>
      <entry><type>yes_or_no</type></entry>
      <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>

 <sect1 id="infoschema-role-usage-grants">
  <title><literal>role_usage_grants</literal></title>

  <para>
   The view <literal>role_usage_grants</literal> identifies
   <literal>USAGE</literal> privileges granted on various kinds of
   objects where the grantor or grantee is a currently enabled role.
   Further information can be found under
   <literal>usage_privileges</literal>.  The only effective difference
   between this view and <literal>usage_privileges</literal> is that
   this view omits objects that have been made accessible to the
   current user by way of a grant to <literal>PUBLIC</literal>.
  </para>

  <table>
   <title><literal>role_usage_grants</literal> Columns</title>

   <tgroup cols="3">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Data Type</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><literal>grantor</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>The name of the role that granted the privilege</entry>
     </row>

     <row>
      <entry><literal>grantee</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>The name of the role that the privilege was granted to</entry>
     </row>

     <row>
      <entry><literal>object_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the database containing the object (always the current database)</entry>
     </row>

     <row>
      <entry><literal>object_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the schema containing the object, if applicable,
      else an empty string</entry>
     </row>

     <row>
      <entry><literal>object_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the object</entry>
     </row>

     <row>
      <entry><literal>object_type</literal></entry>
      <entry><type>character_data</type></entry>
      <entry><literal>COLLATION</literal> or <literal>DOMAIN</literal> or <literal>FOREIGN DATA WRAPPER</literal> or <literal>FOREIGN SERVER</literal> or <literal>SEQUENCE</literal></entry>
     </row>

     <row>
      <entry><literal>privilege_type</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>Always <literal>USAGE</literal></entry>
     </row>

     <row>
      <entry><literal>is_grantable</literal></entry>
      <entry><type>yes_or_no</type></entry>
      <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>

 <sect1 id="infoschema-routine-privileges">
  <title><literal>routine_privileges</literal></title>

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

  <table>
   <title><literal>routine_privileges</literal> Columns</title>

   <tgroup cols="3">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Data Type</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><literal>grantor</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the role that granted the privilege</entry>
     </row>

     <row>
      <entry><literal>grantee</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the role that the privilege was granted to</entry>
     </row>

     <row>
      <entry><literal>specific_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the database containing the function (always the current database)</entry>
     </row>

     <row>
      <entry><literal>specific_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the schema containing the function</entry>
     </row>

     <row>
      <entry><literal>specific_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>
       The <quote>specific name</quote> of the function.  See <xref
       linkend="infoschema-routines"> for more information.
      </entry>
     </row>

     <row>
      <entry><literal>routine_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the database containing the function (always the current database)</entry>
     </row>

     <row>
      <entry><literal>routine_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the schema containing the function</entry>
     </row>

     <row>
      <entry><literal>routine_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the function (might be duplicated in case of overloading)</entry>
     </row>

     <row>
      <entry><literal>privilege_type</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>Always <literal>EXECUTE</literal> (the only privilege type for functions)</entry>
     </row>

     <row>
      <entry><literal>is_grantable</literal></entry>
      <entry><type>yes_or_no</type></entry>
      <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>

 <sect1 id="infoschema-routines">
  <title><literal>routines</literal></title>

  <para>
   The view <literal>routines</literal> contains all functions in the
   current database.  Only those functions are shown that the current
   user has access to (by way of being the owner or having some
   privilege).
  </para>

  <table>
   <title><literal>routines</literal> Columns</title>

   <tgroup cols="3">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Data Type</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><literal>specific_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the database containing the function (always the current database)</entry>
     </row>

     <row>
      <entry><literal>specific_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the schema containing the function</entry>
     </row>

     <row>
      <entry><literal>specific_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>
       The <quote>specific name</quote> of the function.  This is a
       name that uniquely identifies the function in the schema, even
       if the real name of the function is overloaded.  The format of
       the specific name is not defined, it should only be used to
       compare it to other instances of specific routine names.
      </entry>
     </row>

     <row>
      <entry><literal>routine_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the database containing the function (always the current database)</entry>
     </row>

     <row>
      <entry><literal>routine_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the schema containing the function</entry>
     </row>

     <row>
      <entry><literal>routine_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the function (might be duplicated in case of overloading)</entry>
     </row>

     <row>
      <entry><literal>routine_type</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>
       Always <literal>FUNCTION</literal> (In the future there might
       be other types of routines.)
      </entry>
     </row>

     <row>
      <entry><literal>module_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>module_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>module_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>udt_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>udt_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>udt_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>data_type</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>
       Return data type of the function, if it is a built-in type, or
       <literal>ARRAY</literal> if it is some array (in that case, see
       the view <literal>element_types</literal>), else
       <literal>USER-DEFINED</literal> (in that case, the type is
       identified in <literal>type_udt_name</literal> and associated
       columns).
      </entry>
     </row>

     <row>
      <entry><literal>character_maximum_length</literal></entry>
      <entry><type>cardinal_number</type></entry>
      <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>character_octet_length</literal></entry>
      <entry><type>cardinal_number</type></entry>
      <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>character_set_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>character_set_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>character_set_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>collation_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>collation_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>collation_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>numeric_precision</literal></entry>
      <entry><type>cardinal_number</type></entry>
      <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>numeric_precision_radix</literal></entry>
      <entry><type>cardinal_number</type></entry>
      <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>numeric_scale</literal></entry>
      <entry><type>cardinal_number</type></entry>
      <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>datetime_precision</literal></entry>
      <entry><type>cardinal_number</type></entry>
      <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>interval_type</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>interval_precision</literal></entry>
      <entry><type>cardinal_number</type></entry>
      <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>type_udt_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>
       Name of the database that the return data type of the function
       is defined in (always the current database)
      </entry>
     </row>

     <row>
      <entry><literal>type_udt_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>
       Name of the schema that the return data type of the function is
       defined in
      </entry>
     </row>

     <row>
      <entry><literal>type_udt_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>
       Name of the return data type of the function
      </entry>
     </row>

     <row>
      <entry><literal>scope_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>scope_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>scope_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>maximum_cardinality</literal></entry>
      <entry><type>cardinal_number</type></entry>
      <entry>Always null, because arrays always have unlimited maximum cardinality in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>dtd_identifier</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>
       An identifier of the data type descriptor of the return data
       type of this function, unique among the data type descriptors
       pertaining to the function.  This is mainly useful for joining
       with other instances of such identifiers.  (The specific format
       of the identifier is not defined and not guaranteed to remain
       the same in future versions.)
      </entry>
     </row>

     <row>
      <entry><literal>routine_body</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>
       If the function is an SQL function, then
       <literal>SQL</literal>, else <literal>EXTERNAL</literal>.
      </entry>
     </row>

     <row>
      <entry><literal>routine_definition</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>
       The source text of the function (null if the function is not
       owned by a currently enabled role).  (According to the SQL
       standard, this column is only applicable if
       <literal>routine_body</literal> is <literal>SQL</literal>, but
       in <productname>PostgreSQL</productname> it will contain
       whatever source text was specified when the function was
       created.)
      </entry>
     </row>

     <row>
      <entry><literal>external_name</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>
       If this function is a C function, then the external name (link
       symbol) of the function; else null.  (This works out to be the
       same value that is shown in
       <literal>routine_definition</literal>.)
      </entry>
     </row>

     <row>
      <entry><literal>external_language</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>The language the function is written in</entry>
     </row>

     <row>
      <entry><literal>parameter_style</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>
       Always <literal>GENERAL</literal> (The SQL standard defines
       other parameter styles, which are not available in <productname>PostgreSQL</>.)
      </entry>
     </row>

     <row>
      <entry><literal>is_deterministic</literal></entry>
      <entry><type>yes_or_no</type></entry>
      <entry>
       If the function is declared immutable (called deterministic in
       the SQL standard), then <literal>YES</literal>, else
       <literal>NO</literal>.  (You cannot query the other volatility
       levels available in <productname>PostgreSQL</> through the information schema.)
      </entry>
     </row>

     <row>
      <entry><literal>sql_data_access</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>
       Always <literal>MODIFIES</literal>, meaning that the function
       possibly modifies SQL data.  This information is not useful for
       <productname>PostgreSQL</>.
      </entry>
     </row>

     <row>
      <entry><literal>is_null_call</literal></entry>
      <entry><type>yes_or_no</type></entry>
      <entry>
       If the function automatically returns null if any of its
       arguments are null, then <literal>YES</literal>, else
       <literal>NO</literal>.
      </entry>
     </row>

     <row>
      <entry><literal>sql_path</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>schema_level_routine</literal></entry>
      <entry><type>yes_or_no</type></entry>
      <entry>
       Always <literal>YES</literal> (The opposite would be a method
       of a user-defined type, which is a feature not available in
       <productname>PostgreSQL</>.)
      </entry>
     </row>

     <row>
      <entry><literal>max_dynamic_result_sets</literal></entry>
      <entry><type>cardinal_number</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>is_user_defined_cast</literal></entry>
      <entry><type>yes_or_no</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>is_implicitly_invocable</literal></entry>
      <entry><type>yes_or_no</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>security_type</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>
       If the function runs with the privileges of the current user,
       then <literal>INVOKER</literal>, if the function runs with the
       privileges of the user who defined it, then
       <literal>DEFINER</literal>.
      </entry>
     </row>

     <row>
      <entry><literal>to_sql_specific_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>to_sql_specific_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>to_sql_specific_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>as_locator</literal></entry>
      <entry><type>yes_or_no</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>created</literal></entry>
      <entry><type>time_stamp</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>last_altered</literal></entry>
      <entry><type>time_stamp</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>new_savepoint_level</literal></entry>
      <entry><type>yes_or_no</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>is_udt_dependent</literal></entry>
      <entry><type>yes_or_no</type></entry>
      <entry>
       Currently always <literal>NO</literal>.  The alternative
       <literal>YES</literal> applies to a feature not available in
       <productname>PostgreSQL</>.
      </entry>
     </row>

     <row>
      <entry><literal>result_cast_from_data_type</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>result_cast_as_locator</literal></entry>
      <entry><type>yes_or_no</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>result_cast_char_max_length</literal></entry>
      <entry><type>cardinal_number</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>result_cast_char_octet_length</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>result_cast_char_set_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>result_cast_char_set_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>result_cast_char_set_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>result_cast_collation_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>result_cast_collation_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>result_cast_collation_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>result_cast_numeric_precision</literal></entry>
      <entry><type>cardinal_number</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>result_cast_numeric_precision_radix</literal></entry>
      <entry><type>cardinal_number</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>result_cast_numeric_scale</literal></entry>
      <entry><type>cardinal_number</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>result_cast_datetime_precision</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>result_cast_interval_type</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>result_cast_interval_precision</literal></entry>
      <entry><type>cardinal_number</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>result_cast_type_udt_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>result_cast_type_udt_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>result_cast_type_udt_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>result_cast_scope_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>result_cast_scope_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>result_cast_scope_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>result_cast_maximum_cardinality</literal></entry>
      <entry><type>cardinal_number</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>result_cast_dtd_identifier</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>

 <sect1 id="infoschema-schemata">
  <title><literal>schemata</literal></title>

  <para>
   The view <literal>schemata</literal> contains all schemas in the current
   database that the current user has access to (by way of being the owner or
   having some privilege).
  </para>

  <table>
   <title><literal>schemata</literal> Columns</title>

   <tgroup cols="3">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Data Type</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><literal>catalog_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the database that the schema is contained in (always the current database)</entry>
     </row>

     <row>
      <entry><literal>schema_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the schema</entry>
     </row>

     <row>
      <entry><literal>schema_owner</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the owner of the schema</entry>
     </row>

     <row>
      <entry><literal>default_character_set_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>default_character_set_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>default_character_set_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>sql_path</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>

 <sect1 id="infoschema-sequences">
  <title><literal>sequences</literal></title>

  <para>
   The view <literal>sequences</literal> contains all sequences
   defined in the current database.  Only those sequences are shown
   that the current user has access to (by way of being the owner or
   having some privilege).
  </para>

  <table>
   <title><literal>sequences</literal> Columns</title>

   <tgroup cols="3">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Data Type</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><literal>sequence_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the database that contains the sequence (always the current database)</entry>
     </row>

     <row>
      <entry><literal>sequence_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the schema that contains the sequence</entry>
     </row>

     <row>
      <entry><literal>sequence_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the sequence</entry>
     </row>

     <row>
      <entry><literal>data_type</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>
       The data type of the sequence.
      </entry>
     </row>

     <row>
      <entry><literal>numeric_precision</literal></entry>
      <entry><type>cardinal_number</type></entry>
      <entry>
       This column contains the (declared or implicit) precision of
       the sequence data type (see above).  The precision indicates
       the number of significant digits.  It can be expressed in
       decimal (base 10) or binary (base 2) terms, as specified in the
       column <literal>numeric_precision_radix</literal>.
      </entry>
     </row>

     <row>
      <entry><literal>numeric_precision_radix</literal></entry>
      <entry><type>cardinal_number</type></entry>
      <entry>
       This column indicates in which base the values in the columns
       <literal>numeric_precision</literal> and
       <literal>numeric_scale</literal> are expressed.  The value is
       either 2 or 10.
      </entry>
     </row>

     <row>
      <entry><literal>numeric_scale</literal></entry>
      <entry><type>cardinal_number</type></entry>
      <entry>
       This column contains the (declared or implicit) scale of the
       sequence data type (see above).  The scale indicates the number
       of significant digits to the right of the decimal point.  It
       can be expressed in decimal (base 10) or binary (base 2) terms,
       as specified in the column
       <literal>numeric_precision_radix</literal>.
      </entry>
     </row>

     <row>
      <entry><literal>start_value</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>The start value of the sequence</entry>
     </row>

     <row>
      <entry><literal>minimum_value</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>The minimum value of the sequence</entry>
     </row>

     <row>
      <entry><literal>maximum_value</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>The maximum value of the sequence</entry>
     </row>

     <row>
      <entry><literal>increment</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>The increment of the sequence</entry>
     </row>

     <row>
      <entry><literal>cycle_option</literal></entry>
      <entry><type>yes_or_no</type></entry>
      <entry><literal>YES</literal> if the sequence cycles, else <literal>NO</literal></entry>
     </row>
    </tbody>
   </tgroup>
  </table>

  <para>
   Note that in accordance with the SQL standard, the start, minimum,
   maximum, and increment values are returned as character strings.
  </para>
 </sect1>

 <sect1 id="infoschema-sql-features">
  <title><literal>sql_features</literal></title>

  <para>
   The table <literal>sql_features</literal> contains information
   about which formal features defined in the SQL standard are
   supported by <productname>PostgreSQL</productname>.  This is the
   same information that is presented in <xref linkend="features">.
   There you can also find some additional background information.
  </para>

  <table>
   <title><literal>sql_features</literal> Columns</title>

   <tgroup cols="3">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Data Type</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><literal>feature_id</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>Identifier string of the feature</entry>
     </row>

     <row>
      <entry><literal>feature_name</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>Descriptive name of the feature</entry>
     </row>

     <row>
      <entry><literal>sub_feature_id</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>Identifier string of the subfeature, or a zero-length string if not a subfeature</entry>
     </row>

     <row>
      <entry><literal>sub_feature_name</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>Descriptive name of the subfeature, or a zero-length string if not a subfeature</entry>
     </row>

     <row>
      <entry><literal>is_supported</literal></entry>
      <entry><type>yes_or_no</type></entry>
      <entry>
       <literal>YES</literal> if the feature is fully supported by the
       current version of <productname>PostgreSQL</>, <literal>NO</literal> if not
      </entry>
     </row>

     <row>
      <entry><literal>is_verified_by</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>
       Always null, since the <productname>PostgreSQL</> development group does not
       perform formal testing of feature conformance
      </entry>
     </row>

     <row>
      <entry><literal>comments</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>Possibly a comment about the supported status of the feature</entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>

 <sect1 id="infoschema-sql-implementation-info">
  <title><literal>sql_implementation_info</literal></title>

  <para>
   The table <literal>sql_implementation_info</literal> contains
   information about various aspects that are left
   implementation-defined by the SQL standard.  This information is
   primarily intended for use in the context of the ODBC interface;
   users of other interfaces will probably find this information to be
   of little use.  For this reason, the individual implementation
   information items are not described here; you will find them in the
   description of the ODBC interface.
  </para>

  <table>
   <title><literal>sql_implementation_info</literal> Columns</title>

   <tgroup cols="3">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Data Type</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><literal>implementation_info_id</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>Identifier string of the implementation information item</entry>
     </row>

     <row>
      <entry><literal>implementation_info_name</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>Descriptive name of the implementation information item</entry>
     </row>

     <row>
      <entry><literal>integer_value</literal></entry>
      <entry><type>cardinal_number</type></entry>
      <entry>
       Value of the implementation information item, or null if the
       value is contained in the column
       <literal>character_value</literal>
      </entry>
     </row>

     <row>
      <entry><literal>character_value</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>
       Value of the implementation information item, or null if the
       value is contained in the column
       <literal>integer_value</literal>
      </entry>
     </row>

     <row>
      <entry><literal>comments</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>Possibly a comment pertaining to the implementation information item</entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>

 <sect1 id="infoschema-sql-languages">
  <title><literal>sql_languages</literal></title>

  <para>
   The table <literal>sql_languages</literal> contains one row for
   each SQL language binding that is supported by
   <productname>PostgreSQL</productname>.
   <productname>PostgreSQL</productname> supports direct SQL and
   embedded SQL in C; that is all you will learn from this table.
  </para>

  <para>
   This table was removed from the SQL standard in SQL:2008, so there
   are no entries referring to standards later than SQL:2003.
  </para>

  <table>
   <title><literal>sql_languages</literal> Columns</title>

   <tgroup cols="3">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Data Type</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><literal>sql_language_source</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>
       The name of the source of the language definition; always
       <literal>ISO 9075</literal>, that is, the SQL standard
      </entry>
     </row>

     <row>
      <entry><literal>sql_language_year</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>
       The year the standard referenced in
       <literal>sql_language_source</literal> was approved.
      </entry>
     </row>

     <row>
      <entry><literal>sql_language_conformance</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>
       The standard conformance level for the language binding.  For
       ISO 9075:2003 this is always <literal>CORE</literal>.
      </entry>
     </row>

     <row>
      <entry><literal>sql_language_integrity</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>Always null (This value is relevant to an earlier version of the SQL standard.)</entry>
     </row>

     <row>
      <entry><literal>sql_language_implementation</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>Always null</entry>
     </row>

     <row>
      <entry><literal>sql_language_binding_style</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>
       The language binding style, either <literal>DIRECT</literal> or
       <literal>EMBEDDED</literal>
      </entry>
     </row>

     <row>
      <entry><literal>sql_language_programming_language</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>
       The programming language, if the binding style is
       <literal>EMBEDDED</literal>, else null.  <productname>PostgreSQL</> only
       supports the language C.
      </entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>

 <sect1 id="infoschema-sql-packages">
  <title><literal>sql_packages</literal></title>

  <para>
   The table <literal>sql_packages</literal> contains information
   about which feature packages defined in the SQL standard are
   supported by <productname>PostgreSQL</productname>.  Refer to <xref
   linkend="features"> for background information on feature packages.
  </para>

  <table>
   <title><literal>sql_packages</literal> Columns</title>

   <tgroup cols="3">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Data Type</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><literal>feature_id</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>Identifier string of the package</entry>
     </row>

     <row>
      <entry><literal>feature_name</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>Descriptive name of the package</entry>
     </row>

     <row>
      <entry><literal>is_supported</literal></entry>
      <entry><type>yes_or_no</type></entry>
      <entry>
       <literal>YES</literal> if the package is fully supported by the
       current version of <productname>PostgreSQL</>, <literal>NO</literal> if not
      </entry>
     </row>

     <row>
      <entry><literal>is_verified_by</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>
       Always null, since the <productname>PostgreSQL</> development group does not
       perform formal testing of feature conformance
      </entry>
     </row>

     <row>
      <entry><literal>comments</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>Possibly a comment about the supported status of the package</entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>

 <sect1 id="infoschema-sql-parts">
  <title><literal>sql_parts</literal></title>

  <para>
   The table <literal>sql_parts</literal> contains information about
   which of the several parts of the SQL standard are supported by
   <productname>PostgreSQL</productname>.
  </para>

  <table>
   <title><literal>sql_parts</literal> Columns</title>

   <tgroup cols="3">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Data Type</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><literal>feature_id</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>An identifier string containing the number of the part</entry>
     </row>

     <row>
      <entry><literal>feature_name</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>Descriptive name of the part</entry>
     </row>

     <row>
      <entry><literal>is_supported</literal></entry>
      <entry><type>yes_or_no</type></entry>
      <entry>
       <literal>YES</literal> if the part is fully supported by the
       current version of <productname>PostgreSQL</>,
       <literal>NO</literal> if not
      </entry>
     </row>

     <row>
      <entry><literal>is_verified_by</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>
       Always null, since the <productname>PostgreSQL</> development group does not
       perform formal testing of feature conformance
      </entry>
     </row>

     <row>
      <entry><literal>comments</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>Possibly a comment about the supported status of the part</entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>

 <sect1 id="infoschema-sql-sizing">
  <title><literal>sql_sizing</literal></title>

  <para>
   The table <literal>sql_sizing</literal> contains information about
   various size limits and maximum values in
   <productname>PostgreSQL</productname>.  This information is
   primarily intended for use in the context of the ODBC interface;
   users of other interfaces will probably find this information to be
   of little use.  For this reason, the individual sizing items are
   not described here; you will find them in the description of the
   ODBC interface.
  </para>

  <table>
   <title><literal>sql_sizing</literal> Columns</title>

   <tgroup cols="3">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Data Type</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><literal>sizing_id</literal></entry>
      <entry><type>cardinal_number</type></entry>
      <entry>Identifier of the sizing item</entry>
     </row>

     <row>
      <entry><literal>sizing_name</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>Descriptive name of the sizing item</entry>
     </row>

     <row>
      <entry><literal>supported_value</literal></entry>
      <entry><type>cardinal_number</type></entry>
      <entry>
       Value of the sizing item, or 0 if the size is unlimited or
       cannot be determined, or null if the features for which the
       sizing item is applicable are not supported
      </entry>
     </row>

     <row>
      <entry><literal>comments</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>Possibly a comment pertaining to the sizing item</entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>

 <sect1 id="infoschema-sql-sizing-profiles">
  <title><literal>sql_sizing_profiles</literal></title>

  <para>
   The table <literal>sql_sizing_profiles</literal> contains
   information about the <literal>sql_sizing</literal> values that are
   required by various profiles of the SQL standard.  <productname>PostgreSQL</> does
   not track any SQL profiles, so this table is empty.
  </para>

  <table>
   <title><literal>sql_sizing_profiles</literal> Columns</title>

   <tgroup cols="3">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Data Type</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><literal>sizing_id</literal></entry>
      <entry><type>cardinal_number</type></entry>
      <entry>Identifier of the sizing item</entry>
     </row>

     <row>
      <entry><literal>sizing_name</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>Descriptive name of the sizing item</entry>
     </row>

     <row>
      <entry><literal>profile_id</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>Identifier string of a profile</entry>
     </row>

     <row>
      <entry><literal>required_value</literal></entry>
      <entry><type>cardinal_number</type></entry>
      <entry>
       The value required by the SQL profile for the sizing item, or 0
       if the profile places no limit on the sizing item, or null if
       the profile does not require any of the features for which the
       sizing item is applicable
      </entry>
     </row>

     <row>
      <entry><literal>comments</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>Possibly a comment pertaining to the sizing item within the profile</entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>

 <sect1 id="infoschema-table-constraints">
  <title><literal>table_constraints</literal></title>

  <para>
   The view <literal>table_constraints</literal> contains all
   constraints belonging to tables that the current user owns or has
   some privilege other than <literal>SELECT</literal> on.
  </para>

  <table>
   <title><literal>table_constraints</literal> Columns</title>

   <tgroup cols="3">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Data Type</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><literal>constraint_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the database that contains the constraint (always the current database)</entry>
     </row>

     <row>
      <entry><literal>constraint_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the schema that contains the constraint</entry>
     </row>

     <row>
      <entry><literal>constraint_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the constraint</entry>
     </row>

     <row>
      <entry><literal>table_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the database that contains the table (always the current database)</entry>
     </row>

     <row>
      <entry><literal>table_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the schema that contains the table</entry>
     </row>

     <row>
      <entry><literal>table_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the table</entry>
     </row>

     <row>
      <entry><literal>constraint_type</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>
       Type of the constraint: <literal>CHECK</literal>,
       <literal>FOREIGN KEY</literal>, <literal>PRIMARY KEY</literal>,
       or <literal>UNIQUE</literal>
      </entry>
     </row>

     <row>
      <entry><literal>is_deferrable</literal></entry>
      <entry><type>yes_or_no</type></entry>
      <entry><literal>YES</literal> if the constraint is deferrable, <literal>NO</literal> if not</entry>
     </row>

     <row>
      <entry><literal>initially_deferred</literal></entry>
      <entry><type>yes_or_no</type></entry>
      <entry><literal>YES</literal> if the constraint is deferrable and initially deferred, <literal>NO</literal> if not</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><literal>table_privileges</literal> Columns</title>

   <tgroup cols="3">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Data Type</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><literal>grantor</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the role that granted the privilege</entry>
     </row>

     <row>
      <entry><literal>grantee</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the role that the privilege was granted to</entry>
     </row>

     <row>
      <entry><literal>table_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the database that contains the table (always the current database)</entry>
     </row>

     <row>
      <entry><literal>table_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the schema that contains the table</entry>
     </row>

     <row>
      <entry><literal>table_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the table</entry>
     </row>

     <row>
      <entry><literal>privilege_type</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>
       Type of the privilege: <literal>SELECT</literal>,
       <literal>INSERT</literal>, <literal>UPDATE</literal>,
       <literal>DELETE</literal>, <literal>TRUNCATE</literal>,
       <literal>REFERENCES</literal>, or <literal>TRIGGER</literal>
      </entry>
     </row>

     <row>
      <entry><literal>is_grantable</literal></entry>
      <entry><type>yes_or_no</type></entry>
      <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
     </row>

     <row>
      <entry><literal>with_hierarchy</literal></entry>
      <entry><type>yes_or_no</type></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>
    </tbody>
   </tgroup>
  </table>
 </sect1>

 <sect1 id="infoschema-tables">
  <title><literal>tables</literal></title>

  <para>
   The view <literal>tables</literal> contains all tables and views
   defined in the current database.  Only those tables and views are
   shown that the current user has access to (by way of being the
   owner or having some privilege).
  </para>

  <table>
   <title><literal>tables</literal> Columns</title>

   <tgroup cols="3">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Data Type</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><literal>table_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the database that contains the table (always the current database)</entry>
     </row>

     <row>
      <entry><literal>table_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the schema that contains the table</entry>
     </row>

     <row>
      <entry><literal>table_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the table</entry>
     </row>

     <row>
      <entry><literal>table_type</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>
       Type of the table: <literal>BASE TABLE</literal> for a
       persistent base table (the normal table type),
       <literal>VIEW</literal> for a view, <literal>FOREIGN TABLE</literal>
       for a foreign table, or
       <literal>LOCAL TEMPORARY</literal> for a temporary table
      </entry>
     </row>

     <row>
      <entry><literal>self_referencing_column_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>reference_generation</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>user_defined_type_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>
       If the table is a typed table, the name of the database that
       contains the underlying data type (always the current
       database), else null.
      </entry>
     </row>

     <row>
      <entry><literal>user_defined_type_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>
       If the table is a typed table, the name of the schema that
       contains the underlying data type, else null.
      </entry>
     </row>

     <row>
      <entry><literal>user_defined_type_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>
       If the table is a typed table, the name of the underlying data
       type, else null.
      </entry>
     </row>

     <row>
      <entry><literal>is_insertable_into</literal></entry>
      <entry><type>yes_or_no</type></entry>
      <entry>
       <literal>YES</literal> if the table is insertable into,
       <literal>NO</literal> if not (Base tables are always insertable
       into, views not necessarily.)
      </entry>
     </row>

     <row>
      <entry><literal>is_typed</literal></entry>
      <entry><type>yes_or_no</type></entry>
      <entry><literal>YES</literal> if the table is a typed table, <literal>NO</literal> if not</entry>
     </row>

     <row>
      <entry><literal>commit_action</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>Not yet implemented</entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>

 <sect1 id="infoschema-transforms">
  <title><literal>transforms</literal></title>

  <para>
   The view <literal>transforms</literal> contains information about the
   transforms defined in the current database.  More precisely, it contains a
   row for each function contained in a transform (the <quote>from SQL</quote>
   or <quote>to SQL</quote> function).
  </para>

  <table>
   <title><literal>transforms</literal> Columns</title>

   <tgroup cols="3">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Data Type</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><literal>udt_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the database that contains the type the transform is for (always the current database)</entry>
     </row>

     <row>
      <entry><literal>udt_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the schema that contains the type the transform is for</entry>
     </row>

     <row>
      <entry><literal>udt_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the type the transform is for</entry>
     </row>

     <row>
      <entry><literal>specific_catalog</literal></entry>
      <entry><literal>sql_identifier</literal></entry>
      <entry>Name of the database containing the function (always the current database)</entry>
     </row>

     <row>
      <entry><literal>specific_schema</literal></entry>
      <entry><literal>sql_identifier</literal></entry>
      <entry>Name of the schema containing the function</entry>
     </row>

     <row>
      <entry><literal>specific_name</literal></entry>
      <entry><literal>sql_identifier</literal></entry>
      <entry>
       The <quote>specific name</quote> of the function.  See <xref
       linkend="infoschema-routines"> for more information.
      </entry>
     </row>

     <row>
      <entry><literal>group_name</literal></entry>
      <entry><literal>sql_identifier</literal></entry>
      <entry>
       The SQL standard allows defining transforms in <quote>groups</quote>,
       and selecting a group at run time.  PostgreSQL does not support this.
       Instead, transforms are specific to a language.  As a compromise, this
       field contains the language the transform is for.
      </entry>
     </row>

     <row>
      <entry><literal>transform_type</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>
       <literal>FROM SQL</literal> or <literal>TO SQL</literal>
      </entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>

 <sect1 id="infoschema-triggered-update-columns">
  <title><literal>triggered_update_columns</literal></title>

  <para>
   For triggers in the current database that specify a column list
   (like <literal>UPDATE OF column1, column2</literal>), the
   view <literal>triggered_update_columns</literal> identifies these
   columns.  Triggers that do not specify a column list are not
   included in this view.  Only those columns are shown that the
   current user owns or has some privilege other than
   <literal>SELECT</literal> on.
  </para>

  <table>
   <title><literal>triggered_update_columns</literal> Columns</title>

   <tgroup cols="3">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Data Type</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><literal>trigger_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the database that contains the trigger (always the current database)</entry>
     </row>

     <row>
      <entry><literal>trigger_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the schema that contains the trigger</entry>
     </row>

     <row>
      <entry><literal>trigger_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the trigger</entry>
     </row>

     <row>
      <entry><literal>event_object_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>
       Name of the database that contains the table that the trigger
       is defined on (always the current database)
      </entry>
     </row>

     <row>
      <entry><literal>event_object_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the schema that contains the table that the trigger is defined on</entry>
     </row>

     <row>
      <entry><literal>event_object_table</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the table that the trigger is defined on</entry>
     </row>

     <row>
      <entry><literal>event_object_column</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the column that the trigger is defined on</entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>

 <sect1 id="infoschema-triggers">
  <title><literal>triggers</literal></title>

  <para>
   The view <literal>triggers</literal> contains all triggers defined
   in the current database on tables and views that the current user owns
   or has some privilege other than <literal>SELECT</literal> on.
  </para>

  <table>
   <title><literal>triggers</literal> Columns</title>

   <tgroup cols="3">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Data Type</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><literal>trigger_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the database that contains the trigger (always the current database)</entry>
     </row>

     <row>
      <entry><literal>trigger_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the schema that contains the trigger</entry>
     </row>

     <row>
      <entry><literal>trigger_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the trigger</entry>
     </row>

     <row>
      <entry><literal>event_manipulation</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>
       Event that fires the trigger (<literal>INSERT</literal>,
       <literal>UPDATE</literal>, or <literal>DELETE</literal>)
      </entry>
     </row>

     <row>
      <entry><literal>event_object_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>
       Name of the database that contains the table that the trigger
       is defined on (always the current database)
      </entry>
     </row>

     <row>
      <entry><literal>event_object_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the schema that contains the table that the trigger is defined on</entry>
     </row>

     <row>
      <entry><literal>event_object_table</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the table that the trigger is defined on</entry>
     </row>

     <row>
      <entry><literal>action_order</literal></entry>
      <entry><type>cardinal_number</type></entry>
      <entry>Not yet implemented</entry>
     </row>

     <row>
      <entry><literal>action_condition</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>
       <literal>WHEN</literal> condition of the trigger, null if none
       (also null if the table is not owned by a currently enabled
       role)
      </entry>
     </row>

     <row>
      <entry><literal>action_statement</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>
       Statement that is executed by the trigger (currently always
       <literal>EXECUTE PROCEDURE
       <replaceable>function</replaceable>(...)</literal>)
      </entry>
     </row>

     <row>
      <entry><literal>action_orientation</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>
       Identifies whether the trigger fires once for each processed
       row or once for each statement (<literal>ROW</literal> or
       <literal>STATEMENT</literal>)
      </entry>
     </row>

     <row>
      <entry><literal>action_timing</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>
       Time at which the trigger fires (<literal>BEFORE</literal>,
       <literal>AFTER</literal>, or <literal>INSTEAD OF</literal>)
      </entry>
     </row>

     <row>
      <entry><literal>action_reference_old_table</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>action_reference_new_table</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>action_reference_old_row</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>action_reference_new_row</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>created</literal></entry>
      <entry><type>time_stamp</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>
    </tbody>
   </tgroup>
  </table>

  <para>
   Triggers in <productname>PostgreSQL</productname> have two
   incompatibilities with the SQL standard that affect the
   representation in the information schema.  First, trigger names are
   local to each table in <productname>PostgreSQL</productname>, rather
   than being independent schema objects.  Therefore there can be duplicate
   trigger names defined in one schema, so long as they belong to
   different tables.  (<literal>trigger_catalog</literal> and
   <literal>trigger_schema</literal> are really the values pertaining
   to the table that the trigger is defined on.)  Second, triggers can
   be defined to fire on multiple events in
   <productname>PostgreSQL</productname> (e.g., <literal>ON INSERT OR
   UPDATE</literal>), whereas the SQL standard only allows one.  If a
   trigger is defined to fire on multiple events, it is represented as
   multiple rows in the information schema, one for each type of
   event.  As a consequence of these two issues, the primary key of
   the view <literal>triggers</literal> is really
   <literal>(trigger_catalog, trigger_schema, event_object_table,
   trigger_name, event_manipulation)</literal> instead of
   <literal>(trigger_catalog, trigger_schema, trigger_name)</literal>,
   which is what the SQL standard specifies.  Nonetheless, if you
   define your triggers in a manner that conforms with the SQL
   standard (trigger names unique in the schema and only one event
   type per trigger), this will not affect you.
  </para>

  <note>
   <para>
    Prior to <productname>PostgreSQL</> 9.1, this view's columns
    <structfield>action_timing</structfield>,
    <structfield>action_reference_old_table</structfield>,
    <structfield>action_reference_new_table</structfield>,
    <structfield>action_reference_old_row</structfield>, and
    <structfield>action_reference_new_row</structfield>
    were named
    <structfield>condition_timing</structfield>,
    <structfield>condition_reference_old_table</structfield>,
    <structfield>condition_reference_new_table</structfield>,
    <structfield>condition_reference_old_row</structfield>, and
    <structfield>condition_reference_new_row</structfield>
    respectively.
    That was how they were named in the SQL:1999 standard.
    The new naming conforms to SQL:2003 and later.
   </para>
  </note>
 </sect1>

 <sect1 id="infoschema-udt-privileges">
  <title><literal>udt_privileges</literal></title>

  <para>
   The view <literal>udt_privileges</literal> identifies
   <literal>USAGE</literal> privileges granted on user-defined types to a
   currently enabled role or by a currently enabled role.  There is one row for
   each combination of type, grantor, and grantee.  This view shows only
   composite types (see under <xref linkend="infoschema-user-defined-types">
   for why); see
   <xref linkend="infoschema-usage-privileges"> for domain privileges.
  </para>

  <table>
   <title><literal>udt_privileges</literal> Columns</title>

   <tgroup cols="3">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Data Type</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><literal>grantor</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the role that granted the privilege</entry>
     </row>

     <row>
      <entry><literal>grantee</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the role that the privilege was granted to</entry>
     </row>

     <row>
      <entry><literal>udt_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the database containing the type (always the current database)</entry>
     </row>

     <row>
      <entry><literal>udt_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the schema containing the type</entry>
     </row>

     <row>
      <entry><literal>udt_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the type</entry>
     </row>

     <row>
      <entry><literal>privilege_type</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>Always <literal>TYPE USAGE</literal></entry>
     </row>

     <row>
      <entry><literal>is_grantable</literal></entry>
      <entry><type>yes_or_no</type></entry>
      <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</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><literal>usage_privileges</literal> Columns</title>

   <tgroup cols="3">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Data Type</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><literal>grantor</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the role that granted the privilege</entry>
     </row>

     <row>
      <entry><literal>grantee</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the role that the privilege was granted to</entry>
     </row>

     <row>
      <entry><literal>object_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the database containing the object (always the current database)</entry>
     </row>

     <row>
      <entry><literal>object_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the schema containing the object, if applicable,
      else an empty string</entry>
     </row>

     <row>
      <entry><literal>object_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the object</entry>
     </row>

     <row>
      <entry><literal>object_type</literal></entry>
      <entry><type>character_data</type></entry>
      <entry><literal>COLLATION</literal> or <literal>DOMAIN</literal> or <literal>FOREIGN DATA WRAPPER</literal> or <literal>FOREIGN SERVER</literal> or <literal>SEQUENCE</literal></entry>
     </row>

     <row>
      <entry><literal>privilege_type</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>Always <literal>USAGE</literal></entry>
     </row>

     <row>
      <entry><literal>is_grantable</literal></entry>
      <entry><type>yes_or_no</type></entry>
      <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>

 <sect1 id="infoschema-user-defined-types">
  <title><literal>user_defined_types</literal></title>

  <para>
   The view <literal>user_defined_types</literal> currently contains
   all composite types defined in the current database.
   Only those types are shown that the current user has access to (by way
   of being the owner or having some privilege).
  </para>

  <para>
   SQL knows about two kinds of user-defined types: structured types
   (also known as composite types
   in <productname>PostgreSQL</productname>) and distinct types (not
   implemented in <productname>PostgreSQL</productname>).  To be
   future-proof, use the
   column <literal>user_defined_type_category</literal> to
   differentiate between these.  Other user-defined types such as base
   types and enums, which are <productname>PostgreSQL</productname>
   extensions, are not shown here.  For domains,
   see <xref linkend="infoschema-domains"> instead.
  </para>

  <table>
   <title><literal>user_defined_types</literal> Columns</title>

   <tgroup cols="3">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Data Type</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><literal>user_defined_type_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the database that contains the type (always the current database)</entry>
     </row>

     <row>
      <entry><literal>user_defined_type_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the schema that contains the type</entry>
     </row>

     <row>
      <entry><literal>user_defined_type_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the type</entry>
     </row>

     <row>
      <entry><literal>user_defined_type_category</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>
       Currently always <literal>STRUCTURED</literal>
      </entry>
     </row>

     <row>
      <entry><literal>is_instantiable</literal></entry>
      <entry><type>yes_or_no</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>is_final</literal></entry>
      <entry><type>yes_or_no</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>ordering_form</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>ordering_category</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>ordering_routine_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>ordering_routine_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>ordering_routine_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>reference_type</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>data_type</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>character_maximum_length</literal></entry>
      <entry><type>cardinal_number</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>character_octet_length</literal></entry>
      <entry><type>cardinal_number</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>character_set_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>character_set_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>character_set_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>collation_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>collation_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>collation_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>numeric_precision</literal></entry>
      <entry><type>cardinal_number</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>numeric_precision_radix</literal></entry>
      <entry><type>cardinal_number</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>numeric_scale</literal></entry>
      <entry><type>cardinal_number</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>datetime_precision</literal></entry>
      <entry><type>cardinal_number</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>interval_type</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>interval_precision</literal></entry>
      <entry><type>cardinal_number</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>source_dtd_identifier</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>ref_dtd_identifier</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>

 <sect1 id="infoschema-user-mapping-options">
  <title><literal>user_mapping_options</literal></title>

  <para>
   The view <literal>user_mapping_options</literal> contains all the
   options defined for user mappings in the current database.  Only
   those user mappings are shown where the current user has access to
   the corresponding foreign server (by way of being the owner or
   having some privilege).
  </para>

  <table>
   <title><literal>user_mapping_options</literal> Columns</title>

   <tgroup cols="3">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Data Type</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><literal>authorization_identifier</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the user being mapped,
      or <literal>PUBLIC</literal> if the mapping is public</entry>
     </row>

     <row>
      <entry><literal>foreign_server_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the database that the foreign server used by this
      mapping is defined in (always the current database)</entry>
     </row>

     <row>
      <entry><literal>foreign_server_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the foreign server used by this mapping</entry>
     </row>

     <row>
      <entry><literal>option_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of an option</entry>
     </row>

     <row>
      <entry><literal>option_value</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>Value of the option.  This column will show as null
      unless the current user is the user being mapped, or the mapping
      is for <literal>PUBLIC</literal> and the current user is the
      server owner, or the current user is a superuser.  The intent is
      to protect password information stored as user mapping
      option.</entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>

 <sect1 id="infoschema-user-mappings">
  <title><literal>user_mappings</literal></title>

  <para>
   The view <literal>user_mappings</literal> contains all user
   mappings defined in the current database.  Only those user mappings
   are shown where the current user has access to the corresponding
   foreign server (by way of being the owner or having some
   privilege).
  </para>

  <table>
   <title><literal>user_mappings</literal> Columns</title>

   <tgroup cols="3">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Data Type</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><literal>authorization_identifier</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the user being mapped,
      or <literal>PUBLIC</literal> if the mapping is public</entry>
     </row>

     <row>
      <entry><literal>foreign_server_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the database that the foreign server used by this
      mapping is defined in (always the current database)</entry>
     </row>

     <row>
      <entry><literal>foreign_server_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the foreign server used by this mapping</entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>

 <sect1 id="infoschema-view-column-usage">
  <title><literal>view_column_usage</literal></title>

  <para>
   The view <literal>view_column_usage</literal> identifies all
   columns that are used in the query expression of a view (the
   <command>SELECT</command> statement that defines the view).  A
   column is only included if the table that contains the column is
   owned by a currently enabled role.
  </para>

  <note>
   <para>
    Columns of system tables are not included.  This should be fixed
    sometime.
   </para>
  </note>

  <table>
   <title><literal>view_column_usage</literal> Columns</title>

   <tgroup cols="3">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Data Type</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><literal>view_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the database that contains the view (always the current database)</entry>
     </row>

     <row>
      <entry><literal>view_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the schema that contains the view</entry>
     </row>

     <row>
      <entry><literal>view_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the view</entry>
     </row>

     <row>
      <entry><literal>table_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>
       Name of the database that contains the table that contains the
       column that is used by the view (always the current database)
      </entry>
     </row>

     <row>
      <entry><literal>table_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>
       Name of the schema that contains the table that contains the
       column that is used by the view
      </entry>
     </row>

     <row>
      <entry><literal>table_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>
       Name of the table that contains the column that is used by the
       view
      </entry>
     </row>

     <row>
      <entry><literal>column_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the column that is used by the view</entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>

 <sect1 id="infoschema-view-routine-usage">
  <title><literal>view_routine_usage</literal></title>

  <para>
   The view <literal>view_routine_usage</literal> identifies all
   routines (functions and procedures) that are used in the query
   expression of a view (the <command>SELECT</command> statement that
   defines the view).  A routine is only included if that routine is
   owned by a currently enabled role.
  </para>

  <table>
   <title><literal>view_routine_usage</literal> Columns</title>

   <tgroup cols="3">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Data Type</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><literal>table_catalog</literal></entry>
      <entry><literal>sql_identifier</literal></entry>
      <entry>Name of the database containing the view (always the current database)</entry>
     </row>

     <row>
      <entry><literal>table_schema</literal></entry>
      <entry><literal>sql_identifier</literal></entry>
      <entry>Name of the schema containing the view</entry>
     </row>

     <row>
      <entry><literal>table_name</literal></entry>
      <entry><literal>sql_identifier</literal></entry>
      <entry>Name of the view</entry>
     </row>

     <row>
      <entry><literal>specific_catalog</literal></entry>
      <entry><literal>sql_identifier</literal></entry>
      <entry>Name of the database containing the function (always the current database)</entry>
     </row>

     <row>
      <entry><literal>specific_schema</literal></entry>
      <entry><literal>sql_identifier</literal></entry>
      <entry>Name of the schema containing the function</entry>
     </row>

     <row>
      <entry><literal>specific_name</literal></entry>
      <entry><literal>sql_identifier</literal></entry>
      <entry>
       The <quote>specific name</quote> of the function.  See <xref
       linkend="infoschema-routines"> for more information.
      </entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>

 <sect1 id="infoschema-view-table-usage">
  <title><literal>view_table_usage</literal></title>

  <para>
   The view <literal>view_table_usage</literal> identifies all tables
   that are used in the query expression of a view (the
   <command>SELECT</command> statement that defines the view).  A
   table is only included if that table is owned by a currently
   enabled role.
  </para>

  <note>
   <para>
    System tables are not included.  This should be fixed sometime.
   </para>
  </note>

  <table>
   <title><literal>view_table_usage</literal> Columns</title>

   <tgroup cols="3">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Data Type</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><literal>view_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the database that contains the view (always the current database)</entry>
     </row>

     <row>
      <entry><literal>view_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the schema that contains the view</entry>
     </row>

     <row>
      <entry><literal>view_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the view</entry>
     </row>

     <row>
      <entry><literal>table_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>
       Name of the database that contains the table that is
       used by the view (always the current database)
      </entry>
     </row>

     <row>
      <entry><literal>table_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>
       Name of the schema that contains the table that is used by the
       view
      </entry>
     </row>

     <row>
      <entry><literal>table_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>
       Name of the table that is used by the view
      </entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>

 <sect1 id="infoschema-views">
  <title><literal>views</literal></title>

  <para>
   The view <literal>views</literal> contains all views defined in the
   current database.  Only those views are shown that the current user
   has access to (by way of being the owner or having some privilege).
  </para>

  <table>
   <title><literal>views</literal> Columns</title>

   <tgroup cols="3">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Data Type</entry>
      <entry>Description</entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry><literal>table_catalog</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the database that contains the view (always the current database)</entry>
     </row>

     <row>
      <entry><literal>table_schema</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the schema that contains the view</entry>
     </row>

     <row>
      <entry><literal>table_name</literal></entry>
      <entry><type>sql_identifier</type></entry>
      <entry>Name of the view</entry>
     </row>

     <row>
      <entry><literal>view_definition</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>
       Query expression defining the view (null if the view is not
       owned by a currently enabled role)
      </entry>
     </row>

     <row>
      <entry><literal>check_option</literal></entry>
      <entry><type>character_data</type></entry>
      <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
     </row>

     <row>
      <entry><literal>is_updatable</literal></entry>
      <entry><type>yes_or_no</type></entry>
      <entry>
       <literal>YES</literal> if the view is updatable (allows
       <command>UPDATE</command> and <command>DELETE</command>),
       <literal>NO</literal> if not
      </entry>
     </row>

     <row>
      <entry><literal>is_insertable_into</literal></entry>
      <entry><type>yes_or_no</type></entry>
      <entry>
       <literal>YES</literal> if the view is insertable into (allows
       <command>INSERT</command>), <literal>NO</literal> if not
      </entry>
     </row>

     <row>
      <entry><literal>is_trigger_updatable</literal></entry>
      <entry><type>yes_or_no</type></entry>
      <entry>
       <literal>YES</> if the view has an <literal>INSTEAD OF</>
       <command>UPDATE</> trigger defined on it, <literal>NO</> if not
      </entry>
     </row>

     <row>
      <entry><literal>is_trigger_deletable</literal></entry>
      <entry><type>yes_or_no</type></entry>
      <entry>
       <literal>YES</> if the view has an <literal>INSTEAD OF</>
       <command>DELETE</> trigger defined on it, <literal>NO</> if not
      </entry>
     </row>

     <row>
      <entry><literal>is_trigger_insertable_into</literal></entry>
      <entry><type>yes_or_no</type></entry>
      <entry>
       <literal>YES</> if the view has an <literal>INSTEAD OF</>
       <command>INSERT</> trigger defined on it, <literal>NO</> if not
      </entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>

</chapter>
