]> granicus.if.org Git - postgresql/blob - doc/src/sgml/information_schema.sgml
doc: Use proper em and en dashes
[postgresql] / doc / src / sgml / information_schema.sgml
1 <!-- doc/src/sgml/information_schema.sgml -->
2
3 <chapter id="information-schema">
4  <title>The Information Schema</title>
5
6  <indexterm zone="information-schema">
7   <primary>information schema</primary>
8  </indexterm>
9
10  <para>
11   The information schema consists of a set of views that contain
12   information about the objects defined in the current database.  The
13   information schema is defined in the SQL standard and can therefore
14   be expected to be portable and remain stable &mdash; unlike the system
15   catalogs, which are specific to
16   <productname>PostgreSQL</productname> and are modeled after
17   implementation concerns.  The information schema views do not,
18   however, contain information about
19   <productname>PostgreSQL</productname>-specific features; to inquire
20   about those you need to query the system catalogs or other
21   <productname>PostgreSQL</productname>-specific views.
22  </para>
23
24  <note>
25   <para>
26    When querying the database for constraint information, it is possible
27    for a standard-compliant query that expects to return one row to
28    return several.  This is because the SQL standard requires constraint
29    names to be unique within a schema, but
30    <productname>PostgreSQL</productname> does not enforce this
31    restriction.  <productname>PostgreSQL</productname>
32    automatically-generated constraint names avoid duplicates in the
33    same schema, but users can specify such duplicate names.
34   </para>
35
36   <para>
37    This problem can appear when querying information schema views such
38    as <literal>check_constraint_routine_usage</literal>,
39    <literal>check_constraints</literal>, <literal>domain_constraints</literal>, and
40    <literal>referential_constraints</literal>.  Some other views have similar
41    issues but contain the table name to help distinguish duplicate
42    rows, e.g., <literal>constraint_column_usage</literal>,
43    <literal>constraint_table_usage</literal>, <literal>table_constraints</literal>.
44   </para>
45  </note>
46
47
48  <sect1 id="infoschema-schema">
49   <title>The Schema</title>
50
51   <para>
52    The information schema itself is a schema named
53    <literal>information_schema</literal>.  This schema automatically
54    exists in all databases.  The owner of this schema is the initial
55    database user in the cluster, and that user naturally has all the
56    privileges on this schema, including the ability to drop it (but
57    the space savings achieved by that are minuscule).
58   </para>
59
60   <para>
61    By default, the information schema is not in the schema search
62    path, so you need to access all objects in it through qualified
63    names.  Since the names of some of the objects in the information
64    schema are generic names that might occur in user applications, you
65    should be careful if you want to put the information schema in the
66    path.
67   </para>
68  </sect1>
69
70  <sect1 id="infoschema-datatypes">
71   <title>Data Types</title>
72
73   <para>
74    The columns of the information schema views use special data types
75    that are defined in the information schema.  These are defined as
76    simple domains over ordinary built-in types.  You should not use
77    these types for work outside the information schema, but your
78    applications must be prepared for them if they select from the
79    information schema.
80   </para>
81
82   <para>
83    These types are:
84
85    <variablelist>
86     <varlistentry>
87      <term><type>cardinal_number</type></term>
88      <listitem>
89       <para>
90        A nonnegative integer.
91       </para>
92      </listitem>
93     </varlistentry>
94
95     <varlistentry>
96      <term><type>character_data</type></term>
97      <listitem>
98       <para>
99        A character string (without specific maximum length).
100       </para>
101      </listitem>
102     </varlistentry>
103
104     <varlistentry>
105      <term><type>sql_identifier</type></term>
106      <listitem>
107       <para>
108        A character string.  This type is used for SQL identifiers, the
109        type <type>character_data</type> is used for any other kind of
110        text data.
111       </para>
112      </listitem>
113     </varlistentry>
114
115     <varlistentry>
116      <term><type>time_stamp</type></term>
117      <listitem>
118       <para>
119        A domain over the type <type>timestamp with time zone</type>
120       </para>
121      </listitem>
122     </varlistentry>
123
124     <varlistentry>
125      <term><type>yes_or_no</type></term>
126      <listitem>
127       <para>
128        A character string domain that contains
129        either <literal>YES</literal> or <literal>NO</literal>.  This
130        is used to represent Boolean (true/false) data in the
131        information schema.  (The information schema was invented
132        before the type <type>boolean</type> was added to the SQL
133        standard, so this convention is necessary to keep the
134        information schema backward compatible.)
135       </para>
136      </listitem>
137     </varlistentry>
138    </variablelist>
139
140    Every column in the information schema has one of these five types.
141   </para>
142  </sect1>
143
144  <sect1 id="infoschema-information-schema-catalog-name">
145   <title><literal>information_schema_catalog_name</literal></title>
146
147   <para>
148    <literal>information_schema_catalog_name</literal> is a table that
149    always contains one row and one column containing the name of the
150    current database (current catalog, in SQL terminology).
151   </para>
152
153   <table>
154    <title><literal>information_schema_catalog_name</literal> Columns</title>
155
156    <tgroup cols="3">
157     <thead>
158      <row>
159       <entry>Name</entry>
160       <entry>Data Type</entry>
161       <entry>Description</entry>
162      </row>
163     </thead>
164
165     <tbody>
166      <row>
167       <entry><literal>catalog_name</literal></entry>
168       <entry><type>sql_identifier</type></entry>
169       <entry>Name of the database that contains this information schema</entry>
170      </row>
171     </tbody>
172    </tgroup>
173   </table>
174  </sect1>
175
176  <sect1 id="infoschema-administrable-role-authorizations">
177   <title><literal>administrable_role_authorizations</literal></title>
178
179   <para>
180    The view <literal>administrable_role_authorizations</literal>
181    identifies all roles that the current user has the admin option
182    for.
183   </para>
184
185   <table>
186    <title><literal>administrable_role_authorizations</literal> Columns</title>
187
188    <tgroup cols="3">
189     <thead>
190      <row>
191       <entry>Name</entry>
192       <entry>Data Type</entry>
193       <entry>Description</entry>
194      </row>
195     </thead>
196
197     <tbody>
198      <row>
199       <entry><literal>grantee</literal></entry>
200       <entry><type>sql_identifier</type></entry>
201       <entry>
202        Name of the role to which this role membership was granted (can
203        be the current user, or a different role in case of nested role
204        memberships)
205       </entry>
206      </row>
207
208      <row>
209       <entry><literal>role_name</literal></entry>
210       <entry><type>sql_identifier</type></entry>
211       <entry>Name of a role</entry>
212      </row>
213
214      <row>
215       <entry><literal>is_grantable</literal></entry>
216       <entry><type>yes_or_no</type></entry>
217       <entry>Always <literal>YES</literal></entry>
218      </row>
219     </tbody>
220    </tgroup>
221   </table>
222  </sect1>
223
224  <sect1 id="infoschema-applicable-roles">
225   <title><literal>applicable_roles</literal></title>
226
227   <para>
228    The view <literal>applicable_roles</literal> identifies all roles
229    whose privileges the current user can use.  This means there is
230    some chain of role grants from the current user to the role in
231    question.  The current user itself is also an applicable role.  The
232    set of applicable roles is generally used for permission checking.
233    <indexterm><primary>applicable role</primary></indexterm>
234    <indexterm><primary>role</primary><secondary>applicable</secondary></indexterm>
235   </para>
236
237   <table>
238    <title><literal>applicable_roles</literal> Columns</title>
239
240    <tgroup cols="3">
241     <thead>
242      <row>
243       <entry>Name</entry>
244       <entry>Data Type</entry>
245       <entry>Description</entry>
246      </row>
247     </thead>
248
249     <tbody>
250      <row>
251       <entry><literal>grantee</literal></entry>
252       <entry><type>sql_identifier</type></entry>
253       <entry>
254        Name of the role to which this role membership was granted (can
255        be the current user, or a different role in case of nested role
256        memberships)
257       </entry>
258      </row>
259
260      <row>
261       <entry><literal>role_name</literal></entry>
262       <entry><type>sql_identifier</type></entry>
263       <entry>Name of a role</entry>
264      </row>
265
266      <row>
267       <entry><literal>is_grantable</literal></entry>
268       <entry><type>yes_or_no</type></entry>
269       <entry>
270        <literal>YES</literal> if the grantee has the admin option on
271        the role, <literal>NO</literal> if not
272       </entry>
273      </row>
274     </tbody>
275    </tgroup>
276   </table>
277  </sect1>
278
279  <sect1 id="infoschema-attributes">
280   <title><literal>attributes</literal></title>
281
282   <para>
283    The view <literal>attributes</literal> contains information about
284    the attributes of composite data types defined in the database.
285    (Note that the view does not give information about table columns,
286    which are sometimes called attributes in PostgreSQL contexts.)
287    Only those attributes are shown that the current user has access to (by way
288    of being the owner of or having some privilege on the type).
289   </para>
290
291   <table>
292    <title><literal>attributes</literal> Columns</title>
293
294    <tgroup cols="3">
295     <thead>
296      <row>
297       <entry>Name</entry>
298       <entry>Data Type</entry>
299       <entry>Description</entry>
300      </row>
301     </thead>
302
303     <tbody>
304      <row>
305       <entry><literal>udt_catalog</literal></entry>
306       <entry><type>sql_identifier</type></entry>
307       <entry>Name of the database containing the data type (always the current database)</entry>
308      </row>
309
310      <row>
311       <entry><literal>udt_schema</literal></entry>
312       <entry><type>sql_identifier</type></entry>
313       <entry>Name of the schema containing the data type</entry>
314      </row>
315
316      <row>
317       <entry><literal>udt_name</literal></entry>
318       <entry><type>sql_identifier</type></entry>
319       <entry>Name of the data type</entry>
320      </row>
321
322      <row>
323       <entry><literal>attribute_name</literal></entry>
324       <entry><type>sql_identifier</type></entry>
325       <entry>Name of the attribute</entry>
326      </row>
327
328      <row>
329       <entry><literal>ordinal_position</literal></entry>
330       <entry><type>cardinal_number</type></entry>
331       <entry>Ordinal position of the attribute within the data type (count starts at 1)</entry>
332      </row>
333
334      <row>
335       <entry><literal>attribute_default</literal></entry>
336       <entry><type>character_data</type></entry>
337       <entry>Default expression of the attribute</entry>
338      </row>
339
340      <row>
341       <entry><literal>is_nullable</literal></entry>
342       <entry><type>yes_or_no</type></entry>
343       <entry>
344        <literal>YES</literal> if the attribute is possibly nullable,
345        <literal>NO</literal> if it is known not nullable.
346       </entry>
347      </row>
348
349      <row>
350       <entry><literal>data_type</literal></entry>
351       <entry><type>character_data</type></entry>
352       <entry>
353        Data type of the attribute, if it is a built-in type, or
354        <literal>ARRAY</literal> if it is some array (in that case, see
355        the view <literal>element_types</literal>), else
356        <literal>USER-DEFINED</literal> (in that case, the type is
357        identified in <literal>attribute_udt_name</literal> and
358        associated columns).
359       </entry>
360      </row>
361
362      <row>
363       <entry><literal>character_maximum_length</literal></entry>
364       <entry><type>cardinal_number</type></entry>
365       <entry>
366        If <literal>data_type</literal> identifies a character or bit
367        string type, the declared maximum length; null for all other
368        data types or if no maximum length was declared.
369       </entry>
370      </row>
371
372      <row>
373       <entry><literal>character_octet_length</literal></entry>
374       <entry><type>cardinal_number</type></entry>
375       <entry>
376        If <literal>data_type</literal> identifies a character type,
377        the maximum possible length in octets (bytes) of a datum; null
378        for all other data types.  The maximum octet length depends on
379        the declared character maximum length (see above) and the
380        server encoding.
381       </entry>
382      </row>
383
384      <row>
385       <entry><literal>character_set_catalog</literal></entry>
386       <entry><type>sql_identifier</type></entry>
387       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
388      </row>
389
390      <row>
391       <entry><literal>character_set_schema</literal></entry>
392       <entry><type>sql_identifier</type></entry>
393       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
394      </row>
395
396      <row>
397       <entry><literal>character_set_name</literal></entry>
398       <entry><type>sql_identifier</type></entry>
399       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
400      </row>
401
402      <row>
403       <entry><literal>collation_catalog</literal></entry>
404       <entry><type>sql_identifier</type></entry>
405       <entry>
406        Name of the database containing the collation of the attribute
407        (always the current database), null if default or the data type
408        of the attribute is not collatable
409       </entry>
410      </row>
411
412      <row>
413       <entry><literal>collation_schema</literal></entry>
414       <entry><type>sql_identifier</type></entry>
415       <entry>
416        Name of the schema containing the collation of the attribute,
417        null if default or the data type of the attribute is not
418        collatable
419       </entry>
420      </row>
421
422      <row>
423       <entry><literal>collation_name</literal></entry>
424       <entry><type>sql_identifier</type></entry>
425       <entry>
426        Name of the collation of the attribute, null if default or the
427        data type of the attribute is not collatable
428       </entry>
429      </row>
430
431      <row>
432       <entry><literal>numeric_precision</literal></entry>
433       <entry><type>cardinal_number</type></entry>
434       <entry>
435        If <literal>data_type</literal> identifies a numeric type, this
436        column contains the (declared or implicit) precision of the
437        type for this attribute.  The precision indicates the number of
438        significant digits.  It can be expressed in decimal (base 10)
439        or binary (base 2) terms, as specified in the column
440        <literal>numeric_precision_radix</literal>.  For all other data
441        types, this column is null.
442       </entry>
443      </row>
444
445      <row>
446       <entry><literal>numeric_precision_radix</literal></entry>
447       <entry><type>cardinal_number</type></entry>
448       <entry>
449        If <literal>data_type</literal> identifies a numeric type, this
450        column indicates in which base the values in the columns
451        <literal>numeric_precision</literal> and
452        <literal>numeric_scale</literal> are expressed.  The value is
453        either 2 or 10.  For all other data types, this column is null.
454       </entry>
455      </row>
456
457      <row>
458       <entry><literal>numeric_scale</literal></entry>
459       <entry><type>cardinal_number</type></entry>
460       <entry>
461        If <literal>data_type</literal> identifies an exact numeric
462        type, this column contains the (declared or implicit) scale of
463        the type for this attribute.  The scale indicates the number of
464        significant digits to the right of the decimal point.  It can
465        be expressed in decimal (base 10) or binary (base 2) terms, as
466        specified in the column
467        <literal>numeric_precision_radix</literal>.  For all other data
468        types, this column is null.
469       </entry>
470      </row>
471
472      <row>
473       <entry><literal>datetime_precision</literal></entry>
474       <entry><type>cardinal_number</type></entry>
475       <entry>
476        If <literal>data_type</literal> identifies a date, time,
477        timestamp, or interval type, this column contains the (declared
478        or implicit) fractional seconds precision of the type for this
479        attribute, that is, the number of decimal digits maintained
480        following the decimal point in the seconds value.  For all
481        other data types, this column is null.
482       </entry>
483      </row>
484
485      <row>
486       <entry><literal>interval_type</literal></entry>
487       <entry><type>character_data</type></entry>
488       <entry>
489        If <literal>data_type</literal> identifies an interval type,
490        this column contains the specification which fields the
491        intervals include for this attribute, e.g., <literal>YEAR TO
492        MONTH</literal>, <literal>DAY TO SECOND</literal>, etc.  If no
493        field restrictions were specified (that is, the interval
494        accepts all fields), and for all other data types, this field
495        is null.
496       </entry>
497      </row>
498
499      <row>
500       <entry><literal>interval_precision</literal></entry>
501       <entry><type>cardinal_number</type></entry>
502       <entry>
503        Applies to a feature not available
504        in <productname>PostgreSQL</productname>
505        (see <literal>datetime_precision</literal> for the fractional
506        seconds precision of interval type attributes)
507       </entry>
508      </row>
509
510      <row>
511       <entry><literal>attribute_udt_catalog</literal></entry>
512       <entry><type>sql_identifier</type></entry>
513       <entry>
514        Name of the database that the attribute data type is defined in
515        (always the current database)
516       </entry>
517      </row>
518
519      <row>
520       <entry><literal>attribute_udt_schema</literal></entry>
521       <entry><type>sql_identifier</type></entry>
522       <entry>
523        Name of the schema that the attribute data type is defined in
524       </entry>
525      </row>
526
527      <row>
528       <entry><literal>attribute_udt_name</literal></entry>
529       <entry><type>sql_identifier</type></entry>
530       <entry>
531        Name of the attribute data type
532       </entry>
533      </row>
534
535      <row>
536       <entry><literal>scope_catalog</literal></entry>
537       <entry><type>sql_identifier</type></entry>
538       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
539      </row>
540
541      <row>
542       <entry><literal>scope_schema</literal></entry>
543       <entry><type>sql_identifier</type></entry>
544       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
545      </row>
546
547      <row>
548       <entry><literal>scope_name</literal></entry>
549       <entry><type>sql_identifier</type></entry>
550       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
551      </row>
552
553      <row>
554       <entry><literal>maximum_cardinality</literal></entry>
555       <entry><type>cardinal_number</type></entry>
556       <entry>Always null, because arrays always have unlimited maximum cardinality in <productname>PostgreSQL</productname></entry>
557      </row>
558
559      <row>
560       <entry><literal>dtd_identifier</literal></entry>
561       <entry><type>sql_identifier</type></entry>
562       <entry>
563        An identifier of the data type descriptor of the column, unique
564        among the data type descriptors pertaining to the table.  This
565        is mainly useful for joining with other instances of such
566        identifiers.  (The specific format of the identifier is not
567        defined and not guaranteed to remain the same in future
568        versions.)
569       </entry>
570      </row>
571
572      <row>
573       <entry><literal>is_derived_reference_attribute</literal></entry>
574       <entry><type>yes_or_no</type></entry>
575       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
576      </row>
577     </tbody>
578    </tgroup>
579   </table>
580
581   <para>
582    See also under <xref linkend="infoschema-columns"/>, a similarly
583    structured view, for further information on some of the columns.
584   </para>
585  </sect1>
586
587  <sect1 id="infoschema-character-sets">
588   <title><literal>character_sets</literal></title>
589
590   <para>
591    The view <literal>character_sets</literal> identifies the character
592    sets available in the current database.  Since PostgreSQL does not
593    support multiple character sets within one database, this view only
594    shows one, which is the database encoding.
595   </para>
596
597   <para>
598    Take note of how the following terms are used in the SQL standard:
599    <variablelist>
600     <varlistentry>
601      <term>character repertoire</term>
602      <listitem>
603       <para>
604        An abstract collection of characters, for
605        example <literal>UNICODE</literal>, <literal>UCS</literal>, or
606        <literal>LATIN1</literal>.  Not exposed as an SQL object, but
607        visible in this view.
608       </para>
609      </listitem>
610     </varlistentry>
611
612     <varlistentry>
613      <term>character encoding form</term>
614      <listitem>
615       <para>
616        An encoding of some character repertoire.  Most older character
617        repertoires only use one encoding form, and so there are no
618        separate names for them (e.g., <literal>LATIN1</literal> is an
619        encoding form applicable to the <literal>LATIN1</literal>
620        repertoire).  But for example Unicode has the encoding forms
621        <literal>UTF8</literal>, <literal>UTF16</literal>, etc. (not
622        all supported by PostgreSQL).  Encoding forms are not exposed
623        as an SQL object, but are visible in this view.
624       </para>
625      </listitem>
626     </varlistentry>
627
628     <varlistentry>
629      <term>character set</term>
630      <listitem>
631       <para>
632        A named SQL object that identifies a character repertoire, a
633        character encoding, and a default collation.  A predefined
634        character set would typically have the same name as an encoding
635        form, but users could define other names.  For example, the
636        character set <literal>UTF8</literal> would typically identify
637        the character repertoire <literal>UCS</literal>, encoding
638        form <literal>UTF8</literal>, and some default collation.
639       </para>
640      </listitem>
641     </varlistentry>
642    </variablelist>
643
644    You can think of an <quote>encoding</quote> in PostgreSQL either as
645    a character set or a character encoding form.  They will have the
646    same name, and there can only be one in one database.
647   </para>
648
649   <table>
650    <title><literal>character_sets</literal> Columns</title>
651
652    <tgroup cols="3">
653     <thead>
654      <row>
655       <entry>Name</entry>
656       <entry>Data Type</entry>
657       <entry>Description</entry>
658      </row>
659     </thead>
660
661     <tbody>
662      <row>
663       <entry><literal>character_set_catalog</literal></entry>
664       <entry><literal>sql_identifier</literal></entry>
665       <entry>Character sets are currently not implemented as schema objects, so this column is null.</entry>
666      </row>
667
668      <row>
669       <entry><literal>character_set_schema</literal></entry>
670       <entry><literal>sql_identifier</literal></entry>
671       <entry>Character sets are currently not implemented as schema objects, so this column is null.</entry>
672      </row>
673
674      <row>
675       <entry><literal>character_set_name</literal></entry>
676       <entry><literal>sql_identifier</literal></entry>
677       <entry>Name of the character set, currently implemented as showing the name of the database encoding</entry>
678      </row>
679
680      <row>
681       <entry><literal>character_repertoire</literal></entry>
682       <entry><literal>sql_identifier</literal></entry>
683       <entry>Character repertoire, showing <literal>UCS</literal> if the encoding is <literal>UTF8</literal>, else just the encoding name</entry>
684      </row>
685
686      <row>
687       <entry><literal>form_of_use</literal></entry>
688       <entry><literal>sql_identifier</literal></entry>
689       <entry>Character encoding form, same as the database encoding</entry>
690      </row>
691
692      <row>
693       <entry><literal>default_collate_catalog</literal></entry>
694       <entry><literal>sql_identifier</literal></entry>
695       <entry>Name of the database containing the default collation (always the current database, if any collation is identified)</entry>
696      </row>
697
698      <row>
699       <entry><literal>default_collate_schema</literal></entry>
700       <entry><literal>sql_identifier</literal></entry>
701       <entry>Name of the schema containing the default collation</entry>
702      </row>
703
704      <row>
705       <entry><literal>default_collate_name</literal></entry>
706       <entry><literal>sql_identifier</literal></entry>
707       <entry>
708        Name of the default collation.  The default collation is
709        identified as the collation that matches
710        the <literal>COLLATE</literal> and <literal>CTYPE</literal>
711        settings of the current database.  If there is no such
712        collation, then this column and the associated schema and
713        catalog columns are null.
714       </entry>
715      </row>
716     </tbody>
717    </tgroup>
718   </table>
719  </sect1>
720
721  <sect1 id="infoschema-check-constraint-routine-usage">
722   <title><literal>check_constraint_routine_usage</literal></title>
723
724   <para>
725    The view <literal>check_constraint_routine_usage</literal>
726    identifies routines (functions and procedures) that are used by a
727    check constraint.  Only those routines are shown that are owned by
728    a currently enabled role.
729   </para>
730
731   <table>
732    <title><literal>check_constraint_routine_usage</literal> Columns</title>
733
734    <tgroup cols="3">
735     <thead>
736      <row>
737       <entry>Name</entry>
738       <entry>Data Type</entry>
739       <entry>Description</entry>
740      </row>
741     </thead>
742
743     <tbody>
744      <row>
745       <entry><literal>constraint_catalog</literal></entry>
746       <entry><literal>sql_identifier</literal></entry>
747       <entry>Name of the database containing the constraint (always the current database)</entry>
748      </row>
749
750      <row>
751       <entry><literal>constraint_schema</literal></entry>
752       <entry><literal>sql_identifier</literal></entry>
753       <entry>Name of the schema containing the constraint</entry>
754      </row>
755
756      <row>
757       <entry><literal>constraint_name</literal></entry>
758       <entry><literal>sql_identifier</literal></entry>
759       <entry>Name of the constraint</entry>
760      </row>
761
762      <row>
763       <entry><literal>specific_catalog</literal></entry>
764       <entry><literal>sql_identifier</literal></entry>
765       <entry>Name of the database containing the function (always the current database)</entry>
766      </row>
767
768      <row>
769       <entry><literal>specific_schema</literal></entry>
770       <entry><literal>sql_identifier</literal></entry>
771       <entry>Name of the schema containing the function</entry>
772      </row>
773
774      <row>
775       <entry><literal>specific_name</literal></entry>
776       <entry><literal>sql_identifier</literal></entry>
777       <entry>
778        The <quote>specific name</quote> of the function.  See <xref
779        linkend="infoschema-routines"/> for more information.
780       </entry>
781      </row>
782     </tbody>
783    </tgroup>
784   </table>
785  </sect1>
786
787  <sect1 id="infoschema-check-constraints">
788   <title><literal>check_constraints</literal></title>
789
790   <para>
791    The view <literal>check_constraints</literal> contains all check
792    constraints, either defined on a table or on a domain, that are
793    owned by a currently enabled role.  (The owner of the table or
794    domain is the owner of the constraint.)
795   </para>
796
797   <table>
798    <title><literal>check_constraints</literal> Columns</title>
799
800    <tgroup cols="3">
801     <thead>
802      <row>
803       <entry>Name</entry>
804       <entry>Data Type</entry>
805       <entry>Description</entry>
806      </row>
807     </thead>
808
809     <tbody>
810      <row>
811       <entry><literal>constraint_catalog</literal></entry>
812       <entry><literal>sql_identifier</literal></entry>
813       <entry>Name of the database containing the constraint (always the current database)</entry>
814      </row>
815
816      <row>
817       <entry><literal>constraint_schema</literal></entry>
818       <entry><literal>sql_identifier</literal></entry>
819       <entry>Name of the schema containing the constraint</entry>
820      </row>
821
822      <row>
823       <entry><literal>constraint_name</literal></entry>
824       <entry><literal>sql_identifier</literal></entry>
825       <entry>Name of the constraint</entry>
826      </row>
827
828      <row>
829       <entry><literal>check_clause</literal></entry>
830       <entry><literal>character_data</literal></entry>
831       <entry>The check expression of the check constraint</entry>
832      </row>
833     </tbody>
834    </tgroup>
835   </table>
836  </sect1>
837
838  <sect1 id="infoschema-collations">
839   <title><literal>collations</literal></title>
840
841   <para>
842    The view <literal>collations</literal> contains the collations
843    available in the current database.
844   </para>
845
846   <table>
847    <title><literal>collations</literal> Columns</title>
848
849    <tgroup cols="3">
850     <thead>
851      <row>
852       <entry>Name</entry>
853       <entry>Data Type</entry>
854       <entry>Description</entry>
855      </row>
856     </thead>
857
858     <tbody>
859      <row>
860       <entry><literal>collation_catalog</literal></entry>
861       <entry><literal>sql_identifier</literal></entry>
862       <entry>Name of the database containing the collation (always the current database)</entry>
863      </row>
864
865      <row>
866       <entry><literal>collation_schema</literal></entry>
867       <entry><literal>sql_identifier</literal></entry>
868       <entry>Name of the schema containing the collation</entry>
869      </row>
870
871      <row>
872       <entry><literal>collation_name</literal></entry>
873       <entry><literal>sql_identifier</literal></entry>
874       <entry>Name of the default collation</entry>
875      </row>
876
877      <row>
878       <entry><literal>pad_attribute</literal></entry>
879       <entry><literal>character_data</literal></entry>
880       <entry>
881        Always <literal>NO PAD</literal> (The alternative <literal>PAD
882        SPACE</literal> is not supported by PostgreSQL.)
883       </entry>
884      </row>
885     </tbody>
886    </tgroup>
887   </table>
888  </sect1>
889
890  <sect1 id="infoschema-collation-character-set-applicab"> <!-- max 44 characters -->
891   <title><literal>collation_character_set_applicability</literal></title>
892
893   <para>
894    The view <literal>collation_character_set_applicability</literal>
895    identifies which character set the available collations are
896    applicable to.  In PostgreSQL, there is only one character set per
897    database (see explanation
898    in <xref linkend="infoschema-character-sets"/>), so this view does
899    not provide much useful information.
900   </para>
901
902   <table>
903    <title><literal>collation_character_set_applicability</literal> Columns</title>
904
905    <tgroup cols="3">
906     <thead>
907      <row>
908       <entry>Name</entry>
909       <entry>Data Type</entry>
910       <entry>Description</entry>
911      </row>
912     </thead>
913
914     <tbody>
915      <row>
916       <entry><literal>collation_catalog</literal></entry>
917       <entry><literal>sql_identifier</literal></entry>
918       <entry>Name of the database containing the collation (always the current database)</entry>
919      </row>
920
921      <row>
922       <entry><literal>collation_schema</literal></entry>
923       <entry><literal>sql_identifier</literal></entry>
924       <entry>Name of the schema containing the collation</entry>
925      </row>
926
927      <row>
928       <entry><literal>collation_name</literal></entry>
929       <entry><literal>sql_identifier</literal></entry>
930       <entry>Name of the default collation</entry>
931      </row>
932
933      <row>
934       <entry><literal>character_set_catalog</literal></entry>
935       <entry><literal>sql_identifier</literal></entry>
936       <entry>Character sets are currently not implemented as schema objects, so this column is null</entry>
937      </row>
938
939      <row>
940       <entry><literal>character_set_schema</literal></entry>
941       <entry><literal>sql_identifier</literal></entry>
942       <entry>Character sets are currently not implemented as schema objects, so this column is null</entry>
943      </row>
944
945      <row>
946       <entry><literal>character_set_name</literal></entry>
947       <entry><literal>sql_identifier</literal></entry>
948       <entry>Name of the character set</entry>
949      </row>
950     </tbody>
951    </tgroup>
952   </table>
953  </sect1>
954
955  <sect1 id="infoschema-column-column-usage">
956   <title><literal>column_column_usage</literal></title>
957
958   <para>
959    The view <literal>column_column_usage</literal> identifies all generated
960    columns that depend on another base column in the same table.  Only tables
961    owned by a currently enabled role are included.
962   </para>
963
964   <table>
965    <title><literal>column_column_usage</literal> Columns</title>
966
967    <tgroup cols="3">
968     <thead>
969      <row>
970       <entry>Name</entry>
971       <entry>Data Type</entry>
972       <entry>Description</entry>
973      </row>
974     </thead>
975
976     <tbody>
977      <row>
978       <entry><literal>table_catalog</literal></entry>
979       <entry><type>sql_identifier</type></entry>
980       <entry>Name of the database containing the table (always the current database)</entry>
981      </row>
982
983      <row>
984       <entry><literal>table_schema</literal></entry>
985       <entry><type>sql_identifier</type></entry>
986       <entry>Name of the schema containing the table</entry>
987      </row>
988
989      <row>
990       <entry><literal>table_name</literal></entry>
991       <entry><type>sql_identifier</type></entry>
992       <entry>Name of the table</entry>
993      </row>
994
995      <row>
996       <entry><literal>column_name</literal></entry>
997       <entry><type>sql_identifier</type></entry>
998       <entry>Name of the base column that a generated column depends on</entry>
999      </row>
1000
1001      <row>
1002       <entry><literal>dependent_column</literal></entry>
1003       <entry><type>sql_identifier</type></entry>
1004       <entry>Name of the generated column</entry>
1005      </row>
1006     </tbody>
1007    </tgroup>
1008   </table>
1009  </sect1>
1010
1011  <sect1 id="infoschema-column-domain-usage">
1012   <title><literal>column_domain_usage</literal></title>
1013
1014   <para>
1015    The view <literal>column_domain_usage</literal> identifies all
1016    columns (of a table or a view) that make use of some domain defined
1017    in the current database and owned by a currently enabled role.
1018   </para>
1019
1020   <table>
1021    <title><literal>column_domain_usage</literal> Columns</title>
1022
1023    <tgroup cols="3">
1024     <thead>
1025      <row>
1026       <entry>Name</entry>
1027       <entry>Data Type</entry>
1028       <entry>Description</entry>
1029      </row>
1030     </thead>
1031
1032     <tbody>
1033      <row>
1034       <entry><literal>domain_catalog</literal></entry>
1035       <entry><type>sql_identifier</type></entry>
1036       <entry>Name of the database containing the domain (always the current database)</entry>
1037      </row>
1038
1039      <row>
1040       <entry><literal>domain_schema</literal></entry>
1041       <entry><type>sql_identifier</type></entry>
1042       <entry>Name of the schema containing the domain</entry>
1043      </row>
1044
1045      <row>
1046       <entry><literal>domain_name</literal></entry>
1047       <entry><type>sql_identifier</type></entry>
1048       <entry>Name of the domain</entry>
1049      </row>
1050
1051      <row>
1052       <entry><literal>table_catalog</literal></entry>
1053       <entry><type>sql_identifier</type></entry>
1054       <entry>Name of the database containing the table (always the current database)</entry>
1055      </row>
1056
1057      <row>
1058       <entry><literal>table_schema</literal></entry>
1059       <entry><type>sql_identifier</type></entry>
1060       <entry>Name of the schema containing the table</entry>
1061      </row>
1062
1063      <row>
1064       <entry><literal>table_name</literal></entry>
1065       <entry><type>sql_identifier</type></entry>
1066       <entry>Name of the table</entry>
1067      </row>
1068
1069      <row>
1070       <entry><literal>column_name</literal></entry>
1071       <entry><type>sql_identifier</type></entry>
1072       <entry>Name of the column</entry>
1073      </row>
1074     </tbody>
1075    </tgroup>
1076   </table>
1077  </sect1>
1078
1079  <sect1 id="infoschema-column-options">
1080   <title><literal>column_options</literal></title>
1081
1082   <para>
1083    The view <literal>column_options</literal> contains all the
1084    options defined for foreign table columns in the current database.  Only
1085    those foreign table columns are shown that the current user has access to
1086    (by way of being the owner or having some privilege).
1087   </para>
1088
1089   <table>
1090    <title><literal>column_options</literal> Columns</title>
1091
1092    <tgroup cols="3">
1093     <thead>
1094      <row>
1095       <entry>Name</entry>
1096       <entry>Data Type</entry>
1097       <entry>Description</entry>
1098      </row>
1099     </thead>
1100
1101     <tbody>
1102      <row>
1103       <entry><literal>table_catalog</literal></entry>
1104       <entry><type>sql_identifier</type></entry>
1105       <entry>Name of the database that contains the foreign table (always the current database)</entry>
1106      </row>
1107
1108      <row>
1109       <entry><literal>table_schema</literal></entry>
1110       <entry><type>sql_identifier</type></entry>
1111       <entry>Name of the schema that contains the foreign table</entry>
1112      </row>
1113
1114      <row>
1115       <entry><literal>table_name</literal></entry>
1116       <entry><type>sql_identifier</type></entry>
1117       <entry>Name of the foreign table</entry>
1118      </row>
1119
1120      <row>
1121       <entry><literal>column_name</literal></entry>
1122       <entry><type>sql_identifier</type></entry>
1123       <entry>Name of the column</entry>
1124      </row>
1125
1126      <row>
1127       <entry><literal>option_name</literal></entry>
1128       <entry><type>sql_identifier</type></entry>
1129       <entry>Name of an option</entry>
1130      </row>
1131
1132      <row>
1133       <entry><literal>option_value</literal></entry>
1134       <entry><type>character_data</type></entry>
1135       <entry>Value of the option</entry>
1136      </row>
1137     </tbody>
1138    </tgroup>
1139   </table>
1140  </sect1>
1141
1142  <sect1 id="infoschema-column-privileges">
1143   <title><literal>column_privileges</literal></title>
1144
1145   <para>
1146    The view <literal>column_privileges</literal> identifies all
1147    privileges granted on columns to a currently enabled role or by a
1148    currently enabled role.  There is one row for each combination of
1149    column, grantor, and grantee.
1150   </para>
1151
1152   <para>
1153    If a privilege has been granted on an entire table, it will show up in
1154    this view as a grant for each column, but only for the
1155    privilege types where column granularity is possible:
1156    <literal>SELECT</literal>, <literal>INSERT</literal>,
1157    <literal>UPDATE</literal>, <literal>REFERENCES</literal>.
1158   </para>
1159
1160   <table>
1161    <title><literal>column_privileges</literal> Columns</title>
1162
1163    <tgroup cols="3">
1164     <thead>
1165      <row>
1166       <entry>Name</entry>
1167       <entry>Data Type</entry>
1168       <entry>Description</entry>
1169      </row>
1170     </thead>
1171
1172     <tbody>
1173      <row>
1174       <entry><literal>grantor</literal></entry>
1175       <entry><type>sql_identifier</type></entry>
1176       <entry>Name of the role that granted the privilege</entry>
1177      </row>
1178
1179      <row>
1180       <entry><literal>grantee</literal></entry>
1181       <entry><type>sql_identifier</type></entry>
1182       <entry>Name of the role that the privilege was granted to</entry>
1183      </row>
1184
1185      <row>
1186       <entry><literal>table_catalog</literal></entry>
1187       <entry><type>sql_identifier</type></entry>
1188       <entry>Name of the database that contains the table that contains the column (always the current database)</entry>
1189      </row>
1190
1191      <row>
1192       <entry><literal>table_schema</literal></entry>
1193       <entry><type>sql_identifier</type></entry>
1194       <entry>Name of the schema that contains the table that contains the column</entry>
1195      </row>
1196
1197      <row>
1198       <entry><literal>table_name</literal></entry>
1199       <entry><type>sql_identifier</type></entry>
1200       <entry>Name of the table that contains the column</entry>
1201      </row>
1202
1203      <row>
1204       <entry><literal>column_name</literal></entry>
1205       <entry><type>sql_identifier</type></entry>
1206       <entry>Name of the column</entry>
1207      </row>
1208
1209      <row>
1210       <entry><literal>privilege_type</literal></entry>
1211       <entry><type>character_data</type></entry>
1212       <entry>
1213        Type of the privilege: <literal>SELECT</literal>,
1214        <literal>INSERT</literal>, <literal>UPDATE</literal>, or
1215        <literal>REFERENCES</literal>
1216       </entry>
1217      </row>
1218
1219      <row>
1220       <entry><literal>is_grantable</literal></entry>
1221       <entry><type>yes_or_no</type></entry>
1222       <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
1223      </row>
1224     </tbody>
1225    </tgroup>
1226   </table>
1227  </sect1>
1228
1229  <sect1 id="infoschema-column-udt-usage">
1230   <title><literal>column_udt_usage</literal></title>
1231
1232   <para>
1233    The view <literal>column_udt_usage</literal> identifies all columns
1234    that use data types owned by a currently enabled role.  Note that in
1235    <productname>PostgreSQL</productname>, built-in data types behave
1236    like user-defined types, so they are included here as well.  See
1237    also <xref linkend="infoschema-columns"/> for details.
1238   </para>
1239
1240   <table>
1241    <title><literal>column_udt_usage</literal> Columns</title>
1242
1243    <tgroup cols="3">
1244     <thead>
1245      <row>
1246       <entry>Name</entry>
1247       <entry>Data Type</entry>
1248       <entry>Description</entry>
1249      </row>
1250     </thead>
1251
1252     <tbody>
1253      <row>
1254       <entry><literal>udt_catalog</literal></entry>
1255       <entry><type>sql_identifier</type></entry>
1256       <entry>
1257        Name of the database that the column data type (the underlying
1258        type of the domain, if applicable) is defined in (always the
1259        current database)
1260       </entry>
1261      </row>
1262
1263      <row>
1264       <entry><literal>udt_schema</literal></entry>
1265       <entry><type>sql_identifier</type></entry>
1266       <entry>
1267        Name of the schema that the column data type (the underlying
1268        type of the domain, if applicable) is defined in
1269       </entry>
1270      </row>
1271
1272      <row>
1273       <entry><literal>udt_name</literal></entry>
1274       <entry><type>sql_identifier</type></entry>
1275       <entry>
1276        Name of the column data type (the underlying type of the
1277        domain, if applicable)
1278       </entry>
1279      </row>
1280
1281      <row>
1282       <entry><literal>table_catalog</literal></entry>
1283       <entry><type>sql_identifier</type></entry>
1284       <entry>Name of the database containing the table (always the current database)</entry>
1285      </row>
1286
1287      <row>
1288       <entry><literal>table_schema</literal></entry>
1289       <entry><type>sql_identifier</type></entry>
1290       <entry>Name of the schema containing the table</entry>
1291      </row>
1292
1293      <row>
1294       <entry><literal>table_name</literal></entry>
1295       <entry><type>sql_identifier</type></entry>
1296       <entry>Name of the table</entry>
1297      </row>
1298
1299      <row>
1300       <entry><literal>column_name</literal></entry>
1301       <entry><type>sql_identifier</type></entry>
1302       <entry>Name of the column</entry>
1303      </row>
1304     </tbody>
1305    </tgroup>
1306   </table>
1307  </sect1>
1308
1309  <sect1 id="infoschema-columns">
1310   <title><literal>columns</literal></title>
1311
1312   <para>
1313    The view <literal>columns</literal> contains information about all
1314    table columns (or view columns) in the database.  System columns
1315    (<literal>ctid</literal>, etc.) are not included.  Only those columns are
1316    shown that the current user has access to (by way of being the
1317    owner or having some privilege).
1318   </para>
1319
1320   <table>
1321    <title><literal>columns</literal> Columns</title>
1322
1323    <tgroup cols="3">
1324     <thead>
1325      <row>
1326       <entry>Name</entry>
1327       <entry>Data Type</entry>
1328       <entry>Description</entry>
1329      </row>
1330     </thead>
1331
1332     <tbody>
1333      <row>
1334       <entry><literal>table_catalog</literal></entry>
1335       <entry><type>sql_identifier</type></entry>
1336       <entry>Name of the database containing the table (always the current database)</entry>
1337      </row>
1338
1339      <row>
1340       <entry><literal>table_schema</literal></entry>
1341       <entry><type>sql_identifier</type></entry>
1342       <entry>Name of the schema containing the table</entry>
1343      </row>
1344
1345      <row>
1346       <entry><literal>table_name</literal></entry>
1347       <entry><type>sql_identifier</type></entry>
1348       <entry>Name of the table</entry>
1349      </row>
1350
1351      <row>
1352       <entry><literal>column_name</literal></entry>
1353       <entry><type>sql_identifier</type></entry>
1354       <entry>Name of the column</entry>
1355      </row>
1356
1357      <row>
1358       <entry><literal>ordinal_position</literal></entry>
1359       <entry><type>cardinal_number</type></entry>
1360       <entry>Ordinal position of the column within the table (count starts at 1)</entry>
1361      </row>
1362
1363      <row>
1364       <entry><literal>column_default</literal></entry>
1365       <entry><type>character_data</type></entry>
1366       <entry>Default expression of the column</entry>
1367      </row>
1368
1369      <row>
1370       <entry><literal>is_nullable</literal></entry>
1371       <entry><type>yes_or_no</type></entry>
1372       <entry>
1373        <literal>YES</literal> if the column is possibly nullable,
1374        <literal>NO</literal> if it is known not nullable.  A not-null
1375        constraint is one way a column can be known not nullable, but
1376        there can be others.
1377       </entry>
1378      </row>
1379
1380      <row>
1381       <entry><literal>data_type</literal></entry>
1382       <entry><type>character_data</type></entry>
1383       <entry>
1384        Data type of the column, if it is a built-in type, or
1385        <literal>ARRAY</literal> if it is some array (in that case, see
1386        the view <literal>element_types</literal>), else
1387        <literal>USER-DEFINED</literal> (in that case, the type is
1388        identified in <literal>udt_name</literal> and associated
1389        columns).  If the column is based on a domain, this column
1390        refers to the type underlying the domain (and the domain is
1391        identified in <literal>domain_name</literal> and associated
1392        columns).
1393       </entry>
1394      </row>
1395
1396      <row>
1397       <entry><literal>character_maximum_length</literal></entry>
1398       <entry><type>cardinal_number</type></entry>
1399       <entry>
1400        If <literal>data_type</literal> identifies a character or bit
1401        string type, the declared maximum length; null for all other
1402        data types or if no maximum length was declared.
1403       </entry>
1404      </row>
1405
1406      <row>
1407       <entry><literal>character_octet_length</literal></entry>
1408       <entry><type>cardinal_number</type></entry>
1409       <entry>
1410        If <literal>data_type</literal> identifies a character type,
1411        the maximum possible length in octets (bytes) of a datum; null
1412        for all other data types.  The maximum octet length depends on
1413        the declared character maximum length (see above) and the
1414        server encoding.
1415       </entry>
1416      </row>
1417
1418      <row>
1419       <entry><literal>numeric_precision</literal></entry>
1420       <entry><type>cardinal_number</type></entry>
1421       <entry>
1422        If <literal>data_type</literal> identifies a numeric type, this
1423        column contains the (declared or implicit) precision of the
1424        type for this column.  The precision indicates the number of
1425        significant digits.  It can be expressed in decimal (base 10)
1426        or binary (base 2) terms, as specified in the column
1427        <literal>numeric_precision_radix</literal>.  For all other data
1428        types, this column is null.
1429       </entry>
1430      </row>
1431
1432      <row>
1433       <entry><literal>numeric_precision_radix</literal></entry>
1434       <entry><type>cardinal_number</type></entry>
1435       <entry>
1436        If <literal>data_type</literal> identifies a numeric type, this
1437        column indicates in which base the values in the columns
1438        <literal>numeric_precision</literal> and
1439        <literal>numeric_scale</literal> are expressed.  The value is
1440        either 2 or 10.  For all other data types, this column is null.
1441       </entry>
1442      </row>
1443
1444      <row>
1445       <entry><literal>numeric_scale</literal></entry>
1446       <entry><type>cardinal_number</type></entry>
1447       <entry>
1448        If <literal>data_type</literal> identifies an exact numeric
1449        type, this column contains the (declared or implicit) scale of
1450        the type for this column.  The scale indicates the number of
1451        significant digits to the right of the decimal point.  It can
1452        be expressed in decimal (base 10) or binary (base 2) terms, as
1453        specified in the column
1454        <literal>numeric_precision_radix</literal>.  For all other data
1455        types, this column is null.
1456       </entry>
1457      </row>
1458
1459      <row>
1460       <entry><literal>datetime_precision</literal></entry>
1461       <entry><type>cardinal_number</type></entry>
1462       <entry>
1463        If <literal>data_type</literal> identifies a date, time,
1464        timestamp, or interval type, this column contains the (declared
1465        or implicit) fractional seconds precision of the type for this
1466        column, that is, the number of decimal digits maintained
1467        following the decimal point in the seconds value.  For all
1468        other data types, this column is null.
1469       </entry>
1470      </row>
1471
1472      <row>
1473       <entry><literal>interval_type</literal></entry>
1474       <entry><type>character_data</type></entry>
1475       <entry>
1476        If <literal>data_type</literal> identifies an interval type,
1477        this column contains the specification which fields the
1478        intervals include for this column, e.g., <literal>YEAR TO
1479        MONTH</literal>, <literal>DAY TO SECOND</literal>, etc.  If no
1480        field restrictions were specified (that is, the interval
1481        accepts all fields), and for all other data types, this field
1482        is null.
1483       </entry>
1484      </row>
1485
1486      <row>
1487       <entry><literal>interval_precision</literal></entry>
1488       <entry><type>cardinal_number</type></entry>
1489       <entry>
1490        Applies to a feature not available
1491        in <productname>PostgreSQL</productname>
1492        (see <literal>datetime_precision</literal> for the fractional
1493        seconds precision of interval type columns)
1494       </entry>
1495      </row>
1496
1497      <row>
1498       <entry><literal>character_set_catalog</literal></entry>
1499       <entry><type>sql_identifier</type></entry>
1500       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
1501      </row>
1502
1503      <row>
1504       <entry><literal>character_set_schema</literal></entry>
1505       <entry><type>sql_identifier</type></entry>
1506       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
1507      </row>
1508
1509      <row>
1510       <entry><literal>character_set_name</literal></entry>
1511       <entry><type>sql_identifier</type></entry>
1512       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
1513      </row>
1514
1515      <row>
1516       <entry><literal>collation_catalog</literal></entry>
1517       <entry><type>sql_identifier</type></entry>
1518       <entry>
1519        Name of the database containing the collation of the column
1520        (always the current database), null if default or the data type
1521        of the column is not collatable
1522       </entry>
1523      </row>
1524
1525      <row>
1526       <entry><literal>collation_schema</literal></entry>
1527       <entry><type>sql_identifier</type></entry>
1528       <entry>
1529        Name of the schema containing the collation of the column, null
1530        if default or the data type of the column is not collatable
1531       </entry>
1532      </row>
1533
1534      <row>
1535       <entry><literal>collation_name</literal></entry>
1536       <entry><type>sql_identifier</type></entry>
1537       <entry>
1538        Name of the collation of the column, null if default or the
1539        data type of the column is not collatable
1540       </entry>
1541      </row>
1542
1543      <row>
1544       <entry><literal>domain_catalog</literal></entry>
1545       <entry><type>sql_identifier</type></entry>
1546       <entry>
1547        If the column has a domain type, the name of the database that
1548        the domain is defined in (always the current database), else
1549        null.
1550       </entry>
1551      </row>
1552
1553      <row>
1554       <entry><literal>domain_schema</literal></entry>
1555       <entry><type>sql_identifier</type></entry>
1556       <entry>
1557        If the column has a domain type, the name of the schema that
1558        the domain is defined in, else null.
1559       </entry>
1560      </row>
1561
1562      <row>
1563       <entry><literal>domain_name</literal></entry>
1564       <entry><type>sql_identifier</type></entry>
1565       <entry>If the column has a domain type, the name of the domain, else null.</entry>
1566      </row>
1567
1568      <row>
1569       <entry><literal>udt_catalog</literal></entry>
1570       <entry><type>sql_identifier</type></entry>
1571       <entry>
1572        Name of the database that the column data type (the underlying
1573        type of the domain, if applicable) is defined in (always the
1574        current database)
1575       </entry>
1576      </row>
1577
1578      <row>
1579       <entry><literal>udt_schema</literal></entry>
1580       <entry><type>sql_identifier</type></entry>
1581       <entry>
1582        Name of the schema that the column data type (the underlying
1583        type of the domain, if applicable) is defined in
1584       </entry>
1585      </row>
1586
1587      <row>
1588       <entry><literal>udt_name</literal></entry>
1589       <entry><type>sql_identifier</type></entry>
1590       <entry>
1591        Name of the column data type (the underlying type of the
1592        domain, if applicable)
1593       </entry>
1594      </row>
1595
1596      <row>
1597       <entry><literal>scope_catalog</literal></entry>
1598       <entry><type>sql_identifier</type></entry>
1599       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
1600      </row>
1601
1602      <row>
1603       <entry><literal>scope_schema</literal></entry>
1604       <entry><type>sql_identifier</type></entry>
1605       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
1606      </row>
1607
1608      <row>
1609       <entry><literal>scope_name</literal></entry>
1610       <entry><type>sql_identifier</type></entry>
1611       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
1612      </row>
1613
1614      <row>
1615       <entry><literal>maximum_cardinality</literal></entry>
1616       <entry><type>cardinal_number</type></entry>
1617       <entry>Always null, because arrays always have unlimited maximum cardinality in <productname>PostgreSQL</productname></entry>
1618      </row>
1619
1620      <row>
1621       <entry><literal>dtd_identifier</literal></entry>
1622       <entry><type>sql_identifier</type></entry>
1623       <entry>
1624        An identifier of the data type descriptor of the column, unique
1625        among the data type descriptors pertaining to the table.  This
1626        is mainly useful for joining with other instances of such
1627        identifiers.  (The specific format of the identifier is not
1628        defined and not guaranteed to remain the same in future
1629        versions.)
1630       </entry>
1631      </row>
1632
1633      <row>
1634       <entry><literal>is_self_referencing</literal></entry>
1635       <entry><type>yes_or_no</type></entry>
1636       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
1637      </row>
1638
1639      <row>
1640       <entry><literal>is_identity</literal></entry>
1641       <entry><type>yes_or_no</type></entry>
1642       <entry>
1643        If the column is an identity column, then <literal>YES</literal>,
1644        else <literal>NO</literal>.
1645       </entry>
1646      </row>
1647
1648      <row>
1649       <entry><literal>identity_generation</literal></entry>
1650       <entry><type>character_data</type></entry>
1651       <entry>
1652        If the column is an identity column, then <literal>ALWAYS</literal>
1653        or <literal>BY DEFAULT</literal>, reflecting the definition of the
1654        column.
1655       </entry>
1656      </row>
1657
1658      <row>
1659       <entry><literal>identity_start</literal></entry>
1660       <entry><type>character_data</type></entry>
1661       <entry>
1662        If the column is an identity column, then the start value of the
1663        internal sequence, else null.
1664       </entry>
1665      </row>
1666
1667      <row>
1668       <entry><literal>identity_increment</literal></entry>
1669       <entry><type>character_data</type></entry>
1670       <entry>
1671        If the column is an identity column, then the increment of the internal
1672        sequence, else null.
1673       </entry>
1674      </row>
1675
1676      <row>
1677       <entry><literal>identity_maximum</literal></entry>
1678       <entry><type>character_data</type></entry>
1679       <entry>
1680        If the column is an identity column, then the maximum value of the
1681        internal sequence, else null.
1682       </entry>
1683      </row>
1684
1685      <row>
1686       <entry><literal>identity_minimum</literal></entry>
1687       <entry><type>character_data</type></entry>
1688       <entry>
1689        If the column is an identity column, then the minimum value of the
1690        internal sequence, else null.
1691       </entry>
1692      </row>
1693
1694      <row>
1695       <entry><literal>identity_cycle</literal></entry>
1696       <entry><type>yes_or_no</type></entry>
1697       <entry>
1698        If the column is an identity column, then <literal>YES</literal> if the
1699        internal sequence cycles or <literal>NO</literal> if it does not;
1700        otherwise null.
1701       </entry>
1702      </row>
1703
1704      <row>
1705       <entry><literal>is_generated</literal></entry>
1706       <entry><type>character_data</type></entry>
1707       <entry>
1708        If the column is a generated column, then <literal>ALWAYS</literal>,
1709        else <literal>NEVER</literal>.
1710       </entry>
1711      </row>
1712
1713      <row>
1714       <entry><literal>generation_expression</literal></entry>
1715       <entry><type>character_data</type></entry>
1716       <entry>
1717        If the column is a generated column, then the generation expression,
1718        else null.
1719       </entry>
1720      </row>
1721
1722      <row>
1723       <entry><literal>is_updatable</literal></entry>
1724       <entry><type>yes_or_no</type></entry>
1725       <entry>
1726        <literal>YES</literal> if the column is updatable,
1727        <literal>NO</literal> if not (Columns in base tables are always
1728        updatable, columns in views not necessarily)
1729       </entry>
1730      </row>
1731     </tbody>
1732    </tgroup>
1733   </table>
1734
1735   <para>
1736    Since data types can be defined in a variety of ways in SQL, and
1737    <productname>PostgreSQL</productname> contains additional ways to
1738    define data types, their representation in the information schema
1739    can be somewhat difficult.  The column <literal>data_type</literal>
1740    is supposed to identify the underlying built-in type of the column.
1741    In <productname>PostgreSQL</productname>, this means that the type
1742    is defined in the system catalog schema
1743    <literal>pg_catalog</literal>.  This column might be useful if the
1744    application can handle the well-known built-in types specially (for
1745    example, format the numeric types differently or use the data in
1746    the precision columns).  The columns <literal>udt_name</literal>,
1747    <literal>udt_schema</literal>, and <literal>udt_catalog</literal>
1748    always identify the underlying data type of the column, even if the
1749    column is based on a domain.  (Since
1750    <productname>PostgreSQL</productname> treats built-in types like
1751    user-defined types, built-in types appear here as well.  This is an
1752    extension of the SQL standard.)  These columns should be used if an
1753    application wants to process data differently according to the
1754    type, because in that case it wouldn't matter if the column is
1755    really based on a domain.  If the column is based on a domain, the
1756    identity of the domain is stored in the columns
1757    <literal>domain_name</literal>, <literal>domain_schema</literal>,
1758    and <literal>domain_catalog</literal>.  If you want to pair up
1759    columns with their associated data types and treat domains as
1760    separate types, you could write <literal>coalesce(domain_name,
1761    udt_name)</literal>, etc.
1762   </para>
1763  </sect1>
1764
1765  <sect1 id="infoschema-constraint-column-usage">
1766   <title><literal>constraint_column_usage</literal></title>
1767
1768   <para>
1769    The view <literal>constraint_column_usage</literal> identifies all
1770    columns in the current database that are used by some constraint.
1771    Only those columns are shown that are contained in a table owned by
1772    a currently enabled role.  For a check constraint, this view
1773    identifies the columns that are used in the check expression.  For
1774    a foreign key constraint, this view identifies the columns that the
1775    foreign key references.  For a unique or primary key constraint,
1776    this view identifies the constrained columns.
1777   </para>
1778
1779   <table>
1780    <title><literal>constraint_column_usage</literal> Columns</title>
1781
1782    <tgroup cols="3">
1783     <thead>
1784      <row>
1785       <entry>Name</entry>
1786       <entry>Data Type</entry>
1787       <entry>Description</entry>
1788      </row>
1789     </thead>
1790
1791     <tbody>
1792      <row>
1793       <entry><literal>table_catalog</literal></entry>
1794       <entry><type>sql_identifier</type></entry>
1795       <entry>
1796        Name of the database that contains the table that contains the
1797        column that is used by some constraint (always the current
1798        database)
1799       </entry>
1800      </row>
1801
1802      <row>
1803       <entry><literal>table_schema</literal></entry>
1804       <entry><type>sql_identifier</type></entry>
1805       <entry>
1806        Name of the schema that contains the table that contains the
1807        column that is used by some constraint
1808       </entry>
1809      </row>
1810
1811      <row>
1812       <entry><literal>table_name</literal></entry>
1813       <entry><type>sql_identifier</type></entry>
1814       <entry>
1815        Name of the table that contains the column that is used by some
1816        constraint
1817       </entry>
1818      </row>
1819
1820      <row>
1821       <entry><literal>column_name</literal></entry>
1822       <entry><type>sql_identifier</type></entry>
1823       <entry>
1824        Name of the column that is used by some constraint
1825       </entry>
1826      </row>
1827
1828      <row>
1829       <entry><literal>constraint_catalog</literal></entry>
1830       <entry><type>sql_identifier</type></entry>
1831       <entry>Name of the database that contains the constraint (always the current database)</entry>
1832      </row>
1833
1834      <row>
1835       <entry><literal>constraint_schema</literal></entry>
1836       <entry><type>sql_identifier</type></entry>
1837       <entry>Name of the schema that contains the constraint</entry>
1838      </row>
1839
1840      <row>
1841       <entry><literal>constraint_name</literal></entry>
1842       <entry><type>sql_identifier</type></entry>
1843       <entry>Name of the constraint</entry>
1844      </row>
1845     </tbody>
1846    </tgroup>
1847   </table>
1848  </sect1>
1849
1850  <sect1 id="infoschema-constraint-table-usage">
1851   <title><literal>constraint_table_usage</literal></title>
1852
1853   <para>
1854    The view <literal>constraint_table_usage</literal> identifies all
1855    tables in the current database that are used by some constraint and
1856    are owned by a currently enabled role.  (This is different from the
1857    view <literal>table_constraints</literal>, which identifies all
1858    table constraints along with the table they are defined on.)  For a
1859    foreign key constraint, this view identifies the table that the
1860    foreign key references.  For a unique or primary key constraint,
1861    this view simply identifies the table the constraint belongs to.
1862    Check constraints and not-null constraints are not included in this
1863    view.
1864   </para>
1865
1866   <table>
1867    <title><literal>constraint_table_usage</literal> Columns</title>
1868
1869    <tgroup cols="3">
1870     <thead>
1871      <row>
1872       <entry>Name</entry>
1873       <entry>Data Type</entry>
1874       <entry>Description</entry>
1875      </row>
1876     </thead>
1877
1878     <tbody>
1879      <row>
1880       <entry><literal>table_catalog</literal></entry>
1881       <entry><type>sql_identifier</type></entry>
1882       <entry>
1883        Name of the database that contains the table that is used by
1884        some constraint (always the current database)
1885       </entry>
1886      </row>
1887
1888      <row>
1889       <entry><literal>table_schema</literal></entry>
1890       <entry><type>sql_identifier</type></entry>
1891       <entry>
1892        Name of the schema that contains the table that is used by some
1893        constraint
1894       </entry>
1895      </row>
1896
1897      <row>
1898       <entry><literal>table_name</literal></entry>
1899       <entry><type>sql_identifier</type></entry>
1900       <entry>Name of the table that is used by some constraint</entry>
1901      </row>
1902
1903      <row>
1904       <entry><literal>constraint_catalog</literal></entry>
1905       <entry><type>sql_identifier</type></entry>
1906       <entry>Name of the database that contains the constraint (always the current database)</entry>
1907      </row>
1908
1909      <row>
1910       <entry><literal>constraint_schema</literal></entry>
1911       <entry><type>sql_identifier</type></entry>
1912       <entry>Name of the schema that contains the constraint</entry>
1913      </row>
1914
1915      <row>
1916       <entry><literal>constraint_name</literal></entry>
1917       <entry><type>sql_identifier</type></entry>
1918       <entry>Name of the constraint</entry>
1919      </row>
1920     </tbody>
1921    </tgroup>
1922   </table>
1923  </sect1>
1924
1925  <sect1 id="infoschema-data-type-privileges">
1926   <title><literal>data_type_privileges</literal></title>
1927
1928   <para>
1929    The view <literal>data_type_privileges</literal> identifies all
1930    data type descriptors that the current user has access to, by way
1931    of being the owner of the described object or having some privilege
1932    for it.  A data type descriptor is generated whenever a data type
1933    is used in the definition of a table column, a domain, or a
1934    function (as parameter or return type) and stores some information
1935    about how the data type is used in that instance (for example, the
1936    declared maximum length, if applicable).  Each data type
1937    descriptor is assigned an arbitrary identifier that is unique
1938    among the data type descriptor identifiers assigned for one object
1939    (table, domain, function).  This view is probably not useful for
1940    applications, but it is used to define some other views in the
1941    information schema.
1942   </para>
1943
1944   <table>
1945    <title><literal>data_type_privileges</literal> Columns</title>
1946
1947    <tgroup cols="3">
1948     <thead>
1949      <row>
1950       <entry>Name</entry>
1951       <entry>Data Type</entry>
1952       <entry>Description</entry>
1953      </row>
1954     </thead>
1955
1956     <tbody>
1957      <row>
1958       <entry><literal>object_catalog</literal></entry>
1959       <entry><type>sql_identifier</type></entry>
1960       <entry>Name of the database that contains the described object (always the current database)</entry>
1961      </row>
1962
1963      <row>
1964       <entry><literal>object_schema</literal></entry>
1965       <entry><type>sql_identifier</type></entry>
1966       <entry>Name of the schema that contains the described object</entry>
1967      </row>
1968
1969      <row>
1970       <entry><literal>object_name</literal></entry>
1971       <entry><type>sql_identifier</type></entry>
1972       <entry>Name of the described object</entry>
1973      </row>
1974
1975      <row>
1976       <entry><literal>object_type</literal></entry>
1977       <entry><type>character_data</type></entry>
1978       <entry>
1979        The type of the described object: one of
1980        <literal>TABLE</literal> (the data type descriptor pertains to
1981        a column of that table), <literal>DOMAIN</literal> (the data
1982        type descriptors pertains to that domain),
1983        <literal>ROUTINE</literal> (the data type descriptor pertains
1984        to a parameter or the return data type of that function).
1985       </entry>
1986      </row>
1987
1988      <row>
1989       <entry><literal>dtd_identifier</literal></entry>
1990       <entry><type>sql_identifier</type></entry>
1991       <entry>
1992        The identifier of the data type descriptor, which is unique
1993        among the data type descriptors for that same object.
1994       </entry>
1995      </row>
1996     </tbody>
1997    </tgroup>
1998   </table>
1999  </sect1>
2000
2001  <sect1 id="infoschema-domain-constraints">
2002   <title><literal>domain_constraints</literal></title>
2003
2004   <para>
2005    The view <literal>domain_constraints</literal> contains all constraints
2006    belonging to domains defined in the current database.  Only those domains
2007    are shown that the current user has access to (by way of being the owner or
2008    having some privilege).
2009   </para>
2010
2011   <table>
2012    <title><literal>domain_constraints</literal> Columns</title>
2013
2014    <tgroup cols="3">
2015     <thead>
2016      <row>
2017       <entry>Name</entry>
2018       <entry>Data Type</entry>
2019       <entry>Description</entry>
2020      </row>
2021     </thead>
2022
2023     <tbody>
2024      <row>
2025       <entry><literal>constraint_catalog</literal></entry>
2026       <entry><type>sql_identifier</type></entry>
2027       <entry>Name of the database that contains the constraint (always the current database)</entry>
2028      </row>
2029
2030      <row>
2031       <entry><literal>constraint_schema</literal></entry>
2032       <entry><type>sql_identifier</type></entry>
2033       <entry>Name of the schema that contains the constraint</entry>
2034      </row>
2035
2036      <row>
2037       <entry><literal>constraint_name</literal></entry>
2038       <entry><type>sql_identifier</type></entry>
2039       <entry>Name of the constraint</entry>
2040      </row>
2041
2042      <row>
2043       <entry><literal>domain_catalog</literal></entry>
2044       <entry><type>sql_identifier</type></entry>
2045       <entry>Name of the database that contains the domain (always the current database)</entry>
2046      </row>
2047
2048      <row>
2049       <entry><literal>domain_schema</literal></entry>
2050       <entry><type>sql_identifier</type></entry>
2051       <entry>Name of the schema that contains the domain</entry>
2052      </row>
2053
2054      <row>
2055       <entry><literal>domain_name</literal></entry>
2056       <entry><type>sql_identifier</type></entry>
2057       <entry>Name of the domain</entry>
2058      </row>
2059
2060      <row>
2061       <entry><literal>is_deferrable</literal></entry>
2062       <entry><type>yes_or_no</type></entry>
2063       <entry><literal>YES</literal> if the constraint is deferrable, <literal>NO</literal> if not</entry>
2064      </row>
2065
2066      <row>
2067       <entry><literal>initially_deferred</literal></entry>
2068       <entry><type>yes_or_no</type></entry>
2069       <entry><literal>YES</literal> if the constraint is deferrable and initially deferred, <literal>NO</literal> if not</entry>
2070      </row>
2071     </tbody>
2072    </tgroup>
2073   </table>
2074  </sect1>
2075
2076  <sect1 id="infoschema-domain-udt-usage">
2077   <title><literal>domain_udt_usage</literal></title>
2078
2079   <para>
2080    The view <literal>domain_udt_usage</literal> identifies all domains
2081    that are based on data types owned by a currently enabled role.
2082    Note that in <productname>PostgreSQL</productname>, built-in data
2083    types behave like user-defined types, so they are included here as
2084    well.
2085   </para>
2086
2087   <table>
2088    <title><literal>domain_udt_usage</literal> Columns</title>
2089
2090    <tgroup cols="3">
2091     <thead>
2092      <row>
2093       <entry>Name</entry>
2094       <entry>Data Type</entry>
2095       <entry>Description</entry>
2096      </row>
2097     </thead>
2098
2099     <tbody>
2100      <row>
2101       <entry><literal>udt_catalog</literal></entry>
2102       <entry><type>sql_identifier</type></entry>
2103       <entry>Name of the database that the domain data type is defined in (always the current database)</entry>
2104      </row>
2105
2106      <row>
2107       <entry><literal>udt_schema</literal></entry>
2108       <entry><type>sql_identifier</type></entry>
2109       <entry>Name of the schema that the domain data type is defined in</entry>
2110      </row>
2111
2112      <row>
2113       <entry><literal>udt_name</literal></entry>
2114       <entry><type>sql_identifier</type></entry>
2115       <entry>Name of the domain data type</entry>
2116      </row>
2117
2118      <row>
2119       <entry><literal>domain_catalog</literal></entry>
2120       <entry><type>sql_identifier</type></entry>
2121       <entry>Name of the database that contains the domain (always the current database)</entry>
2122      </row>
2123
2124      <row>
2125       <entry><literal>domain_schema</literal></entry>
2126       <entry><type>sql_identifier</type></entry>
2127       <entry>Name of the schema that contains the domain</entry>
2128      </row>
2129
2130      <row>
2131       <entry><literal>domain_name</literal></entry>
2132       <entry><type>sql_identifier</type></entry>
2133       <entry>Name of the domain</entry>
2134      </row>
2135     </tbody>
2136    </tgroup>
2137   </table>
2138  </sect1>
2139
2140  <sect1 id="infoschema-domains">
2141   <title><literal>domains</literal></title>
2142
2143   <para>
2144    The view <literal>domains</literal> contains all domains defined in the
2145    current database.  Only those domains are shown that the current user has
2146    access to (by way of being the owner or having some privilege).
2147   </para>
2148
2149   <table>
2150    <title><literal>domains</literal> Columns</title>
2151
2152    <tgroup cols="3">
2153     <thead>
2154      <row>
2155       <entry>Name</entry>
2156       <entry>Data Type</entry>
2157       <entry>Description</entry>
2158      </row>
2159     </thead>
2160
2161     <tbody>
2162      <row>
2163       <entry><literal>domain_catalog</literal></entry>
2164       <entry><type>sql_identifier</type></entry>
2165       <entry>Name of the database that contains the domain (always the current database)</entry>
2166      </row>
2167
2168      <row>
2169       <entry><literal>domain_schema</literal></entry>
2170       <entry><type>sql_identifier</type></entry>
2171       <entry>Name of the schema that contains the domain</entry>
2172      </row>
2173
2174      <row>
2175       <entry><literal>domain_name</literal></entry>
2176       <entry><type>sql_identifier</type></entry>
2177       <entry>Name of the domain</entry>
2178      </row>
2179
2180      <row>
2181       <entry><literal>data_type</literal></entry>
2182       <entry><type>character_data</type></entry>
2183       <entry>
2184        Data type of the domain, if it is a built-in type, or
2185        <literal>ARRAY</literal> if it is some array (in that case, see
2186        the view <literal>element_types</literal>), else
2187        <literal>USER-DEFINED</literal> (in that case, the type is
2188        identified in <literal>udt_name</literal> and associated
2189        columns).
2190       </entry>
2191      </row>
2192
2193      <row>
2194       <entry><literal>character_maximum_length</literal></entry>
2195       <entry><type>cardinal_number</type></entry>
2196       <entry>
2197        If the domain has a character or bit string type, the declared
2198        maximum length; null for all other data types or if no maximum
2199        length was declared.
2200       </entry>
2201      </row>
2202
2203      <row>
2204       <entry><literal>character_octet_length</literal></entry>
2205       <entry><type>cardinal_number</type></entry>
2206       <entry>
2207        If the domain has a character type, the maximum possible length
2208        in octets (bytes) of a datum; null for all other data types.
2209        The maximum octet length depends on the declared character
2210        maximum length (see above) and the server encoding.
2211       </entry>
2212      </row>
2213
2214      <row>
2215       <entry><literal>character_set_catalog</literal></entry>
2216       <entry><type>sql_identifier</type></entry>
2217       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
2218      </row>
2219
2220      <row>
2221       <entry><literal>character_set_schema</literal></entry>
2222       <entry><type>sql_identifier</type></entry>
2223       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
2224      </row>
2225
2226      <row>
2227       <entry><literal>character_set_name</literal></entry>
2228       <entry><type>sql_identifier</type></entry>
2229       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
2230      </row>
2231
2232      <row>
2233       <entry><literal>collation_catalog</literal></entry>
2234       <entry><type>sql_identifier</type></entry>
2235       <entry>
2236        Name of the database containing the collation of the domain
2237        (always the current database), null if default or the data type
2238        of the domain is not collatable
2239       </entry>
2240      </row>
2241
2242      <row>
2243       <entry><literal>collation_schema</literal></entry>
2244       <entry><type>sql_identifier</type></entry>
2245       <entry>
2246        Name of the schema containing the collation of the domain, null
2247        if default or the data type of the domain is not collatable
2248       </entry>
2249      </row>
2250
2251      <row>
2252       <entry><literal>collation_name</literal></entry>
2253       <entry><type>sql_identifier</type></entry>
2254       <entry>
2255        Name of the collation of the domain, null if default or the
2256        data type of the domain is not collatable
2257       </entry>
2258      </row>
2259
2260      <row>
2261       <entry><literal>numeric_precision</literal></entry>
2262       <entry><type>cardinal_number</type></entry>
2263       <entry>
2264        If the domain has a numeric type, this column contains the
2265        (declared or implicit) precision of the type for this domain.
2266        The precision indicates the number of significant digits.  It
2267        can be expressed in decimal (base 10) or binary (base 2) terms,
2268        as specified in the column
2269        <literal>numeric_precision_radix</literal>.  For all other data
2270        types, this column is null.
2271       </entry>
2272      </row>
2273
2274      <row>
2275       <entry><literal>numeric_precision_radix</literal></entry>
2276       <entry><type>cardinal_number</type></entry>
2277       <entry>
2278        If the domain has a numeric type, this column indicates in
2279        which base the values in the columns
2280        <literal>numeric_precision</literal> and
2281        <literal>numeric_scale</literal> are expressed.  The value is
2282        either 2 or 10.  For all other data types, this column is null.
2283       </entry>
2284      </row>
2285
2286      <row>
2287       <entry><literal>numeric_scale</literal></entry>
2288       <entry><type>cardinal_number</type></entry>
2289       <entry>
2290        If the domain has an exact numeric type, this column contains
2291        the (declared or implicit) scale of the type for this domain.
2292        The scale indicates the number of significant digits to the
2293        right of the decimal point.  It can be expressed in decimal
2294        (base 10) or binary (base 2) terms, as specified in the column
2295        <literal>numeric_precision_radix</literal>.  For all other data
2296        types, this column is null.
2297       </entry>
2298      </row>
2299
2300      <row>
2301       <entry><literal>datetime_precision</literal></entry>
2302       <entry><type>cardinal_number</type></entry>
2303       <entry>
2304        If <literal>data_type</literal> identifies a date, time,
2305        timestamp, or interval type, this column contains the (declared
2306        or implicit) fractional seconds precision of the type for this
2307        domain, that is, the number of decimal digits maintained
2308        following the decimal point in the seconds value.  For all
2309        other data types, this column is null.
2310       </entry>
2311      </row>
2312
2313      <row>
2314       <entry><literal>interval_type</literal></entry>
2315       <entry><type>character_data</type></entry>
2316       <entry>
2317        If <literal>data_type</literal> identifies an interval type,
2318        this column contains the specification which fields the
2319        intervals include for this domain, e.g., <literal>YEAR TO
2320        MONTH</literal>, <literal>DAY TO SECOND</literal>, etc.  If no
2321        field restrictions were specified (that is, the interval
2322        accepts all fields), and for all other data types, this field
2323        is null.
2324       </entry>
2325      </row>
2326
2327      <row>
2328       <entry><literal>interval_precision</literal></entry>
2329       <entry><type>cardinal_number</type></entry>
2330       <entry>
2331        Applies to a feature not available
2332        in <productname>PostgreSQL</productname>
2333        (see <literal>datetime_precision</literal> for the fractional
2334        seconds precision of interval type domains)
2335       </entry>
2336      </row>
2337
2338      <row>
2339       <entry><literal>domain_default</literal></entry>
2340       <entry><type>character_data</type></entry>
2341       <entry>Default expression of the domain</entry>
2342      </row>
2343
2344      <row>
2345       <entry><literal>udt_catalog</literal></entry>
2346       <entry><type>sql_identifier</type></entry>
2347       <entry>Name of the database that the domain data type is defined in (always the current database)</entry>
2348      </row>
2349
2350      <row>
2351       <entry><literal>udt_schema</literal></entry>
2352       <entry><type>sql_identifier</type></entry>
2353       <entry>Name of the schema that the domain data type is defined in</entry>
2354      </row>
2355
2356      <row>
2357       <entry><literal>udt_name</literal></entry>
2358       <entry><type>sql_identifier</type></entry>
2359       <entry>Name of the domain data type</entry>
2360      </row>
2361
2362      <row>
2363       <entry><literal>scope_catalog</literal></entry>
2364       <entry><type>sql_identifier</type></entry>
2365       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
2366      </row>
2367
2368      <row>
2369       <entry><literal>scope_schema</literal></entry>
2370       <entry><type>sql_identifier</type></entry>
2371       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
2372      </row>
2373
2374      <row>
2375       <entry><literal>scope_name</literal></entry>
2376       <entry><type>sql_identifier</type></entry>
2377       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
2378      </row>
2379
2380      <row>
2381       <entry><literal>maximum_cardinality</literal></entry>
2382       <entry><type>cardinal_number</type></entry>
2383       <entry>Always null, because arrays always have unlimited maximum cardinality in <productname>PostgreSQL</productname></entry>
2384      </row>
2385
2386      <row>
2387       <entry><literal>dtd_identifier</literal></entry>
2388       <entry><type>sql_identifier</type></entry>
2389       <entry>
2390        An identifier of the data type descriptor of the domain, unique
2391        among the data type descriptors pertaining to the domain (which
2392        is trivial, because a domain only contains one data type
2393        descriptor).  This is mainly useful for joining with other
2394        instances of such identifiers.  (The specific format of the
2395        identifier is not defined and not guaranteed to remain the same
2396        in future versions.)
2397       </entry>
2398      </row>
2399     </tbody>
2400    </tgroup>
2401   </table>
2402  </sect1>
2403
2404  <sect1 id="infoschema-element-types">
2405   <title><literal>element_types</literal></title>
2406
2407   <para>
2408    The view <literal>element_types</literal> contains the data type
2409    descriptors of the elements of arrays.  When a table column, composite-type attribute,
2410    domain, function parameter, or function return value is defined to
2411    be of an array type, the respective information schema view only
2412    contains <literal>ARRAY</literal> in the column
2413    <literal>data_type</literal>.  To obtain information on the element
2414    type of the array, you can join the respective view with this view.
2415    For example, to show the columns of a table with data types and
2416    array element types, if applicable, you could do:
2417 <programlisting>
2418 SELECT c.column_name, c.data_type, e.data_type AS element_type
2419 FROM information_schema.columns c LEFT JOIN information_schema.element_types e
2420      ON ((c.table_catalog, c.table_schema, c.table_name, 'TABLE', c.dtd_identifier)
2421        = (e.object_catalog, e.object_schema, e.object_name, e.object_type, e.collection_type_identifier))
2422 WHERE c.table_schema = '...' AND c.table_name = '...'
2423 ORDER BY c.ordinal_position;
2424 </programlisting>
2425    This view only includes objects that the current user has access
2426    to, by way of being the owner or having some privilege.
2427   </para>
2428
2429   <table>
2430    <title><literal>element_types</literal> Columns</title>
2431
2432    <tgroup cols="3">
2433     <thead>
2434      <row>
2435       <entry>Name</entry>
2436       <entry>Data Type</entry>
2437       <entry>Description</entry>
2438      </row>
2439     </thead>
2440
2441     <tbody>
2442      <row>
2443       <entry><literal>object_catalog</literal></entry>
2444       <entry><type>sql_identifier</type></entry>
2445       <entry>
2446        Name of the database that contains the object that uses the
2447        array being described (always the current database)
2448       </entry>
2449      </row>
2450
2451      <row>
2452       <entry><literal>object_schema</literal></entry>
2453       <entry><type>sql_identifier</type></entry>
2454       <entry>
2455        Name of the schema that contains the object that uses the array
2456        being described
2457       </entry>
2458      </row>
2459
2460      <row>
2461       <entry><literal>object_name</literal></entry>
2462       <entry><type>sql_identifier</type></entry>
2463       <entry>
2464        Name of the object that uses the array being described
2465       </entry>
2466      </row>
2467
2468      <row>
2469       <entry><literal>object_type</literal></entry>
2470       <entry><type>character_data</type></entry>
2471       <entry>
2472        The type of the object that uses the array being described: one
2473        of <literal>TABLE</literal> (the array is used by a column of
2474        that table), <literal>USER-DEFINED TYPE</literal> (the array is
2475        used by an attribute of that composite type),
2476        <literal>DOMAIN</literal> (the array is used by that domain),
2477        <literal>ROUTINE</literal> (the array is used by a parameter or
2478        the return data type of that function).
2479       </entry>
2480      </row>
2481
2482      <row>
2483       <entry><literal>collection_type_identifier</literal></entry>
2484       <entry><type>sql_identifier</type></entry>
2485       <entry>
2486        The identifier of the data type descriptor of the array being
2487        described.  Use this to join with the
2488        <literal>dtd_identifier</literal> columns of other information
2489        schema views.
2490       </entry>
2491      </row>
2492
2493      <row>
2494       <entry><literal>data_type</literal></entry>
2495       <entry><type>character_data</type></entry>
2496       <entry>
2497        Data type of the array elements, if it is a built-in type, else
2498        <literal>USER-DEFINED</literal> (in that case, the type is
2499        identified in <literal>udt_name</literal> and associated
2500        columns).
2501       </entry>
2502      </row>
2503
2504      <row>
2505       <entry><literal>character_maximum_length</literal></entry>
2506       <entry><type>cardinal_number</type></entry>
2507       <entry>Always null, since this information is not applied to array element data types in <productname>PostgreSQL</productname></entry>
2508      </row>
2509
2510      <row>
2511       <entry><literal>character_octet_length</literal></entry>
2512       <entry><type>cardinal_number</type></entry>
2513       <entry>Always null, since this information is not applied to array element data types in <productname>PostgreSQL</productname></entry>
2514      </row>
2515
2516      <row>
2517       <entry><literal>character_set_catalog</literal></entry>
2518       <entry><type>sql_identifier</type></entry>
2519       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
2520      </row>
2521
2522      <row>
2523       <entry><literal>character_set_schema</literal></entry>
2524       <entry><type>sql_identifier</type></entry>
2525       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
2526      </row>
2527
2528      <row>
2529       <entry><literal>character_set_name</literal></entry>
2530       <entry><type>sql_identifier</type></entry>
2531       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
2532      </row>
2533
2534      <row>
2535       <entry><literal>collation_catalog</literal></entry>
2536       <entry><type>sql_identifier</type></entry>
2537       <entry>
2538        Name of the database containing the collation of the element
2539        type (always the current database), null if default or the data
2540        type of the element is not collatable
2541       </entry>
2542      </row>
2543
2544      <row>
2545       <entry><literal>collation_schema</literal></entry>
2546       <entry><type>sql_identifier</type></entry>
2547       <entry>
2548        Name of the schema containing the collation of the element
2549        type, null if default or the data type of the element is not
2550        collatable
2551       </entry>
2552      </row>
2553
2554      <row>
2555       <entry><literal>collation_name</literal></entry>
2556       <entry><type>sql_identifier</type></entry>
2557       <entry>
2558        Name of the collation of the element type, null if default or
2559        the data type of the element is not collatable
2560       </entry>
2561      </row>
2562
2563      <row>
2564       <entry><literal>numeric_precision</literal></entry>
2565       <entry><type>cardinal_number</type></entry>
2566       <entry>Always null, since this information is not applied to array element data types in <productname>PostgreSQL</productname></entry>
2567      </row>
2568
2569      <row>
2570       <entry><literal>numeric_precision_radix</literal></entry>
2571       <entry><type>cardinal_number</type></entry>
2572       <entry>Always null, since this information is not applied to array element data types in <productname>PostgreSQL</productname></entry>
2573      </row>
2574
2575      <row>
2576       <entry><literal>numeric_scale</literal></entry>
2577       <entry><type>cardinal_number</type></entry>
2578       <entry>Always null, since this information is not applied to array element data types in <productname>PostgreSQL</productname></entry>
2579      </row>
2580
2581      <row>
2582       <entry><literal>datetime_precision</literal></entry>
2583       <entry><type>cardinal_number</type></entry>
2584       <entry>Always null, since this information is not applied to array element data types in <productname>PostgreSQL</productname></entry>
2585      </row>
2586
2587      <row>
2588       <entry><literal>interval_type</literal></entry>
2589       <entry><type>character_data</type></entry>
2590       <entry>Always null, since this information is not applied to array element data types in <productname>PostgreSQL</productname></entry>
2591      </row>
2592
2593      <row>
2594       <entry><literal>interval_precision</literal></entry>
2595       <entry><type>cardinal_number</type></entry>
2596       <entry>Always null, since this information is not applied to array element data types in <productname>PostgreSQL</productname></entry>
2597      </row>
2598
2599      <row>
2600       <entry><literal>domain_default</literal></entry>
2601       <entry><type>character_data</type></entry>
2602       <entry>Not yet implemented</entry>
2603      </row>
2604
2605      <row>
2606       <entry><literal>udt_catalog</literal></entry>
2607       <entry><type>sql_identifier</type></entry>
2608       <entry>
2609        Name of the database that the data type of the elements is
2610        defined in (always the current database)
2611       </entry>
2612      </row>
2613
2614      <row>
2615       <entry><literal>udt_schema</literal></entry>
2616       <entry><type>sql_identifier</type></entry>
2617       <entry>
2618        Name of the schema that the data type of the elements is
2619        defined in
2620       </entry>
2621      </row>
2622
2623      <row>
2624       <entry><literal>udt_name</literal></entry>
2625       <entry><type>sql_identifier</type></entry>
2626       <entry>
2627        Name of the data type of the elements
2628       </entry>
2629      </row>
2630
2631      <row>
2632       <entry><literal>scope_catalog</literal></entry>
2633       <entry><type>sql_identifier</type></entry>
2634       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
2635      </row>
2636
2637      <row>
2638       <entry><literal>scope_schema</literal></entry>
2639       <entry><type>sql_identifier</type></entry>
2640       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
2641      </row>
2642
2643      <row>
2644       <entry><literal>scope_name</literal></entry>
2645       <entry><type>sql_identifier</type></entry>
2646       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
2647      </row>
2648
2649      <row>
2650       <entry><literal>maximum_cardinality</literal></entry>
2651       <entry><type>cardinal_number</type></entry>
2652       <entry>Always null, because arrays always have unlimited maximum cardinality in <productname>PostgreSQL</productname></entry>
2653      </row>
2654
2655      <row>
2656       <entry><literal>dtd_identifier</literal></entry>
2657       <entry><type>sql_identifier</type></entry>
2658       <entry>
2659        An identifier of the data type descriptor of the element.  This
2660        is currently not useful.
2661       </entry>
2662      </row>
2663     </tbody>
2664    </tgroup>
2665   </table>
2666  </sect1>
2667
2668  <sect1 id="infoschema-enabled-roles">
2669   <title><literal>enabled_roles</literal></title>
2670
2671   <para>
2672    The view <literal>enabled_roles</literal> identifies the currently
2673    <quote>enabled roles</quote>.  The enabled roles are recursively
2674    defined as the current user together with all roles that have been
2675    granted to the enabled roles with automatic inheritance.  In other
2676    words, these are all roles that the current user has direct or
2677    indirect, automatically inheriting membership in.
2678    <indexterm><primary>enabled role</primary></indexterm>
2679    <indexterm><primary>role</primary><secondary>enabled</secondary></indexterm>
2680   </para>
2681
2682   <para>
2683    For permission checking, the set of <quote>applicable roles</quote>
2684    is applied, which can be broader than the set of enabled roles.  So
2685    generally, it is better to use the view
2686    <literal>applicable_roles</literal> instead of this one; See
2687    <xref linkend="infoschema-applicable-roles"/> for details on
2688    <literal>applicable_roles</literal> view.
2689   </para>
2690
2691   <table>
2692    <title><literal>enabled_roles</literal> Columns</title>
2693
2694    <tgroup cols="3">
2695     <thead>
2696      <row>
2697       <entry>Name</entry>
2698       <entry>Data Type</entry>
2699       <entry>Description</entry>
2700      </row>
2701     </thead>
2702
2703     <tbody>
2704      <row>
2705       <entry><literal>role_name</literal></entry>
2706       <entry><type>sql_identifier</type></entry>
2707       <entry>Name of a role</entry>
2708      </row>
2709     </tbody>
2710    </tgroup>
2711   </table>
2712  </sect1>
2713
2714  <sect1 id="infoschema-foreign-data-wrapper-options">
2715   <title><literal>foreign_data_wrapper_options</literal></title>
2716
2717   <para>
2718    The view <literal>foreign_data_wrapper_options</literal> contains
2719    all the options defined for foreign-data wrappers in the current
2720    database.  Only those foreign-data wrappers are shown that the
2721    current user has access to (by way of being the owner or having
2722    some privilege).
2723   </para>
2724
2725   <table>
2726    <title><literal>foreign_data_wrapper_options</literal> Columns</title>
2727
2728    <tgroup cols="3">
2729     <thead>
2730      <row>
2731       <entry>Name</entry>
2732       <entry>Data Type</entry>
2733       <entry>Description</entry>
2734      </row>
2735     </thead>
2736
2737     <tbody>
2738      <row>
2739       <entry><literal>foreign_data_wrapper_catalog</literal></entry>
2740       <entry><type>sql_identifier</type></entry>
2741       <entry>Name of the database that the foreign-data wrapper is defined in (always the current database)</entry>
2742      </row>
2743
2744      <row>
2745       <entry><literal>foreign_data_wrapper_name</literal></entry>
2746       <entry><type>sql_identifier</type></entry>
2747       <entry>Name of the foreign-data wrapper</entry>
2748      </row>
2749
2750      <row>
2751       <entry><literal>option_name</literal></entry>
2752       <entry><type>sql_identifier</type></entry>
2753       <entry>Name of an option</entry>
2754      </row>
2755
2756      <row>
2757       <entry><literal>option_value</literal></entry>
2758       <entry><type>character_data</type></entry>
2759       <entry>Value of the option</entry>
2760      </row>
2761     </tbody>
2762    </tgroup>
2763   </table>
2764  </sect1>
2765
2766  <sect1 id="infoschema-foreign-data-wrappers">
2767   <title><literal>foreign_data_wrappers</literal></title>
2768
2769   <para>
2770    The view <literal>foreign_data_wrappers</literal> contains all
2771    foreign-data wrappers defined in the current database.  Only those
2772    foreign-data wrappers are shown that the current user has access to
2773    (by way of being the owner or having some privilege).
2774   </para>
2775
2776   <table>
2777    <title><literal>foreign_data_wrappers</literal> Columns</title>
2778
2779    <tgroup cols="3">
2780     <thead>
2781      <row>
2782       <entry>Name</entry>
2783       <entry>Data Type</entry>
2784       <entry>Description</entry>
2785      </row>
2786     </thead>
2787
2788     <tbody>
2789      <row>
2790       <entry><literal>foreign_data_wrapper_catalog</literal></entry>
2791       <entry><type>sql_identifier</type></entry>
2792       <entry>Name of the database that contains the foreign-data
2793       wrapper (always the current database)</entry>
2794      </row>
2795
2796      <row>
2797       <entry><literal>foreign_data_wrapper_name</literal></entry>
2798       <entry><type>sql_identifier</type></entry>
2799       <entry>Name of the foreign-data wrapper</entry>
2800      </row>
2801
2802      <row>
2803       <entry><literal>authorization_identifier</literal></entry>
2804       <entry><type>sql_identifier</type></entry>
2805       <entry>Name of the owner of the foreign server</entry>
2806      </row>
2807
2808      <row>
2809       <entry><literal>library_name</literal></entry>
2810       <entry><type>character_data</type></entry>
2811       <entry>File name of the library that implementing this foreign-data wrapper</entry>
2812      </row>
2813
2814      <row>
2815       <entry><literal>foreign_data_wrapper_language</literal></entry>
2816       <entry><type>character_data</type></entry>
2817       <entry>Language used to implement this foreign-data wrapper</entry>
2818      </row>
2819     </tbody>
2820    </tgroup>
2821   </table>
2822  </sect1>
2823
2824  <sect1 id="infoschema-foreign-server-options">
2825   <title><literal>foreign_server_options</literal></title>
2826
2827   <para>
2828    The view <literal>foreign_server_options</literal> contains all the
2829    options defined for foreign servers in the current database.  Only
2830    those foreign servers are shown that the current user has access to
2831    (by way of being the owner or having some privilege).
2832   </para>
2833
2834   <table>
2835    <title><literal>foreign_server_options</literal> Columns</title>
2836
2837    <tgroup cols="3">
2838     <thead>
2839      <row>
2840       <entry>Name</entry>
2841       <entry>Data Type</entry>
2842       <entry>Description</entry>
2843      </row>
2844     </thead>
2845
2846     <tbody>
2847      <row>
2848       <entry><literal>foreign_server_catalog</literal></entry>
2849       <entry><type>sql_identifier</type></entry>
2850       <entry>Name of the database that the foreign server is defined in (always the current database)</entry>
2851      </row>
2852
2853      <row>
2854       <entry><literal>foreign_server_name</literal></entry>
2855       <entry><type>sql_identifier</type></entry>
2856       <entry>Name of the foreign server</entry>
2857      </row>
2858
2859      <row>
2860       <entry><literal>option_name</literal></entry>
2861       <entry><type>sql_identifier</type></entry>
2862       <entry>Name of an option</entry>
2863      </row>
2864
2865      <row>
2866       <entry><literal>option_value</literal></entry>
2867       <entry><type>character_data</type></entry>
2868       <entry>Value of the option</entry>
2869      </row>
2870     </tbody>
2871    </tgroup>
2872   </table>
2873  </sect1>
2874
2875  <sect1 id="infoschema-foreign-servers">
2876   <title><literal>foreign_servers</literal></title>
2877
2878   <para>
2879    The view <literal>foreign_servers</literal> contains all foreign
2880    servers defined in the current database.  Only those foreign
2881    servers are shown that the current user has access to (by way of
2882    being the owner or having some privilege).
2883   </para>
2884
2885   <table>
2886    <title><literal>foreign_servers</literal> Columns</title>
2887
2888    <tgroup cols="3">
2889     <thead>
2890      <row>
2891       <entry>Name</entry>
2892       <entry>Data Type</entry>
2893       <entry>Description</entry>
2894      </row>
2895     </thead>
2896
2897     <tbody>
2898      <row>
2899       <entry><literal>foreign_server_catalog</literal></entry>
2900       <entry><type>sql_identifier</type></entry>
2901       <entry>Name of the database that the foreign server is defined in (always the current database)</entry>
2902      </row>
2903
2904      <row>
2905       <entry><literal>foreign_server_name</literal></entry>
2906       <entry><type>sql_identifier</type></entry>
2907       <entry>Name of the foreign server</entry>
2908      </row>
2909
2910      <row>
2911       <entry><literal>foreign_data_wrapper_catalog</literal></entry>
2912       <entry><type>sql_identifier</type></entry>
2913       <entry>Name of the database that contains the foreign-data
2914       wrapper used by the foreign server (always the current database)</entry>
2915      </row>
2916
2917      <row>
2918       <entry><literal>foreign_data_wrapper_name</literal></entry>
2919       <entry><type>sql_identifier</type></entry>
2920       <entry>Name of the foreign-data wrapper used by the foreign server</entry>
2921      </row>
2922
2923      <row>
2924       <entry><literal>foreign_server_type</literal></entry>
2925       <entry><type>character_data</type></entry>
2926       <entry>Foreign server type information, if specified upon creation</entry>
2927      </row>
2928
2929      <row>
2930       <entry><literal>foreign_server_version</literal></entry>
2931       <entry><type>character_data</type></entry>
2932       <entry>Foreign server version information, if specified upon creation</entry>
2933      </row>
2934
2935      <row>
2936       <entry><literal>authorization_identifier</literal></entry>
2937       <entry><type>sql_identifier</type></entry>
2938       <entry>Name of the owner of the foreign server</entry>
2939      </row>
2940     </tbody>
2941    </tgroup>
2942   </table>
2943  </sect1>
2944
2945  <sect1 id="infoschema-foreign-table-options">
2946   <title><literal>foreign_table_options</literal></title>
2947
2948   <para>
2949    The view <literal>foreign_table_options</literal> contains all the
2950    options defined for foreign tables in the current database.  Only
2951    those foreign tables are shown that the current user has access to
2952    (by way of being the owner or having some privilege).
2953   </para>
2954
2955   <table>
2956    <title><literal>foreign_table_options</literal> Columns</title>
2957
2958    <tgroup cols="3">
2959     <thead>
2960      <row>
2961       <entry>Name</entry>
2962       <entry>Data Type</entry>
2963       <entry>Description</entry>
2964      </row>
2965     </thead>
2966
2967     <tbody>
2968      <row>
2969       <entry><literal>foreign_table_catalog</literal></entry>
2970       <entry><type>sql_identifier</type></entry>
2971       <entry>Name of the database that contains the foreign table (always the current database)</entry>
2972      </row>
2973
2974      <row>
2975       <entry><literal>foreign_table_schema</literal></entry>
2976       <entry><type>sql_identifier</type></entry>
2977       <entry>Name of the schema that contains the foreign table</entry>
2978      </row>
2979
2980      <row>
2981       <entry><literal>foreign_table_name</literal></entry>
2982       <entry><type>sql_identifier</type></entry>
2983       <entry>Name of the foreign table</entry>
2984      </row>
2985
2986      <row>
2987       <entry><literal>option_name</literal></entry>
2988       <entry><type>sql_identifier</type></entry>
2989       <entry>Name of an option</entry>
2990      </row>
2991
2992      <row>
2993       <entry><literal>option_value</literal></entry>
2994       <entry><type>character_data</type></entry>
2995       <entry>Value of the option</entry>
2996      </row>
2997     </tbody>
2998    </tgroup>
2999   </table>
3000  </sect1>
3001
3002  <sect1 id="infoschema-foreign-tables">
3003   <title><literal>foreign_tables</literal></title>
3004
3005   <para>
3006    The view <literal>foreign_tables</literal> contains all foreign
3007    tables defined in the current database.  Only those foreign
3008    tables are shown that the current user has access to (by way of
3009    being the owner or having some privilege).
3010   </para>
3011
3012   <table>
3013    <title><literal>foreign_tables</literal> Columns</title>
3014
3015    <tgroup cols="3">
3016     <thead>
3017      <row>
3018       <entry>Name</entry>
3019       <entry>Data Type</entry>
3020       <entry>Description</entry>
3021      </row>
3022     </thead>
3023
3024     <tbody>
3025      <row>
3026       <entry><literal>foreign_table_catalog</literal></entry>
3027       <entry><type>sql_identifier</type></entry>
3028       <entry>Name of the database that the foreign table is defined in (always the current database)</entry>
3029      </row>
3030
3031      <row>
3032       <entry><literal>foreign_table_schema</literal></entry>
3033       <entry><type>sql_identifier</type></entry>
3034       <entry>Name of the schema that contains the foreign table</entry>
3035      </row>
3036
3037      <row>
3038       <entry><literal>foreign_table_name</literal></entry>
3039       <entry><type>sql_identifier</type></entry>
3040       <entry>Name of the foreign table</entry>
3041      </row>
3042
3043      <row>
3044       <entry><literal>foreign_server_catalog</literal></entry>
3045       <entry><type>sql_identifier</type></entry>
3046       <entry>Name of the database that the foreign server is defined in (always the current database)</entry>
3047      </row>
3048
3049      <row>
3050       <entry><literal>foreign_server_name</literal></entry>
3051       <entry><type>sql_identifier</type></entry>
3052       <entry>Name of the foreign server</entry>
3053      </row>
3054     </tbody>
3055    </tgroup>
3056   </table>
3057  </sect1>
3058
3059  <sect1 id="infoschema-key-column-usage">
3060   <title><literal>key_column_usage</literal></title>
3061
3062   <para>
3063    The view <literal>key_column_usage</literal> identifies all columns
3064    in the current database that are restricted by some unique, primary
3065    key, or foreign key constraint.  Check constraints are not included
3066    in this view.  Only those columns are shown that the current user
3067    has access to, by way of being the owner or having some privilege.
3068   </para>
3069
3070   <table>
3071    <title><literal>key_column_usage</literal> Columns</title>
3072
3073    <tgroup cols="3">
3074     <thead>
3075      <row>
3076       <entry>Name</entry>
3077       <entry>Data Type</entry>
3078       <entry>Description</entry>
3079      </row>
3080     </thead>
3081
3082     <tbody>
3083      <row>
3084       <entry><literal>constraint_catalog</literal></entry>
3085       <entry><type>sql_identifier</type></entry>
3086       <entry>Name of the database that contains the constraint (always the current database)</entry>
3087      </row>
3088
3089      <row>
3090       <entry><literal>constraint_schema</literal></entry>
3091       <entry><type>sql_identifier</type></entry>
3092       <entry>Name of the schema that contains the constraint</entry>
3093      </row>
3094
3095      <row>
3096       <entry><literal>constraint_name</literal></entry>
3097       <entry><type>sql_identifier</type></entry>
3098       <entry>Name of the constraint</entry>
3099      </row>
3100
3101      <row>
3102       <entry><literal>table_catalog</literal></entry>
3103       <entry><type>sql_identifier</type></entry>
3104       <entry>
3105        Name of the database that contains the table that contains the
3106        column that is restricted by this constraint (always the
3107        current database)
3108       </entry>
3109      </row>
3110
3111      <row>
3112       <entry><literal>table_schema</literal></entry>
3113       <entry><type>sql_identifier</type></entry>
3114       <entry>
3115        Name of the schema that contains the table that contains the
3116        column that is restricted by this constraint
3117       </entry>
3118      </row>
3119
3120      <row>
3121       <entry><literal>table_name</literal></entry>
3122       <entry><type>sql_identifier</type></entry>
3123       <entry>
3124        Name of the table that contains the column that is restricted
3125        by this constraint
3126       </entry>
3127      </row>
3128
3129      <row>
3130       <entry><literal>column_name</literal></entry>
3131       <entry><type>sql_identifier</type></entry>
3132       <entry>
3133        Name of the column that is restricted by this constraint
3134       </entry>
3135      </row>
3136
3137      <row>
3138       <entry><literal>ordinal_position</literal></entry>
3139       <entry><type>cardinal_number</type></entry>
3140       <entry>
3141        Ordinal position of the column within the constraint key (count
3142        starts at 1)
3143       </entry>
3144      </row>
3145
3146      <row>
3147       <entry><literal>position_in_unique_constraint</literal></entry>
3148       <entry><type>cardinal_number</type></entry>
3149       <entry>
3150        For a foreign-key constraint, ordinal position of the referenced
3151        column within its unique constraint (count starts at 1);
3152        otherwise null
3153       </entry>
3154      </row>
3155     </tbody>
3156    </tgroup>
3157   </table>
3158  </sect1>
3159
3160  <sect1 id="infoschema-parameters">
3161   <title><literal>parameters</literal></title>
3162
3163   <para>
3164    The view <literal>parameters</literal> contains information about
3165    the parameters (arguments) of all functions in the current database.
3166    Only those functions are shown that the current user has access to
3167    (by way of being the owner or having some privilege).
3168   </para>
3169
3170   <table>
3171    <title><literal>parameters</literal> Columns</title>
3172
3173    <tgroup cols="3">
3174     <thead>
3175      <row>
3176       <entry>Name</entry>
3177       <entry>Data Type</entry>
3178       <entry>Description</entry>
3179      </row>
3180     </thead>
3181
3182     <tbody>
3183      <row>
3184       <entry><literal>specific_catalog</literal></entry>
3185       <entry><type>sql_identifier</type></entry>
3186       <entry>Name of the database containing the function (always the current database)</entry>
3187      </row>
3188
3189      <row>
3190       <entry><literal>specific_schema</literal></entry>
3191       <entry><type>sql_identifier</type></entry>
3192       <entry>Name of the schema containing the function</entry>
3193      </row>
3194
3195      <row>
3196       <entry><literal>specific_name</literal></entry>
3197       <entry><type>sql_identifier</type></entry>
3198       <entry>
3199        The <quote>specific name</quote> of the function.  See <xref
3200        linkend="infoschema-routines"/> for more information.
3201       </entry>
3202      </row>
3203
3204      <row>
3205       <entry><literal>ordinal_position</literal></entry>
3206       <entry><type>cardinal_number</type></entry>
3207       <entry>
3208        Ordinal position of the parameter in the argument list of the
3209        function (count starts at 1)
3210       </entry>
3211      </row>
3212
3213      <row>
3214       <entry><literal>parameter_mode</literal></entry>
3215       <entry><type>character_data</type></entry>
3216       <entry>
3217        <literal>IN</literal> for input parameter,
3218        <literal>OUT</literal> for output parameter,
3219        and <literal>INOUT</literal> for input/output parameter.
3220       </entry>
3221      </row>
3222
3223      <row>
3224       <entry><literal>is_result</literal></entry>
3225       <entry><type>yes_or_no</type></entry>
3226       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
3227      </row>
3228
3229      <row>
3230       <entry><literal>as_locator</literal></entry>
3231       <entry><type>yes_or_no</type></entry>
3232       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
3233      </row>
3234
3235      <row>
3236       <entry><literal>parameter_name</literal></entry>
3237       <entry><type>sql_identifier</type></entry>
3238       <entry>Name of the parameter, or null if the parameter has no name</entry>
3239      </row>
3240
3241      <row>
3242       <entry><literal>data_type</literal></entry>
3243       <entry><type>character_data</type></entry>
3244       <entry>
3245        Data type of the parameter, if it is a built-in type, or
3246        <literal>ARRAY</literal> if it is some array (in that case, see
3247        the view <literal>element_types</literal>), else
3248        <literal>USER-DEFINED</literal> (in that case, the type is
3249        identified in <literal>udt_name</literal> and associated
3250        columns).
3251       </entry>
3252      </row>
3253
3254      <row>
3255       <entry><literal>character_maximum_length</literal></entry>
3256       <entry><type>cardinal_number</type></entry>
3257       <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</productname></entry>
3258      </row>
3259
3260      <row>
3261       <entry><literal>character_octet_length</literal></entry>
3262       <entry><type>cardinal_number</type></entry>
3263       <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</productname></entry>
3264      </row>
3265
3266      <row>
3267       <entry><literal>character_set_catalog</literal></entry>
3268       <entry><type>sql_identifier</type></entry>
3269       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
3270      </row>
3271
3272      <row>
3273       <entry><literal>character_set_schema</literal></entry>
3274       <entry><type>sql_identifier</type></entry>
3275       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
3276      </row>
3277
3278      <row>
3279       <entry><literal>character_set_name</literal></entry>
3280       <entry><type>sql_identifier</type></entry>
3281       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
3282      </row>
3283
3284      <row>
3285       <entry><literal>collation_catalog</literal></entry>
3286       <entry><type>sql_identifier</type></entry>
3287       <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</productname></entry>
3288      </row>
3289
3290      <row>
3291       <entry><literal>collation_schema</literal></entry>
3292       <entry><type>sql_identifier</type></entry>
3293       <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</productname></entry>
3294      </row>
3295
3296      <row>
3297       <entry><literal>collation_name</literal></entry>
3298       <entry><type>sql_identifier</type></entry>
3299       <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</productname></entry>
3300      </row>
3301
3302      <row>
3303       <entry><literal>numeric_precision</literal></entry>
3304       <entry><type>cardinal_number</type></entry>
3305       <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</productname></entry>
3306      </row>
3307
3308      <row>
3309       <entry><literal>numeric_precision_radix</literal></entry>
3310       <entry><type>cardinal_number</type></entry>
3311       <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</productname></entry>
3312      </row>
3313
3314      <row>
3315       <entry><literal>numeric_scale</literal></entry>
3316       <entry><type>cardinal_number</type></entry>
3317       <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</productname></entry>
3318      </row>
3319
3320      <row>
3321       <entry><literal>datetime_precision</literal></entry>
3322       <entry><type>cardinal_number</type></entry>
3323       <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</productname></entry>
3324      </row>
3325
3326      <row>
3327       <entry><literal>interval_type</literal></entry>
3328       <entry><type>character_data</type></entry>
3329       <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</productname></entry>
3330      </row>
3331
3332      <row>
3333       <entry><literal>interval_precision</literal></entry>
3334       <entry><type>cardinal_number</type></entry>
3335       <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</productname></entry>
3336      </row>
3337
3338      <row>
3339       <entry><literal>udt_catalog</literal></entry>
3340       <entry><type>sql_identifier</type></entry>
3341       <entry>
3342        Name of the database that the data type of the parameter is
3343        defined in (always the current database)
3344       </entry>
3345      </row>
3346
3347      <row>
3348       <entry><literal>udt_schema</literal></entry>
3349       <entry><type>sql_identifier</type></entry>
3350       <entry>
3351        Name of the schema that the data type of the parameter is
3352        defined in
3353       </entry>
3354      </row>
3355
3356      <row>
3357       <entry><literal>udt_name</literal></entry>
3358       <entry><type>sql_identifier</type></entry>
3359       <entry>
3360        Name of the data type of the parameter
3361       </entry>
3362      </row>
3363
3364      <row>
3365       <entry><literal>scope_catalog</literal></entry>
3366       <entry><type>sql_identifier</type></entry>
3367       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
3368      </row>
3369
3370      <row>
3371       <entry><literal>scope_schema</literal></entry>
3372       <entry><type>sql_identifier</type></entry>
3373       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
3374      </row>
3375
3376      <row>
3377       <entry><literal>scope_name</literal></entry>
3378       <entry><type>sql_identifier</type></entry>
3379       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
3380      </row>
3381
3382      <row>
3383       <entry><literal>maximum_cardinality</literal></entry>
3384       <entry><type>cardinal_number</type></entry>
3385       <entry>Always null, because arrays always have unlimited maximum cardinality in <productname>PostgreSQL</productname></entry>
3386      </row>
3387
3388      <row>
3389       <entry><literal>dtd_identifier</literal></entry>
3390       <entry><type>sql_identifier</type></entry>
3391       <entry>
3392        An identifier of the data type descriptor of the parameter,
3393        unique among the data type descriptors pertaining to the
3394        function.  This is mainly useful for joining with other
3395        instances of such identifiers.  (The specific format of the
3396        identifier is not defined and not guaranteed to remain the same
3397        in future versions.)
3398       </entry>
3399      </row>
3400
3401      <row>
3402       <entry><literal>parameter_default</literal></entry>
3403       <entry><type>character_data</type></entry>
3404       <entry>
3405        The default expression of the parameter, or null if none or if the
3406        function is not owned by a currently enabled role.
3407       </entry>
3408      </row>
3409     </tbody>
3410    </tgroup>
3411   </table>
3412  </sect1>
3413
3414  <sect1 id="infoschema-referential-constraints">
3415   <title><literal>referential_constraints</literal></title>
3416
3417   <para>
3418    The view <literal>referential_constraints</literal> contains all
3419    referential (foreign key) constraints in the current database.
3420    Only those constraints are shown for which the current user has
3421    write access to the referencing table (by way of being the
3422    owner or having some privilege other than <literal>SELECT</literal>).
3423   </para>
3424
3425   <table>
3426    <title><literal>referential_constraints</literal> Columns</title>
3427
3428    <tgroup cols="3">
3429     <thead>
3430      <row>
3431       <entry>Name</entry>
3432       <entry>Data Type</entry>
3433       <entry>Description</entry>
3434      </row>
3435     </thead>
3436
3437     <tbody>
3438      <row>
3439       <entry><literal>constraint_catalog</literal></entry>
3440       <entry><literal>sql_identifier</literal></entry>
3441       <entry>Name of the database containing the constraint (always the current database)</entry>
3442      </row>
3443
3444      <row>
3445       <entry><literal>constraint_schema</literal></entry>
3446       <entry><literal>sql_identifier</literal></entry>
3447       <entry>Name of the schema containing the constraint</entry>
3448      </row>
3449
3450      <row>
3451       <entry><literal>constraint_name</literal></entry>
3452       <entry><literal>sql_identifier</literal></entry>
3453       <entry>Name of the constraint</entry>
3454      </row>
3455
3456      <row>
3457       <entry><literal>unique_constraint_catalog</literal></entry>
3458       <entry><literal>sql_identifier</literal></entry>
3459       <entry>
3460        Name of the database that contains the unique or primary key
3461        constraint that the foreign key constraint references (always
3462        the current database)
3463       </entry>
3464      </row>
3465
3466      <row>
3467       <entry><literal>unique_constraint_schema</literal></entry>
3468       <entry><literal>sql_identifier</literal></entry>
3469       <entry>
3470        Name of the schema that contains the unique or primary key
3471        constraint that the foreign key constraint references
3472       </entry>
3473      </row>
3474
3475      <row>
3476       <entry><literal>unique_constraint_name</literal></entry>
3477       <entry><literal>sql_identifier</literal></entry>
3478       <entry>
3479        Name of the unique or primary key constraint that the foreign
3480        key constraint references
3481       </entry>
3482      </row>
3483
3484      <row>
3485       <entry><literal>match_option</literal></entry>
3486       <entry><literal>character_data</literal></entry>
3487       <entry>
3488        Match option of the foreign key constraint:
3489        <literal>FULL</literal>, <literal>PARTIAL</literal>, or
3490        <literal>NONE</literal>.
3491       </entry>
3492      </row>
3493
3494      <row>
3495       <entry><literal>update_rule</literal></entry>
3496       <entry><literal>character_data</literal></entry>
3497       <entry>
3498        Update rule of the foreign key constraint:
3499        <literal>CASCADE</literal>, <literal>SET NULL</literal>,
3500        <literal>SET DEFAULT</literal>, <literal>RESTRICT</literal>, or
3501        <literal>NO ACTION</literal>.
3502       </entry>
3503      </row>
3504
3505      <row>
3506       <entry><literal>delete_rule</literal></entry>
3507       <entry><literal>character_data</literal></entry>
3508       <entry>
3509        Delete rule of the foreign key constraint:
3510        <literal>CASCADE</literal>, <literal>SET NULL</literal>,
3511        <literal>SET DEFAULT</literal>, <literal>RESTRICT</literal>, or
3512        <literal>NO ACTION</literal>.
3513       </entry>
3514      </row>
3515     </tbody>
3516    </tgroup>
3517   </table>
3518
3519  </sect1>
3520
3521  <sect1 id="infoschema-role-column-grants">
3522   <title><literal>role_column_grants</literal></title>
3523
3524   <para>
3525    The view <literal>role_column_grants</literal> identifies all
3526    privileges granted on columns where the grantor or grantee is a
3527    currently enabled role.  Further information can be found under
3528    <literal>column_privileges</literal>.  The only effective
3529    difference between this view
3530    and <literal>column_privileges</literal> is that this view omits
3531    columns that have been made accessible to the current user by way
3532    of a grant to <literal>PUBLIC</literal>.
3533   </para>
3534
3535   <table>
3536    <title><literal>role_column_grants</literal> Columns</title>
3537
3538    <tgroup cols="3">
3539     <thead>
3540      <row>
3541       <entry>Name</entry>
3542       <entry>Data Type</entry>
3543       <entry>Description</entry>
3544      </row>
3545     </thead>
3546
3547     <tbody>
3548      <row>
3549       <entry><literal>grantor</literal></entry>
3550       <entry><type>sql_identifier</type></entry>
3551       <entry>Name of the role that granted the privilege</entry>
3552      </row>
3553
3554      <row>
3555       <entry><literal>grantee</literal></entry>
3556       <entry><type>sql_identifier</type></entry>
3557       <entry>Name of the role that the privilege was granted to</entry>
3558      </row>
3559
3560      <row>
3561       <entry><literal>table_catalog</literal></entry>
3562       <entry><type>sql_identifier</type></entry>
3563       <entry>Name of the database that contains the table that contains the column (always the current database)</entry>
3564      </row>
3565
3566      <row>
3567       <entry><literal>table_schema</literal></entry>
3568       <entry><type>sql_identifier</type></entry>
3569       <entry>Name of the schema that contains the table that contains the column</entry>
3570      </row>
3571
3572      <row>
3573       <entry><literal>table_name</literal></entry>
3574       <entry><type>sql_identifier</type></entry>
3575       <entry>Name of the table that contains the column</entry>
3576      </row>
3577
3578      <row>
3579       <entry><literal>column_name</literal></entry>
3580       <entry><type>sql_identifier</type></entry>
3581       <entry>Name of the column</entry>
3582      </row>
3583
3584      <row>
3585       <entry><literal>privilege_type</literal></entry>
3586       <entry><type>character_data</type></entry>
3587       <entry>
3588        Type of the privilege: <literal>SELECT</literal>,
3589        <literal>INSERT</literal>, <literal>UPDATE</literal>, or
3590        <literal>REFERENCES</literal>
3591       </entry>
3592      </row>
3593
3594      <row>
3595       <entry><literal>is_grantable</literal></entry>
3596       <entry><type>yes_or_no</type></entry>
3597       <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
3598      </row>
3599     </tbody>
3600    </tgroup>
3601   </table>
3602  </sect1>
3603
3604  <sect1 id="infoschema-role-routine-grants">
3605   <title><literal>role_routine_grants</literal></title>
3606
3607   <para>
3608    The view <literal>role_routine_grants</literal> identifies all
3609    privileges granted on functions where the grantor or grantee is a
3610    currently enabled role.  Further information can be found under
3611    <literal>routine_privileges</literal>.  The only effective
3612    difference between this view
3613    and <literal>routine_privileges</literal> is that this view omits
3614    functions that have been made accessible to the current user by way
3615    of a grant to <literal>PUBLIC</literal>.
3616   </para>
3617
3618   <table>
3619    <title><literal>role_routine_grants</literal> Columns</title>
3620
3621    <tgroup cols="3">
3622     <thead>
3623      <row>
3624       <entry>Name</entry>
3625       <entry>Data Type</entry>
3626       <entry>Description</entry>
3627      </row>
3628     </thead>
3629
3630     <tbody>
3631      <row>
3632       <entry><literal>grantor</literal></entry>
3633       <entry><type>sql_identifier</type></entry>
3634       <entry>Name of the role that granted the privilege</entry>
3635      </row>
3636
3637      <row>
3638       <entry><literal>grantee</literal></entry>
3639       <entry><type>sql_identifier</type></entry>
3640       <entry>Name of the role that the privilege was granted to</entry>
3641      </row>
3642
3643      <row>
3644       <entry><literal>specific_catalog</literal></entry>
3645       <entry><type>sql_identifier</type></entry>
3646       <entry>Name of the database containing the function (always the current database)</entry>
3647      </row>
3648
3649      <row>
3650       <entry><literal>specific_schema</literal></entry>
3651       <entry><type>sql_identifier</type></entry>
3652       <entry>Name of the schema containing the function</entry>
3653      </row>
3654
3655      <row>
3656       <entry><literal>specific_name</literal></entry>
3657       <entry><type>sql_identifier</type></entry>
3658       <entry>
3659        The <quote>specific name</quote> of the function.  See <xref
3660        linkend="infoschema-routines"/> for more information.
3661       </entry>
3662      </row>
3663
3664      <row>
3665       <entry><literal>routine_catalog</literal></entry>
3666       <entry><type>sql_identifier</type></entry>
3667       <entry>Name of the database containing the function (always the current database)</entry>
3668      </row>
3669
3670      <row>
3671       <entry><literal>routine_schema</literal></entry>
3672       <entry><type>sql_identifier</type></entry>
3673       <entry>Name of the schema containing the function</entry>
3674      </row>
3675
3676      <row>
3677       <entry><literal>routine_name</literal></entry>
3678       <entry><type>sql_identifier</type></entry>
3679       <entry>Name of the function (might be duplicated in case of overloading)</entry>
3680      </row>
3681
3682      <row>
3683       <entry><literal>privilege_type</literal></entry>
3684       <entry><type>character_data</type></entry>
3685       <entry>Always <literal>EXECUTE</literal> (the only privilege type for functions)</entry>
3686      </row>
3687
3688      <row>
3689       <entry><literal>is_grantable</literal></entry>
3690       <entry><type>yes_or_no</type></entry>
3691       <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
3692      </row>
3693     </tbody>
3694    </tgroup>
3695   </table>
3696  </sect1>
3697
3698  <sect1 id="infoschema-role-table-grants">
3699   <title><literal>role_table_grants</literal></title>
3700
3701   <para>
3702    The view <literal>role_table_grants</literal> identifies all
3703    privileges granted on tables or views where the grantor or grantee
3704    is a currently enabled role.  Further information can be found
3705    under <literal>table_privileges</literal>.  The only effective
3706    difference between this view
3707    and <literal>table_privileges</literal> is that this view omits
3708    tables that have been made accessible to the current user by way of
3709    a grant to <literal>PUBLIC</literal>.
3710   </para>
3711
3712   <table>
3713    <title><literal>role_table_grants</literal> Columns</title>
3714
3715    <tgroup cols="3">
3716     <thead>
3717      <row>
3718       <entry>Name</entry>
3719       <entry>Data Type</entry>
3720       <entry>Description</entry>
3721      </row>
3722     </thead>
3723
3724     <tbody>
3725      <row>
3726       <entry><literal>grantor</literal></entry>
3727       <entry><type>sql_identifier</type></entry>
3728       <entry>Name of the role that granted the privilege</entry>
3729      </row>
3730
3731      <row>
3732       <entry><literal>grantee</literal></entry>
3733       <entry><type>sql_identifier</type></entry>
3734       <entry>Name of the role that the privilege was granted to</entry>
3735      </row>
3736
3737      <row>
3738       <entry><literal>table_catalog</literal></entry>
3739       <entry><type>sql_identifier</type></entry>
3740       <entry>Name of the database that contains the table (always the current database)</entry>
3741      </row>
3742
3743      <row>
3744       <entry><literal>table_schema</literal></entry>
3745       <entry><type>sql_identifier</type></entry>
3746       <entry>Name of the schema that contains the table</entry>
3747      </row>
3748
3749      <row>
3750       <entry><literal>table_name</literal></entry>
3751       <entry><type>sql_identifier</type></entry>
3752       <entry>Name of the table</entry>
3753      </row>
3754
3755      <row>
3756       <entry><literal>privilege_type</literal></entry>
3757       <entry><type>character_data</type></entry>
3758       <entry>
3759        Type of the privilege: <literal>SELECT</literal>,
3760        <literal>INSERT</literal>, <literal>UPDATE</literal>,
3761        <literal>DELETE</literal>, <literal>TRUNCATE</literal>,
3762        <literal>REFERENCES</literal>, or <literal>TRIGGER</literal>
3763       </entry>
3764      </row>
3765
3766      <row>
3767       <entry><literal>is_grantable</literal></entry>
3768       <entry><type>yes_or_no</type></entry>
3769       <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
3770      </row>
3771
3772      <row>
3773       <entry><literal>with_hierarchy</literal></entry>
3774       <entry><type>yes_or_no</type></entry>
3775       <entry>
3776        In the SQL standard, <literal>WITH HIERARCHY OPTION</literal>
3777        is a separate (sub-)privilege allowing certain operations on
3778        table inheritance hierarchies.  In PostgreSQL, this is included
3779        in the <literal>SELECT</literal> privilege, so this column
3780        shows <literal>YES</literal> if the privilege
3781        is <literal>SELECT</literal>, else <literal>NO</literal>.
3782       </entry>
3783      </row>
3784     </tbody>
3785    </tgroup>
3786   </table>
3787  </sect1>
3788
3789  <sect1 id="infoschema-role-udt-grants">
3790   <title><literal>role_udt_grants</literal></title>
3791
3792   <para>
3793    The view <literal>role_udt_grants</literal> is intended to identify
3794    <literal>USAGE</literal> privileges granted on user-defined types
3795    where the grantor or grantee is a currently enabled role.  Further
3796    information can be found under
3797    <literal>udt_privileges</literal>.  The only effective difference
3798    between this view and <literal>udt_privileges</literal> is that
3799    this view omits objects that have been made accessible to the
3800    current user by way of a grant to <literal>PUBLIC</literal>.  Since
3801    data types do not have real privileges in PostgreSQL, but only an
3802    implicit grant to <literal>PUBLIC</literal>, this view is empty.
3803   </para>
3804
3805   <table>
3806    <title><literal>role_udt_grants</literal> Columns</title>
3807
3808    <tgroup cols="3">
3809     <thead>
3810      <row>
3811       <entry>Name</entry>
3812       <entry>Data Type</entry>
3813       <entry>Description</entry>
3814      </row>
3815     </thead>
3816
3817     <tbody>
3818      <row>
3819       <entry><literal>grantor</literal></entry>
3820       <entry><type>sql_identifier</type></entry>
3821       <entry>The name of the role that granted the privilege</entry>
3822      </row>
3823
3824      <row>
3825       <entry><literal>grantee</literal></entry>
3826       <entry><type>sql_identifier</type></entry>
3827       <entry>The name of the role that the privilege was granted to</entry>
3828      </row>
3829
3830      <row>
3831       <entry><literal>udt_catalog</literal></entry>
3832       <entry><type>sql_identifier</type></entry>
3833       <entry>Name of the database containing the type (always the current database)</entry>
3834      </row>
3835
3836      <row>
3837       <entry><literal>udt_schema</literal></entry>
3838       <entry><type>sql_identifier</type></entry>
3839       <entry>Name of the schema containing the type</entry>
3840      </row>
3841
3842      <row>
3843       <entry><literal>udt_name</literal></entry>
3844       <entry><type>sql_identifier</type></entry>
3845       <entry>Name of the type</entry>
3846      </row>
3847
3848      <row>
3849       <entry><literal>privilege_type</literal></entry>
3850       <entry><type>character_data</type></entry>
3851       <entry>Always <literal>TYPE USAGE</literal></entry>
3852      </row>
3853
3854      <row>
3855       <entry><literal>is_grantable</literal></entry>
3856       <entry><type>yes_or_no</type></entry>
3857       <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
3858      </row>
3859     </tbody>
3860    </tgroup>
3861   </table>
3862  </sect1>
3863
3864  <sect1 id="infoschema-role-usage-grants">
3865   <title><literal>role_usage_grants</literal></title>
3866
3867   <para>
3868    The view <literal>role_usage_grants</literal> identifies
3869    <literal>USAGE</literal> privileges granted on various kinds of
3870    objects where the grantor or grantee is a currently enabled role.
3871    Further information can be found under
3872    <literal>usage_privileges</literal>.  The only effective difference
3873    between this view and <literal>usage_privileges</literal> is that
3874    this view omits objects that have been made accessible to the
3875    current user by way of a grant to <literal>PUBLIC</literal>.
3876   </para>
3877
3878   <table>
3879    <title><literal>role_usage_grants</literal> Columns</title>
3880
3881    <tgroup cols="3">
3882     <thead>
3883      <row>
3884       <entry>Name</entry>
3885       <entry>Data Type</entry>
3886       <entry>Description</entry>
3887      </row>
3888     </thead>
3889
3890     <tbody>
3891      <row>
3892       <entry><literal>grantor</literal></entry>
3893       <entry><type>sql_identifier</type></entry>
3894       <entry>The name of the role that granted the privilege</entry>
3895      </row>
3896
3897      <row>
3898       <entry><literal>grantee</literal></entry>
3899       <entry><type>sql_identifier</type></entry>
3900       <entry>The name of the role that the privilege was granted to</entry>
3901      </row>
3902
3903      <row>
3904       <entry><literal>object_catalog</literal></entry>
3905       <entry><type>sql_identifier</type></entry>
3906       <entry>Name of the database containing the object (always the current database)</entry>
3907      </row>
3908
3909      <row>
3910       <entry><literal>object_schema</literal></entry>
3911       <entry><type>sql_identifier</type></entry>
3912       <entry>Name of the schema containing the object, if applicable,
3913       else an empty string</entry>
3914      </row>
3915
3916      <row>
3917       <entry><literal>object_name</literal></entry>
3918       <entry><type>sql_identifier</type></entry>
3919       <entry>Name of the object</entry>
3920      </row>
3921
3922      <row>
3923       <entry><literal>object_type</literal></entry>
3924       <entry><type>character_data</type></entry>
3925       <entry><literal>COLLATION</literal> or <literal>DOMAIN</literal> or <literal>FOREIGN DATA WRAPPER</literal> or <literal>FOREIGN SERVER</literal> or <literal>SEQUENCE</literal></entry>
3926      </row>
3927
3928      <row>
3929       <entry><literal>privilege_type</literal></entry>
3930       <entry><type>character_data</type></entry>
3931       <entry>Always <literal>USAGE</literal></entry>
3932      </row>
3933
3934      <row>
3935       <entry><literal>is_grantable</literal></entry>
3936       <entry><type>yes_or_no</type></entry>
3937       <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
3938      </row>
3939     </tbody>
3940    </tgroup>
3941   </table>
3942  </sect1>
3943
3944  <sect1 id="infoschema-routine-privileges">
3945   <title><literal>routine_privileges</literal></title>
3946
3947   <para>
3948    The view <literal>routine_privileges</literal> identifies all
3949    privileges granted on functions to a currently enabled role or by a
3950    currently enabled role.  There is one row for each combination of function,
3951    grantor, and grantee.
3952   </para>
3953
3954   <table>
3955    <title><literal>routine_privileges</literal> Columns</title>
3956
3957    <tgroup cols="3">
3958     <thead>
3959      <row>
3960       <entry>Name</entry>
3961       <entry>Data Type</entry>
3962       <entry>Description</entry>
3963      </row>
3964     </thead>
3965
3966     <tbody>
3967      <row>
3968       <entry><literal>grantor</literal></entry>
3969       <entry><type>sql_identifier</type></entry>
3970       <entry>Name of the role that granted the privilege</entry>
3971      </row>
3972
3973      <row>
3974       <entry><literal>grantee</literal></entry>
3975       <entry><type>sql_identifier</type></entry>
3976       <entry>Name of the role that the privilege was granted to</entry>
3977      </row>
3978
3979      <row>
3980       <entry><literal>specific_catalog</literal></entry>
3981       <entry><type>sql_identifier</type></entry>
3982       <entry>Name of the database containing the function (always the current database)</entry>
3983      </row>
3984
3985      <row>
3986       <entry><literal>specific_schema</literal></entry>
3987       <entry><type>sql_identifier</type></entry>
3988       <entry>Name of the schema containing the function</entry>
3989      </row>
3990
3991      <row>
3992       <entry><literal>specific_name</literal></entry>
3993       <entry><type>sql_identifier</type></entry>
3994       <entry>
3995        The <quote>specific name</quote> of the function.  See <xref
3996        linkend="infoschema-routines"/> for more information.
3997       </entry>
3998      </row>
3999
4000      <row>
4001       <entry><literal>routine_catalog</literal></entry>
4002       <entry><type>sql_identifier</type></entry>
4003       <entry>Name of the database containing the function (always the current database)</entry>
4004      </row>
4005
4006      <row>
4007       <entry><literal>routine_schema</literal></entry>
4008       <entry><type>sql_identifier</type></entry>
4009       <entry>Name of the schema containing the function</entry>
4010      </row>
4011
4012      <row>
4013       <entry><literal>routine_name</literal></entry>
4014       <entry><type>sql_identifier</type></entry>
4015       <entry>Name of the function (might be duplicated in case of overloading)</entry>
4016      </row>
4017
4018      <row>
4019       <entry><literal>privilege_type</literal></entry>
4020       <entry><type>character_data</type></entry>
4021       <entry>Always <literal>EXECUTE</literal> (the only privilege type for functions)</entry>
4022      </row>
4023
4024      <row>
4025       <entry><literal>is_grantable</literal></entry>
4026       <entry><type>yes_or_no</type></entry>
4027       <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
4028      </row>
4029     </tbody>
4030    </tgroup>
4031   </table>
4032  </sect1>
4033
4034  <sect1 id="infoschema-routines">
4035   <title><literal>routines</literal></title>
4036
4037   <para>
4038    The view <literal>routines</literal> contains all functions and procedures in the
4039    current database.  Only those functions and procedures are shown that the current
4040    user has access to (by way of being the owner or having some
4041    privilege).
4042   </para>
4043
4044   <table>
4045    <title><literal>routines</literal> Columns</title>
4046
4047    <tgroup cols="3">
4048     <thead>
4049      <row>
4050       <entry>Name</entry>
4051       <entry>Data Type</entry>
4052       <entry>Description</entry>
4053      </row>
4054     </thead>
4055
4056     <tbody>
4057      <row>
4058       <entry><literal>specific_catalog</literal></entry>
4059       <entry><type>sql_identifier</type></entry>
4060       <entry>Name of the database containing the function (always the current database)</entry>
4061      </row>
4062
4063      <row>
4064       <entry><literal>specific_schema</literal></entry>
4065       <entry><type>sql_identifier</type></entry>
4066       <entry>Name of the schema containing the function</entry>
4067      </row>
4068
4069      <row>
4070       <entry><literal>specific_name</literal></entry>
4071       <entry><type>sql_identifier</type></entry>
4072       <entry>
4073        The <quote>specific name</quote> of the function.  This is a
4074        name that uniquely identifies the function in the schema, even
4075        if the real name of the function is overloaded.  The format of
4076        the specific name is not defined, it should only be used to
4077        compare it to other instances of specific routine names.
4078       </entry>
4079      </row>
4080
4081      <row>
4082       <entry><literal>routine_catalog</literal></entry>
4083       <entry><type>sql_identifier</type></entry>
4084       <entry>Name of the database containing the function (always the current database)</entry>
4085      </row>
4086
4087      <row>
4088       <entry><literal>routine_schema</literal></entry>
4089       <entry><type>sql_identifier</type></entry>
4090       <entry>Name of the schema containing the function</entry>
4091      </row>
4092
4093      <row>
4094       <entry><literal>routine_name</literal></entry>
4095       <entry><type>sql_identifier</type></entry>
4096       <entry>Name of the function (might be duplicated in case of overloading)</entry>
4097      </row>
4098
4099      <row>
4100       <entry><literal>routine_type</literal></entry>
4101       <entry><type>character_data</type></entry>
4102       <entry>
4103        <literal>FUNCTION</literal> for a
4104        function, <literal>PROCEDURE</literal> for a procedure
4105       </entry>
4106      </row>
4107
4108      <row>
4109       <entry><literal>module_catalog</literal></entry>
4110       <entry><type>sql_identifier</type></entry>
4111       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
4112      </row>
4113
4114      <row>
4115       <entry><literal>module_schema</literal></entry>
4116       <entry><type>sql_identifier</type></entry>
4117       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
4118      </row>
4119
4120      <row>
4121       <entry><literal>module_name</literal></entry>
4122       <entry><type>sql_identifier</type></entry>
4123       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
4124      </row>
4125
4126      <row>
4127       <entry><literal>udt_catalog</literal></entry>
4128       <entry><type>sql_identifier</type></entry>
4129       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
4130      </row>
4131
4132      <row>
4133       <entry><literal>udt_schema</literal></entry>
4134       <entry><type>sql_identifier</type></entry>
4135       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
4136      </row>
4137
4138      <row>
4139       <entry><literal>udt_name</literal></entry>
4140       <entry><type>sql_identifier</type></entry>
4141       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
4142      </row>
4143
4144      <row>
4145       <entry><literal>data_type</literal></entry>
4146       <entry><type>character_data</type></entry>
4147       <entry>
4148        Return data type of the function, if it is a built-in type, or
4149        <literal>ARRAY</literal> if it is some array (in that case, see
4150        the view <literal>element_types</literal>), else
4151        <literal>USER-DEFINED</literal> (in that case, the type is
4152        identified in <literal>type_udt_name</literal> and associated
4153        columns).  Null for a procedure.
4154       </entry>
4155      </row>
4156
4157      <row>
4158       <entry><literal>character_maximum_length</literal></entry>
4159       <entry><type>cardinal_number</type></entry>
4160       <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</productname></entry>
4161      </row>
4162
4163      <row>
4164       <entry><literal>character_octet_length</literal></entry>
4165       <entry><type>cardinal_number</type></entry>
4166       <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</productname></entry>
4167      </row>
4168
4169      <row>
4170       <entry><literal>character_set_catalog</literal></entry>
4171       <entry><type>sql_identifier</type></entry>
4172       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
4173      </row>
4174
4175      <row>
4176       <entry><literal>character_set_schema</literal></entry>
4177       <entry><type>sql_identifier</type></entry>
4178       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
4179      </row>
4180
4181      <row>
4182       <entry><literal>character_set_name</literal></entry>
4183       <entry><type>sql_identifier</type></entry>
4184       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
4185      </row>
4186
4187      <row>
4188       <entry><literal>collation_catalog</literal></entry>
4189       <entry><type>sql_identifier</type></entry>
4190       <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</productname></entry>
4191      </row>
4192
4193      <row>
4194       <entry><literal>collation_schema</literal></entry>
4195       <entry><type>sql_identifier</type></entry>
4196       <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</productname></entry>
4197      </row>
4198
4199      <row>
4200       <entry><literal>collation_name</literal></entry>
4201       <entry><type>sql_identifier</type></entry>
4202       <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</productname></entry>
4203      </row>
4204
4205      <row>
4206       <entry><literal>numeric_precision</literal></entry>
4207       <entry><type>cardinal_number</type></entry>
4208       <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</productname></entry>
4209      </row>
4210
4211      <row>
4212       <entry><literal>numeric_precision_radix</literal></entry>
4213       <entry><type>cardinal_number</type></entry>
4214       <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</productname></entry>
4215      </row>
4216
4217      <row>
4218       <entry><literal>numeric_scale</literal></entry>
4219       <entry><type>cardinal_number</type></entry>
4220       <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</productname></entry>
4221      </row>
4222
4223      <row>
4224       <entry><literal>datetime_precision</literal></entry>
4225       <entry><type>cardinal_number</type></entry>
4226       <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</productname></entry>
4227      </row>
4228
4229      <row>
4230       <entry><literal>interval_type</literal></entry>
4231       <entry><type>character_data</type></entry>
4232       <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</productname></entry>
4233      </row>
4234
4235      <row>
4236       <entry><literal>interval_precision</literal></entry>
4237       <entry><type>cardinal_number</type></entry>
4238       <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</productname></entry>
4239      </row>
4240
4241      <row>
4242       <entry><literal>type_udt_catalog</literal></entry>
4243       <entry><type>sql_identifier</type></entry>
4244       <entry>
4245        Name of the database that the return data type of the function
4246        is defined in (always the current database).  Null for a procedure.
4247       </entry>
4248      </row>
4249
4250      <row>
4251       <entry><literal>type_udt_schema</literal></entry>
4252       <entry><type>sql_identifier</type></entry>
4253       <entry>
4254        Name of the schema that the return data type of the function is
4255        defined in.  Null for a procedure.
4256       </entry>
4257      </row>
4258
4259      <row>
4260       <entry><literal>type_udt_name</literal></entry>
4261       <entry><type>sql_identifier</type></entry>
4262       <entry>
4263        Name of the return data type of the function.  Null for a procedure.
4264       </entry>
4265      </row>
4266
4267      <row>
4268       <entry><literal>scope_catalog</literal></entry>
4269       <entry><type>sql_identifier</type></entry>
4270       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
4271      </row>
4272
4273      <row>
4274       <entry><literal>scope_schema</literal></entry>
4275       <entry><type>sql_identifier</type></entry>
4276       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
4277      </row>
4278
4279      <row>
4280       <entry><literal>scope_name</literal></entry>
4281       <entry><type>sql_identifier</type></entry>
4282       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
4283      </row>
4284
4285      <row>
4286       <entry><literal>maximum_cardinality</literal></entry>
4287       <entry><type>cardinal_number</type></entry>
4288       <entry>Always null, because arrays always have unlimited maximum cardinality in <productname>PostgreSQL</productname></entry>
4289      </row>
4290
4291      <row>
4292       <entry><literal>dtd_identifier</literal></entry>
4293       <entry><type>sql_identifier</type></entry>
4294       <entry>
4295        An identifier of the data type descriptor of the return data
4296        type of this function, unique among the data type descriptors
4297        pertaining to the function.  This is mainly useful for joining
4298        with other instances of such identifiers.  (The specific format
4299        of the identifier is not defined and not guaranteed to remain
4300        the same in future versions.)
4301       </entry>
4302      </row>
4303
4304      <row>
4305       <entry><literal>routine_body</literal></entry>
4306       <entry><type>character_data</type></entry>
4307       <entry>
4308        If the function is an SQL function, then
4309        <literal>SQL</literal>, else <literal>EXTERNAL</literal>.
4310       </entry>
4311      </row>
4312
4313      <row>
4314       <entry><literal>routine_definition</literal></entry>
4315       <entry><type>character_data</type></entry>
4316       <entry>
4317        The source text of the function (null if the function is not
4318        owned by a currently enabled role).  (According to the SQL
4319        standard, this column is only applicable if
4320        <literal>routine_body</literal> is <literal>SQL</literal>, but
4321        in <productname>PostgreSQL</productname> it will contain
4322        whatever source text was specified when the function was
4323        created.)
4324       </entry>
4325      </row>
4326
4327      <row>
4328       <entry><literal>external_name</literal></entry>
4329       <entry><type>character_data</type></entry>
4330       <entry>
4331        If this function is a C function, then the external name (link
4332        symbol) of the function; else null.  (This works out to be the
4333        same value that is shown in
4334        <literal>routine_definition</literal>.)
4335       </entry>
4336      </row>
4337
4338      <row>
4339       <entry><literal>external_language</literal></entry>
4340       <entry><type>character_data</type></entry>
4341       <entry>The language the function is written in</entry>
4342      </row>
4343
4344      <row>
4345       <entry><literal>parameter_style</literal></entry>
4346       <entry><type>character_data</type></entry>
4347       <entry>
4348        Always <literal>GENERAL</literal> (The SQL standard defines
4349        other parameter styles, which are not available in <productname>PostgreSQL</productname>.)
4350       </entry>
4351      </row>
4352
4353      <row>
4354       <entry><literal>is_deterministic</literal></entry>
4355       <entry><type>yes_or_no</type></entry>
4356       <entry>
4357        If the function is declared immutable (called deterministic in
4358        the SQL standard), then <literal>YES</literal>, else
4359        <literal>NO</literal>.  (You cannot query the other volatility
4360        levels available in <productname>PostgreSQL</productname> through the information schema.)
4361       </entry>
4362      </row>
4363
4364      <row>
4365       <entry><literal>sql_data_access</literal></entry>
4366       <entry><type>character_data</type></entry>
4367       <entry>
4368        Always <literal>MODIFIES</literal>, meaning that the function
4369        possibly modifies SQL data.  This information is not useful for
4370        <productname>PostgreSQL</productname>.
4371       </entry>
4372      </row>
4373
4374      <row>
4375       <entry><literal>is_null_call</literal></entry>
4376       <entry><type>yes_or_no</type></entry>
4377       <entry>
4378        If the function automatically returns null if any of its
4379        arguments are null, then <literal>YES</literal>, else
4380        <literal>NO</literal>.  Null for a procedure.
4381       </entry>
4382      </row>
4383
4384      <row>
4385       <entry><literal>sql_path</literal></entry>
4386       <entry><type>character_data</type></entry>
4387       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
4388      </row>
4389
4390      <row>
4391       <entry><literal>schema_level_routine</literal></entry>
4392       <entry><type>yes_or_no</type></entry>
4393       <entry>
4394        Always <literal>YES</literal> (The opposite would be a method
4395        of a user-defined type, which is a feature not available in
4396        <productname>PostgreSQL</productname>.)
4397       </entry>
4398      </row>
4399
4400      <row>
4401       <entry><literal>max_dynamic_result_sets</literal></entry>
4402       <entry><type>cardinal_number</type></entry>
4403       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
4404      </row>
4405
4406      <row>
4407       <entry><literal>is_user_defined_cast</literal></entry>
4408       <entry><type>yes_or_no</type></entry>
4409       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
4410      </row>
4411
4412      <row>
4413       <entry><literal>is_implicitly_invocable</literal></entry>
4414       <entry><type>yes_or_no</type></entry>
4415       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
4416      </row>
4417
4418      <row>
4419       <entry><literal>security_type</literal></entry>
4420       <entry><type>character_data</type></entry>
4421       <entry>
4422        If the function runs with the privileges of the current user,
4423        then <literal>INVOKER</literal>, if the function runs with the
4424        privileges of the user who defined it, then
4425        <literal>DEFINER</literal>.
4426       </entry>
4427      </row>
4428
4429      <row>
4430       <entry><literal>to_sql_specific_catalog</literal></entry>
4431       <entry><type>sql_identifier</type></entry>
4432       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
4433      </row>
4434
4435      <row>
4436       <entry><literal>to_sql_specific_schema</literal></entry>
4437       <entry><type>sql_identifier</type></entry>
4438       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
4439      </row>
4440
4441      <row>
4442       <entry><literal>to_sql_specific_name</literal></entry>
4443       <entry><type>sql_identifier</type></entry>
4444       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
4445      </row>
4446
4447      <row>
4448       <entry><literal>as_locator</literal></entry>
4449       <entry><type>yes_or_no</type></entry>
4450       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
4451      </row>
4452
4453      <row>
4454       <entry><literal>created</literal></entry>
4455       <entry><type>time_stamp</type></entry>
4456       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
4457      </row>
4458
4459      <row>
4460       <entry><literal>last_altered</literal></entry>
4461       <entry><type>time_stamp</type></entry>
4462       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
4463      </row>
4464
4465      <row>
4466       <entry><literal>new_savepoint_level</literal></entry>
4467       <entry><type>yes_or_no</type></entry>
4468       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
4469      </row>
4470
4471      <row>
4472       <entry><literal>is_udt_dependent</literal></entry>
4473       <entry><type>yes_or_no</type></entry>
4474       <entry>
4475        Currently always <literal>NO</literal>.  The alternative
4476        <literal>YES</literal> applies to a feature not available in
4477        <productname>PostgreSQL</productname>.
4478       </entry>
4479      </row>
4480
4481      <row>
4482       <entry><literal>result_cast_from_data_type</literal></entry>
4483       <entry><type>character_data</type></entry>
4484       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
4485      </row>
4486
4487      <row>
4488       <entry><literal>result_cast_as_locator</literal></entry>
4489       <entry><type>yes_or_no</type></entry>
4490       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
4491      </row>
4492
4493      <row>
4494       <entry><literal>result_cast_char_max_length</literal></entry>
4495       <entry><type>cardinal_number</type></entry>
4496       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
4497      </row>
4498
4499      <row>
4500       <entry><literal>result_cast_char_octet_length</literal></entry>
4501       <entry><type>character_data</type></entry>
4502       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
4503      </row>
4504
4505      <row>
4506       <entry><literal>result_cast_char_set_catalog</literal></entry>
4507       <entry><type>sql_identifier</type></entry>
4508       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
4509      </row>
4510
4511      <row>
4512       <entry><literal>result_cast_char_set_schema</literal></entry>
4513       <entry><type>sql_identifier</type></entry>
4514       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
4515      </row>
4516
4517      <row>
4518       <entry><literal>result_cast_char_set_name</literal></entry>
4519       <entry><type>sql_identifier</type></entry>
4520       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
4521      </row>
4522
4523      <row>
4524       <entry><literal>result_cast_collation_catalog</literal></entry>
4525       <entry><type>sql_identifier</type></entry>
4526       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
4527      </row>
4528
4529      <row>
4530       <entry><literal>result_cast_collation_schema</literal></entry>
4531       <entry><type>sql_identifier</type></entry>
4532       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
4533      </row>
4534
4535      <row>
4536       <entry><literal>result_cast_collation_name</literal></entry>
4537       <entry><type>sql_identifier</type></entry>
4538       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
4539      </row>
4540
4541      <row>
4542       <entry><literal>result_cast_numeric_precision</literal></entry>
4543       <entry><type>cardinal_number</type></entry>
4544       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
4545      </row>
4546
4547      <row>
4548       <entry><literal>result_cast_numeric_precision_radix</literal></entry>
4549       <entry><type>cardinal_number</type></entry>
4550       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
4551      </row>
4552
4553      <row>
4554       <entry><literal>result_cast_numeric_scale</literal></entry>
4555       <entry><type>cardinal_number</type></entry>
4556       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
4557      </row>
4558
4559      <row>
4560       <entry><literal>result_cast_datetime_precision</literal></entry>
4561       <entry><type>character_data</type></entry>
4562       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
4563      </row>
4564
4565      <row>
4566       <entry><literal>result_cast_interval_type</literal></entry>
4567       <entry><type>character_data</type></entry>
4568       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
4569      </row>
4570
4571      <row>
4572       <entry><literal>result_cast_interval_precision</literal></entry>
4573       <entry><type>cardinal_number</type></entry>
4574       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
4575      </row>
4576
4577      <row>
4578       <entry><literal>result_cast_type_udt_catalog</literal></entry>
4579       <entry><type>sql_identifier</type></entry>
4580       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
4581      </row>
4582
4583      <row>
4584       <entry><literal>result_cast_type_udt_schema</literal></entry>
4585       <entry><type>sql_identifier</type></entry>
4586       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
4587      </row>
4588
4589      <row>
4590       <entry><literal>result_cast_type_udt_name</literal></entry>
4591       <entry><type>sql_identifier</type></entry>
4592       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
4593      </row>
4594
4595      <row>
4596       <entry><literal>result_cast_scope_catalog</literal></entry>
4597       <entry><type>sql_identifier</type></entry>
4598       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
4599      </row>
4600
4601      <row>
4602       <entry><literal>result_cast_scope_schema</literal></entry>
4603       <entry><type>sql_identifier</type></entry>
4604       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
4605      </row>
4606
4607      <row>
4608       <entry><literal>result_cast_scope_name</literal></entry>
4609       <entry><type>sql_identifier</type></entry>
4610       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
4611      </row>
4612
4613      <row>
4614       <entry><literal>result_cast_maximum_cardinality</literal></entry>
4615       <entry><type>cardinal_number</type></entry>
4616       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
4617      </row>
4618
4619      <row>
4620       <entry><literal>result_cast_dtd_identifier</literal></entry>
4621       <entry><type>sql_identifier</type></entry>
4622       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
4623      </row>
4624     </tbody>
4625    </tgroup>
4626   </table>
4627  </sect1>
4628
4629  <sect1 id="infoschema-schemata">
4630   <title><literal>schemata</literal></title>
4631
4632   <para>
4633    The view <literal>schemata</literal> contains all schemas in the current
4634    database that the current user has access to (by way of being the owner or
4635    having some privilege).
4636   </para>
4637
4638   <table>
4639    <title><literal>schemata</literal> Columns</title>
4640
4641    <tgroup cols="3">
4642     <thead>
4643      <row>
4644       <entry>Name</entry>
4645       <entry>Data Type</entry>
4646       <entry>Description</entry>
4647      </row>
4648     </thead>
4649
4650     <tbody>
4651      <row>
4652       <entry><literal>catalog_name</literal></entry>
4653       <entry><type>sql_identifier</type></entry>
4654       <entry>Name of the database that the schema is contained in (always the current database)</entry>
4655      </row>
4656
4657      <row>
4658       <entry><literal>schema_name</literal></entry>
4659       <entry><type>sql_identifier</type></entry>
4660       <entry>Name of the schema</entry>
4661      </row>
4662
4663      <row>
4664       <entry><literal>schema_owner</literal></entry>
4665       <entry><type>sql_identifier</type></entry>
4666       <entry>Name of the owner of the schema</entry>
4667      </row>
4668
4669      <row>
4670       <entry><literal>default_character_set_catalog</literal></entry>
4671       <entry><type>sql_identifier</type></entry>
4672       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
4673      </row>
4674
4675      <row>
4676       <entry><literal>default_character_set_schema</literal></entry>
4677       <entry><type>sql_identifier</type></entry>
4678       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
4679      </row>
4680
4681      <row>
4682       <entry><literal>default_character_set_name</literal></entry>
4683       <entry><type>sql_identifier</type></entry>
4684       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
4685      </row>
4686
4687      <row>
4688       <entry><literal>sql_path</literal></entry>
4689       <entry><type>character_data</type></entry>
4690       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
4691      </row>
4692     </tbody>
4693    </tgroup>
4694   </table>
4695  </sect1>
4696
4697  <sect1 id="infoschema-sequences">
4698   <title><literal>sequences</literal></title>
4699
4700   <para>
4701    The view <literal>sequences</literal> contains all sequences
4702    defined in the current database.  Only those sequences are shown
4703    that the current user has access to (by way of being the owner or
4704    having some privilege).
4705   </para>
4706
4707   <table>
4708    <title><literal>sequences</literal> Columns</title>
4709
4710    <tgroup cols="3">
4711     <thead>
4712      <row>
4713       <entry>Name</entry>
4714       <entry>Data Type</entry>
4715       <entry>Description</entry>
4716      </row>
4717     </thead>
4718
4719     <tbody>
4720      <row>
4721       <entry><literal>sequence_catalog</literal></entry>
4722       <entry><type>sql_identifier</type></entry>
4723       <entry>Name of the database that contains the sequence (always the current database)</entry>
4724      </row>
4725
4726      <row>
4727       <entry><literal>sequence_schema</literal></entry>
4728       <entry><type>sql_identifier</type></entry>
4729       <entry>Name of the schema that contains the sequence</entry>
4730      </row>
4731
4732      <row>
4733       <entry><literal>sequence_name</literal></entry>
4734       <entry><type>sql_identifier</type></entry>
4735       <entry>Name of the sequence</entry>
4736      </row>
4737
4738      <row>
4739       <entry><literal>data_type</literal></entry>
4740       <entry><type>character_data</type></entry>
4741       <entry>
4742        The data type of the sequence.
4743       </entry>
4744      </row>
4745
4746      <row>
4747       <entry><literal>numeric_precision</literal></entry>
4748       <entry><type>cardinal_number</type></entry>
4749       <entry>
4750        This column contains the (declared or implicit) precision of
4751        the sequence data type (see above).  The precision indicates
4752        the number of significant digits.  It can be expressed in
4753        decimal (base 10) or binary (base 2) terms, as specified in the
4754        column <literal>numeric_precision_radix</literal>.
4755       </entry>
4756      </row>
4757
4758      <row>
4759       <entry><literal>numeric_precision_radix</literal></entry>
4760       <entry><type>cardinal_number</type></entry>
4761       <entry>
4762        This column indicates in which base the values in the columns
4763        <literal>numeric_precision</literal> and
4764        <literal>numeric_scale</literal> are expressed.  The value is
4765        either 2 or 10.
4766       </entry>
4767      </row>
4768
4769      <row>
4770       <entry><literal>numeric_scale</literal></entry>
4771       <entry><type>cardinal_number</type></entry>
4772       <entry>
4773        This column contains the (declared or implicit) scale of the
4774        sequence data type (see above).  The scale indicates the number
4775        of significant digits to the right of the decimal point.  It
4776        can be expressed in decimal (base 10) or binary (base 2) terms,
4777        as specified in the column
4778        <literal>numeric_precision_radix</literal>.
4779       </entry>
4780      </row>
4781
4782      <row>
4783       <entry><literal>start_value</literal></entry>
4784       <entry><type>character_data</type></entry>
4785       <entry>The start value of the sequence</entry>
4786      </row>
4787
4788      <row>
4789       <entry><literal>minimum_value</literal></entry>
4790       <entry><type>character_data</type></entry>
4791       <entry>The minimum value of the sequence</entry>
4792      </row>
4793
4794      <row>
4795       <entry><literal>maximum_value</literal></entry>
4796       <entry><type>character_data</type></entry>
4797       <entry>The maximum value of the sequence</entry>
4798      </row>
4799
4800      <row>
4801       <entry><literal>increment</literal></entry>
4802       <entry><type>character_data</type></entry>
4803       <entry>The increment of the sequence</entry>
4804      </row>
4805
4806      <row>
4807       <entry><literal>cycle_option</literal></entry>
4808       <entry><type>yes_or_no</type></entry>
4809       <entry><literal>YES</literal> if the sequence cycles, else <literal>NO</literal></entry>
4810      </row>
4811     </tbody>
4812    </tgroup>
4813   </table>
4814
4815   <para>
4816    Note that in accordance with the SQL standard, the start, minimum,
4817    maximum, and increment values are returned as character strings.
4818   </para>
4819  </sect1>
4820
4821  <sect1 id="infoschema-sql-features">
4822   <title><literal>sql_features</literal></title>
4823
4824   <para>
4825    The table <literal>sql_features</literal> contains information
4826    about which formal features defined in the SQL standard are
4827    supported by <productname>PostgreSQL</productname>.  This is the
4828    same information that is presented in <xref linkend="features"/>.
4829    There you can also find some additional background information.
4830   </para>
4831
4832   <table>
4833    <title><literal>sql_features</literal> Columns</title>
4834
4835    <tgroup cols="3">
4836     <thead>
4837      <row>
4838       <entry>Name</entry>
4839       <entry>Data Type</entry>
4840       <entry>Description</entry>
4841      </row>
4842     </thead>
4843
4844     <tbody>
4845      <row>
4846       <entry><literal>feature_id</literal></entry>
4847       <entry><type>character_data</type></entry>
4848       <entry>Identifier string of the feature</entry>
4849      </row>
4850
4851      <row>
4852       <entry><literal>feature_name</literal></entry>
4853       <entry><type>character_data</type></entry>
4854       <entry>Descriptive name of the feature</entry>
4855      </row>
4856
4857      <row>
4858       <entry><literal>sub_feature_id</literal></entry>
4859       <entry><type>character_data</type></entry>
4860       <entry>Identifier string of the subfeature, or a zero-length string if not a subfeature</entry>
4861      </row>
4862
4863      <row>
4864       <entry><literal>sub_feature_name</literal></entry>
4865       <entry><type>character_data</type></entry>
4866       <entry>Descriptive name of the subfeature, or a zero-length string if not a subfeature</entry>
4867      </row>
4868
4869      <row>
4870       <entry><literal>is_supported</literal></entry>
4871       <entry><type>yes_or_no</type></entry>
4872       <entry>
4873        <literal>YES</literal> if the feature is fully supported by the
4874        current version of <productname>PostgreSQL</productname>, <literal>NO</literal> if not
4875       </entry>
4876      </row>
4877
4878      <row>
4879       <entry><literal>is_verified_by</literal></entry>
4880       <entry><type>character_data</type></entry>
4881       <entry>
4882        Always null, since the <productname>PostgreSQL</productname> development group does not
4883        perform formal testing of feature conformance
4884       </entry>
4885      </row>
4886
4887      <row>
4888       <entry><literal>comments</literal></entry>
4889       <entry><type>character_data</type></entry>
4890       <entry>Possibly a comment about the supported status of the feature</entry>
4891      </row>
4892     </tbody>
4893    </tgroup>
4894   </table>
4895  </sect1>
4896
4897  <sect1 id="infoschema-sql-implementation-info">
4898   <title><literal>sql_implementation_info</literal></title>
4899
4900   <para>
4901    The table <literal>sql_implementation_info</literal> contains
4902    information about various aspects that are left
4903    implementation-defined by the SQL standard.  This information is
4904    primarily intended for use in the context of the ODBC interface;
4905    users of other interfaces will probably find this information to be
4906    of little use.  For this reason, the individual implementation
4907    information items are not described here; you will find them in the
4908    description of the ODBC interface.
4909   </para>
4910
4911   <table>
4912    <title><literal>sql_implementation_info</literal> Columns</title>
4913
4914    <tgroup cols="3">
4915     <thead>
4916      <row>
4917       <entry>Name</entry>
4918       <entry>Data Type</entry>
4919       <entry>Description</entry>
4920      </row>
4921     </thead>
4922
4923     <tbody>
4924      <row>
4925       <entry><literal>implementation_info_id</literal></entry>
4926       <entry><type>character_data</type></entry>
4927       <entry>Identifier string of the implementation information item</entry>
4928      </row>
4929
4930      <row>
4931       <entry><literal>implementation_info_name</literal></entry>
4932       <entry><type>character_data</type></entry>
4933       <entry>Descriptive name of the implementation information item</entry>
4934      </row>
4935
4936      <row>
4937       <entry><literal>integer_value</literal></entry>
4938       <entry><type>cardinal_number</type></entry>
4939       <entry>
4940        Value of the implementation information item, or null if the
4941        value is contained in the column
4942        <literal>character_value</literal>
4943       </entry>
4944      </row>
4945
4946      <row>
4947       <entry><literal>character_value</literal></entry>
4948       <entry><type>character_data</type></entry>
4949       <entry>
4950        Value of the implementation information item, or null if the
4951        value is contained in the column
4952        <literal>integer_value</literal>
4953       </entry>
4954      </row>
4955
4956      <row>
4957       <entry><literal>comments</literal></entry>
4958       <entry><type>character_data</type></entry>
4959       <entry>Possibly a comment pertaining to the implementation information item</entry>
4960      </row>
4961     </tbody>
4962    </tgroup>
4963   </table>
4964  </sect1>
4965
4966  <sect1 id="infoschema-sql-languages">
4967   <title><literal>sql_languages</literal></title>
4968
4969   <para>
4970    The table <literal>sql_languages</literal> contains one row for
4971    each SQL language binding that is supported by
4972    <productname>PostgreSQL</productname>.
4973    <productname>PostgreSQL</productname> supports direct SQL and
4974    embedded SQL in C; that is all you will learn from this table.
4975   </para>
4976
4977   <para>
4978    This table was removed from the SQL standard in SQL:2008, so there
4979    are no entries referring to standards later than SQL:2003.
4980   </para>
4981
4982   <table>
4983    <title><literal>sql_languages</literal> Columns</title>
4984
4985    <tgroup cols="3">
4986     <thead>
4987      <row>
4988       <entry>Name</entry>
4989       <entry>Data Type</entry>
4990       <entry>Description</entry>
4991      </row>
4992     </thead>
4993
4994     <tbody>
4995      <row>
4996       <entry><literal>sql_language_source</literal></entry>
4997       <entry><type>character_data</type></entry>
4998       <entry>
4999        The name of the source of the language definition; always
5000        <literal>ISO 9075</literal>, that is, the SQL standard
5001       </entry>
5002      </row>
5003
5004      <row>
5005       <entry><literal>sql_language_year</literal></entry>
5006       <entry><type>character_data</type></entry>
5007       <entry>
5008        The year the standard referenced in
5009        <literal>sql_language_source</literal> was approved.
5010       </entry>
5011      </row>
5012
5013      <row>
5014       <entry><literal>sql_language_conformance</literal></entry>
5015       <entry><type>character_data</type></entry>
5016       <entry>
5017        The standard conformance level for the language binding.  For
5018        ISO 9075:2003 this is always <literal>CORE</literal>.
5019       </entry>
5020      </row>
5021
5022      <row>
5023       <entry><literal>sql_language_integrity</literal></entry>
5024       <entry><type>character_data</type></entry>
5025       <entry>Always null (This value is relevant to an earlier version of the SQL standard.)</entry>
5026      </row>
5027
5028      <row>
5029       <entry><literal>sql_language_implementation</literal></entry>
5030       <entry><type>character_data</type></entry>
5031       <entry>Always null</entry>
5032      </row>
5033
5034      <row>
5035       <entry><literal>sql_language_binding_style</literal></entry>
5036       <entry><type>character_data</type></entry>
5037       <entry>
5038        The language binding style, either <literal>DIRECT</literal> or
5039        <literal>EMBEDDED</literal>
5040       </entry>
5041      </row>
5042
5043      <row>
5044       <entry><literal>sql_language_programming_language</literal></entry>
5045       <entry><type>character_data</type></entry>
5046       <entry>
5047        The programming language, if the binding style is
5048        <literal>EMBEDDED</literal>, else null.  <productname>PostgreSQL</productname> only
5049        supports the language C.
5050       </entry>
5051      </row>
5052     </tbody>
5053    </tgroup>
5054   </table>
5055  </sect1>
5056
5057  <sect1 id="infoschema-sql-packages">
5058   <title><literal>sql_packages</literal></title>
5059
5060   <para>
5061    The table <literal>sql_packages</literal> contains information
5062    about which feature packages defined in the SQL standard are
5063    supported by <productname>PostgreSQL</productname>.  Refer to <xref
5064    linkend="features"/> for background information on feature packages.
5065   </para>
5066
5067   <table>
5068    <title><literal>sql_packages</literal> Columns</title>
5069
5070    <tgroup cols="3">
5071     <thead>
5072      <row>
5073       <entry>Name</entry>
5074       <entry>Data Type</entry>
5075       <entry>Description</entry>
5076      </row>
5077     </thead>
5078
5079     <tbody>
5080      <row>
5081       <entry><literal>feature_id</literal></entry>
5082       <entry><type>character_data</type></entry>
5083       <entry>Identifier string of the package</entry>
5084      </row>
5085
5086      <row>
5087       <entry><literal>feature_name</literal></entry>
5088       <entry><type>character_data</type></entry>
5089       <entry>Descriptive name of the package</entry>
5090      </row>
5091
5092      <row>
5093       <entry><literal>is_supported</literal></entry>
5094       <entry><type>yes_or_no</type></entry>
5095       <entry>
5096        <literal>YES</literal> if the package is fully supported by the
5097        current version of <productname>PostgreSQL</productname>, <literal>NO</literal> if not
5098       </entry>
5099      </row>
5100
5101      <row>
5102       <entry><literal>is_verified_by</literal></entry>
5103       <entry><type>character_data</type></entry>
5104       <entry>
5105        Always null, since the <productname>PostgreSQL</productname> development group does not
5106        perform formal testing of feature conformance
5107       </entry>
5108      </row>
5109
5110      <row>
5111       <entry><literal>comments</literal></entry>
5112       <entry><type>character_data</type></entry>
5113       <entry>Possibly a comment about the supported status of the package</entry>
5114      </row>
5115     </tbody>
5116    </tgroup>
5117   </table>
5118  </sect1>
5119
5120  <sect1 id="infoschema-sql-parts">
5121   <title><literal>sql_parts</literal></title>
5122
5123   <para>
5124    The table <literal>sql_parts</literal> contains information about
5125    which of the several parts of the SQL standard are supported by
5126    <productname>PostgreSQL</productname>.
5127   </para>
5128
5129   <table>
5130    <title><literal>sql_parts</literal> Columns</title>
5131
5132    <tgroup cols="3">
5133     <thead>
5134      <row>
5135       <entry>Name</entry>
5136       <entry>Data Type</entry>
5137       <entry>Description</entry>
5138      </row>
5139     </thead>
5140
5141     <tbody>
5142      <row>
5143       <entry><literal>feature_id</literal></entry>
5144       <entry><type>character_data</type></entry>
5145       <entry>An identifier string containing the number of the part</entry>
5146      </row>
5147
5148      <row>
5149       <entry><literal>feature_name</literal></entry>
5150       <entry><type>character_data</type></entry>
5151       <entry>Descriptive name of the part</entry>
5152      </row>
5153
5154      <row>
5155       <entry><literal>is_supported</literal></entry>
5156       <entry><type>yes_or_no</type></entry>
5157       <entry>
5158        <literal>YES</literal> if the part is fully supported by the
5159        current version of <productname>PostgreSQL</productname>,
5160        <literal>NO</literal> if not
5161       </entry>
5162      </row>
5163
5164      <row>
5165       <entry><literal>is_verified_by</literal></entry>
5166       <entry><type>character_data</type></entry>
5167       <entry>
5168        Always null, since the <productname>PostgreSQL</productname> development group does not
5169        perform formal testing of feature conformance
5170       </entry>
5171      </row>
5172
5173      <row>
5174       <entry><literal>comments</literal></entry>
5175       <entry><type>character_data</type></entry>
5176       <entry>Possibly a comment about the supported status of the part</entry>
5177      </row>
5178     </tbody>
5179    </tgroup>
5180   </table>
5181  </sect1>
5182
5183  <sect1 id="infoschema-sql-sizing">
5184   <title><literal>sql_sizing</literal></title>
5185
5186   <para>
5187    The table <literal>sql_sizing</literal> contains information about
5188    various size limits and maximum values in
5189    <productname>PostgreSQL</productname>.  This information is
5190    primarily intended for use in the context of the ODBC interface;
5191    users of other interfaces will probably find this information to be
5192    of little use.  For this reason, the individual sizing items are
5193    not described here; you will find them in the description of the
5194    ODBC interface.
5195   </para>
5196
5197   <table>
5198    <title><literal>sql_sizing</literal> Columns</title>
5199
5200    <tgroup cols="3">
5201     <thead>
5202      <row>
5203       <entry>Name</entry>
5204       <entry>Data Type</entry>
5205       <entry>Description</entry>
5206      </row>
5207     </thead>
5208
5209     <tbody>
5210      <row>
5211       <entry><literal>sizing_id</literal></entry>
5212       <entry><type>cardinal_number</type></entry>
5213       <entry>Identifier of the sizing item</entry>
5214      </row>
5215
5216      <row>
5217       <entry><literal>sizing_name</literal></entry>
5218       <entry><type>character_data</type></entry>
5219       <entry>Descriptive name of the sizing item</entry>
5220      </row>
5221
5222      <row>
5223       <entry><literal>supported_value</literal></entry>
5224       <entry><type>cardinal_number</type></entry>
5225       <entry>
5226        Value of the sizing item, or 0 if the size is unlimited or
5227        cannot be determined, or null if the features for which the
5228        sizing item is applicable are not supported
5229       </entry>
5230      </row>
5231
5232      <row>
5233       <entry><literal>comments</literal></entry>
5234       <entry><type>character_data</type></entry>
5235       <entry>Possibly a comment pertaining to the sizing item</entry>
5236      </row>
5237     </tbody>
5238    </tgroup>
5239   </table>
5240  </sect1>
5241
5242  <sect1 id="infoschema-sql-sizing-profiles">
5243   <title><literal>sql_sizing_profiles</literal></title>
5244
5245   <para>
5246    The table <literal>sql_sizing_profiles</literal> contains
5247    information about the <literal>sql_sizing</literal> values that are
5248    required by various profiles of the SQL standard.  <productname>PostgreSQL</productname> does
5249    not track any SQL profiles, so this table is empty.
5250   </para>
5251
5252   <table>
5253    <title><literal>sql_sizing_profiles</literal> Columns</title>
5254
5255    <tgroup cols="3">
5256     <thead>
5257      <row>
5258       <entry>Name</entry>
5259       <entry>Data Type</entry>
5260       <entry>Description</entry>
5261      </row>
5262     </thead>
5263
5264     <tbody>
5265      <row>
5266       <entry><literal>sizing_id</literal></entry>
5267       <entry><type>cardinal_number</type></entry>
5268       <entry>Identifier of the sizing item</entry>
5269      </row>
5270
5271      <row>
5272       <entry><literal>sizing_name</literal></entry>
5273       <entry><type>character_data</type></entry>
5274       <entry>Descriptive name of the sizing item</entry>
5275      </row>
5276
5277      <row>
5278       <entry><literal>profile_id</literal></entry>
5279       <entry><type>character_data</type></entry>
5280       <entry>Identifier string of a profile</entry>
5281      </row>
5282
5283      <row>
5284       <entry><literal>required_value</literal></entry>
5285       <entry><type>cardinal_number</type></entry>
5286       <entry>
5287        The value required by the SQL profile for the sizing item, or 0
5288        if the profile places no limit on the sizing item, or null if
5289        the profile does not require any of the features for which the
5290        sizing item is applicable
5291       </entry>
5292      </row>
5293
5294      <row>
5295       <entry><literal>comments</literal></entry>
5296       <entry><type>character_data</type></entry>
5297       <entry>Possibly a comment pertaining to the sizing item within the profile</entry>
5298      </row>
5299     </tbody>
5300    </tgroup>
5301   </table>
5302  </sect1>
5303
5304  <sect1 id="infoschema-table-constraints">
5305   <title><literal>table_constraints</literal></title>
5306
5307   <para>
5308    The view <literal>table_constraints</literal> contains all
5309    constraints belonging to tables that the current user owns or has
5310    some privilege other than <literal>SELECT</literal> on.
5311   </para>
5312
5313   <table>
5314    <title><literal>table_constraints</literal> Columns</title>
5315
5316    <tgroup cols="3">
5317     <thead>
5318      <row>
5319       <entry>Name</entry>
5320       <entry>Data Type</entry>
5321       <entry>Description</entry>
5322      </row>
5323     </thead>
5324
5325     <tbody>
5326      <row>
5327       <entry><literal>constraint_catalog</literal></entry>
5328       <entry><type>sql_identifier</type></entry>
5329       <entry>Name of the database that contains the constraint (always the current database)</entry>
5330      </row>
5331
5332      <row>
5333       <entry><literal>constraint_schema</literal></entry>
5334       <entry><type>sql_identifier</type></entry>
5335       <entry>Name of the schema that contains the constraint</entry>
5336      </row>
5337
5338      <row>
5339       <entry><literal>constraint_name</literal></entry>
5340       <entry><type>sql_identifier</type></entry>
5341       <entry>Name of the constraint</entry>
5342      </row>
5343
5344      <row>
5345       <entry><literal>table_catalog</literal></entry>
5346       <entry><type>sql_identifier</type></entry>
5347       <entry>Name of the database that contains the table (always the current database)</entry>
5348      </row>
5349
5350      <row>
5351       <entry><literal>table_schema</literal></entry>
5352       <entry><type>sql_identifier</type></entry>
5353       <entry>Name of the schema that contains the table</entry>
5354      </row>
5355
5356      <row>
5357       <entry><literal>table_name</literal></entry>
5358       <entry><type>sql_identifier</type></entry>
5359       <entry>Name of the table</entry>
5360      </row>
5361
5362      <row>
5363       <entry><literal>constraint_type</literal></entry>
5364       <entry><type>character_data</type></entry>
5365       <entry>
5366        Type of the constraint: <literal>CHECK</literal>,
5367        <literal>FOREIGN KEY</literal>, <literal>PRIMARY KEY</literal>,
5368        or <literal>UNIQUE</literal>
5369       </entry>
5370      </row>
5371
5372      <row>
5373       <entry><literal>is_deferrable</literal></entry>
5374       <entry><type>yes_or_no</type></entry>
5375       <entry><literal>YES</literal> if the constraint is deferrable, <literal>NO</literal> if not</entry>
5376      </row>
5377
5378      <row>
5379       <entry><literal>initially_deferred</literal></entry>
5380       <entry><type>yes_or_no</type></entry>
5381       <entry><literal>YES</literal> if the constraint is deferrable and initially deferred, <literal>NO</literal> if not</entry>
5382      </row>
5383      <row>
5384       <entry><literal>enforced</literal></entry>
5385       <entry><type>yes_or_no</type></entry>
5386       <entry>Applies to a feature not available in
5387       <productname>PostgreSQL</productname> (currently always
5388       <literal>YES</literal>)</entry>
5389      </row>
5390     </tbody>
5391    </tgroup>
5392   </table>
5393  </sect1>
5394
5395  <sect1 id="infoschema-table-privileges">
5396   <title><literal>table_privileges</literal></title>
5397
5398   <para>
5399    The view <literal>table_privileges</literal> identifies all
5400    privileges granted on tables or views to a currently enabled role
5401    or by a currently enabled role.  There is one row for each
5402    combination of table, grantor, and grantee.
5403   </para>
5404
5405   <table>
5406    <title><literal>table_privileges</literal> Columns</title>
5407
5408    <tgroup cols="3">
5409     <thead>
5410      <row>
5411       <entry>Name</entry>
5412       <entry>Data Type</entry>
5413       <entry>Description</entry>
5414      </row>
5415     </thead>
5416
5417     <tbody>
5418      <row>
5419       <entry><literal>grantor</literal></entry>
5420       <entry><type>sql_identifier</type></entry>
5421       <entry>Name of the role that granted the privilege</entry>
5422      </row>
5423
5424      <row>
5425       <entry><literal>grantee</literal></entry>
5426       <entry><type>sql_identifier</type></entry>
5427       <entry>Name of the role that the privilege was granted to</entry>
5428      </row>
5429
5430      <row>
5431       <entry><literal>table_catalog</literal></entry>
5432       <entry><type>sql_identifier</type></entry>
5433       <entry>Name of the database that contains the table (always the current database)</entry>
5434      </row>
5435
5436      <row>
5437       <entry><literal>table_schema</literal></entry>
5438       <entry><type>sql_identifier</type></entry>
5439       <entry>Name of the schema that contains the table</entry>
5440      </row>
5441
5442      <row>
5443       <entry><literal>table_name</literal></entry>
5444       <entry><type>sql_identifier</type></entry>
5445       <entry>Name of the table</entry>
5446      </row>
5447
5448      <row>
5449       <entry><literal>privilege_type</literal></entry>
5450       <entry><type>character_data</type></entry>
5451       <entry>
5452        Type of the privilege: <literal>SELECT</literal>,
5453        <literal>INSERT</literal>, <literal>UPDATE</literal>,
5454        <literal>DELETE</literal>, <literal>TRUNCATE</literal>,
5455        <literal>REFERENCES</literal>, or <literal>TRIGGER</literal>
5456       </entry>
5457      </row>
5458
5459      <row>
5460       <entry><literal>is_grantable</literal></entry>
5461       <entry><type>yes_or_no</type></entry>
5462       <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
5463      </row>
5464
5465      <row>
5466       <entry><literal>with_hierarchy</literal></entry>
5467       <entry><type>yes_or_no</type></entry>
5468       <entry>
5469        In the SQL standard, <literal>WITH HIERARCHY OPTION</literal>
5470        is a separate (sub-)privilege allowing certain operations on
5471        table inheritance hierarchies.  In PostgreSQL, this is included
5472        in the <literal>SELECT</literal> privilege, so this column
5473        shows <literal>YES</literal> if the privilege
5474        is <literal>SELECT</literal>, else <literal>NO</literal>.
5475       </entry>
5476      </row>
5477     </tbody>
5478    </tgroup>
5479   </table>
5480  </sect1>
5481
5482  <sect1 id="infoschema-tables">
5483   <title><literal>tables</literal></title>
5484
5485   <para>
5486    The view <literal>tables</literal> contains all tables and views
5487    defined in the current database.  Only those tables and views are
5488    shown that the current user has access to (by way of being the
5489    owner or having some privilege).
5490   </para>
5491
5492   <table>
5493    <title><literal>tables</literal> Columns</title>
5494
5495    <tgroup cols="3">
5496     <thead>
5497      <row>
5498       <entry>Name</entry>
5499       <entry>Data Type</entry>
5500       <entry>Description</entry>
5501      </row>
5502     </thead>
5503
5504     <tbody>
5505      <row>
5506       <entry><literal>table_catalog</literal></entry>
5507       <entry><type>sql_identifier</type></entry>
5508       <entry>Name of the database that contains the table (always the current database)</entry>
5509      </row>
5510
5511      <row>
5512       <entry><literal>table_schema</literal></entry>
5513       <entry><type>sql_identifier</type></entry>
5514       <entry>Name of the schema that contains the table</entry>
5515      </row>
5516
5517      <row>
5518       <entry><literal>table_name</literal></entry>
5519       <entry><type>sql_identifier</type></entry>
5520       <entry>Name of the table</entry>
5521      </row>
5522
5523      <row>
5524       <entry><literal>table_type</literal></entry>
5525       <entry><type>character_data</type></entry>
5526       <entry>
5527        Type of the table: <literal>BASE TABLE</literal> for a
5528        persistent base table (the normal table type),
5529        <literal>VIEW</literal> for a view, <literal>FOREIGN</literal>
5530        for a foreign table, or
5531        <literal>LOCAL TEMPORARY</literal> for a temporary table
5532       </entry>
5533      </row>
5534
5535      <row>
5536       <entry><literal>self_referencing_column_name</literal></entry>
5537       <entry><type>sql_identifier</type></entry>
5538       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
5539      </row>
5540
5541      <row>
5542       <entry><literal>reference_generation</literal></entry>
5543       <entry><type>character_data</type></entry>
5544       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
5545      </row>
5546
5547      <row>
5548       <entry><literal>user_defined_type_catalog</literal></entry>
5549       <entry><type>sql_identifier</type></entry>
5550       <entry>
5551        If the table is a typed table, the name of the database that
5552        contains the underlying data type (always the current
5553        database), else null.
5554       </entry>
5555      </row>
5556
5557      <row>
5558       <entry><literal>user_defined_type_schema</literal></entry>
5559       <entry><type>sql_identifier</type></entry>
5560       <entry>
5561        If the table is a typed table, the name of the schema that
5562        contains the underlying data type, else null.
5563       </entry>
5564      </row>
5565
5566      <row>
5567       <entry><literal>user_defined_type_name</literal></entry>
5568       <entry><type>sql_identifier</type></entry>
5569       <entry>
5570        If the table is a typed table, the name of the underlying data
5571        type, else null.
5572       </entry>
5573      </row>
5574
5575      <row>
5576       <entry><literal>is_insertable_into</literal></entry>
5577       <entry><type>yes_or_no</type></entry>
5578       <entry>
5579        <literal>YES</literal> if the table is insertable into,
5580        <literal>NO</literal> if not (Base tables are always insertable
5581        into, views not necessarily.)
5582       </entry>
5583      </row>
5584
5585      <row>
5586       <entry><literal>is_typed</literal></entry>
5587       <entry><type>yes_or_no</type></entry>
5588       <entry><literal>YES</literal> if the table is a typed table, <literal>NO</literal> if not</entry>
5589      </row>
5590
5591      <row>
5592       <entry><literal>commit_action</literal></entry>
5593       <entry><type>character_data</type></entry>
5594       <entry>Not yet implemented</entry>
5595      </row>
5596     </tbody>
5597    </tgroup>
5598   </table>
5599  </sect1>
5600
5601  <sect1 id="infoschema-transforms">
5602   <title><literal>transforms</literal></title>
5603
5604   <para>
5605    The view <literal>transforms</literal> contains information about the
5606    transforms defined in the current database.  More precisely, it contains a
5607    row for each function contained in a transform (the <quote>from SQL</quote>
5608    or <quote>to SQL</quote> function).
5609   </para>
5610
5611   <table>
5612    <title><literal>transforms</literal> Columns</title>
5613
5614    <tgroup cols="3">
5615     <thead>
5616      <row>
5617       <entry>Name</entry>
5618       <entry>Data Type</entry>
5619       <entry>Description</entry>
5620      </row>
5621     </thead>
5622
5623     <tbody>
5624      <row>
5625       <entry><literal>udt_catalog</literal></entry>
5626       <entry><type>sql_identifier</type></entry>
5627       <entry>Name of the database that contains the type the transform is for (always the current database)</entry>
5628      </row>
5629
5630      <row>
5631       <entry><literal>udt_schema</literal></entry>
5632       <entry><type>sql_identifier</type></entry>
5633       <entry>Name of the schema that contains the type the transform is for</entry>
5634      </row>
5635
5636      <row>
5637       <entry><literal>udt_name</literal></entry>
5638       <entry><type>sql_identifier</type></entry>
5639       <entry>Name of the type the transform is for</entry>
5640      </row>
5641
5642      <row>
5643       <entry><literal>specific_catalog</literal></entry>
5644       <entry><literal>sql_identifier</literal></entry>
5645       <entry>Name of the database containing the function (always the current database)</entry>
5646      </row>
5647
5648      <row>
5649       <entry><literal>specific_schema</literal></entry>
5650       <entry><literal>sql_identifier</literal></entry>
5651       <entry>Name of the schema containing the function</entry>
5652      </row>
5653
5654      <row>
5655       <entry><literal>specific_name</literal></entry>
5656       <entry><literal>sql_identifier</literal></entry>
5657       <entry>
5658        The <quote>specific name</quote> of the function.  See <xref
5659        linkend="infoschema-routines"/> for more information.
5660       </entry>
5661      </row>
5662
5663      <row>
5664       <entry><literal>group_name</literal></entry>
5665       <entry><literal>sql_identifier</literal></entry>
5666       <entry>
5667        The SQL standard allows defining transforms in <quote>groups</quote>,
5668        and selecting a group at run time.  PostgreSQL does not support this.
5669        Instead, transforms are specific to a language.  As a compromise, this
5670        field contains the language the transform is for.
5671       </entry>
5672      </row>
5673
5674      <row>
5675       <entry><literal>transform_type</literal></entry>
5676       <entry><type>character_data</type></entry>
5677       <entry>
5678        <literal>FROM SQL</literal> or <literal>TO SQL</literal>
5679       </entry>
5680      </row>
5681     </tbody>
5682    </tgroup>
5683   </table>
5684  </sect1>
5685
5686  <sect1 id="infoschema-triggered-update-columns">
5687   <title><literal>triggered_update_columns</literal></title>
5688
5689   <para>
5690    For triggers in the current database that specify a column list
5691    (like <literal>UPDATE OF column1, column2</literal>), the
5692    view <literal>triggered_update_columns</literal> identifies these
5693    columns.  Triggers that do not specify a column list are not
5694    included in this view.  Only those columns are shown that the
5695    current user owns or has some privilege other than
5696    <literal>SELECT</literal> on.
5697   </para>
5698
5699   <table>
5700    <title><literal>triggered_update_columns</literal> Columns</title>
5701
5702    <tgroup cols="3">
5703     <thead>
5704      <row>
5705       <entry>Name</entry>
5706       <entry>Data Type</entry>
5707       <entry>Description</entry>
5708      </row>
5709     </thead>
5710
5711     <tbody>
5712      <row>
5713       <entry><literal>trigger_catalog</literal></entry>
5714       <entry><type>sql_identifier</type></entry>
5715       <entry>Name of the database that contains the trigger (always the current database)</entry>
5716      </row>
5717
5718      <row>
5719       <entry><literal>trigger_schema</literal></entry>
5720       <entry><type>sql_identifier</type></entry>
5721       <entry>Name of the schema that contains the trigger</entry>
5722      </row>
5723
5724      <row>
5725       <entry><literal>trigger_name</literal></entry>
5726       <entry><type>sql_identifier</type></entry>
5727       <entry>Name of the trigger</entry>
5728      </row>
5729
5730      <row>
5731       <entry><literal>event_object_catalog</literal></entry>
5732       <entry><type>sql_identifier</type></entry>
5733       <entry>
5734        Name of the database that contains the table that the trigger
5735        is defined on (always the current database)
5736       </entry>
5737      </row>
5738
5739      <row>
5740       <entry><literal>event_object_schema</literal></entry>
5741       <entry><type>sql_identifier</type></entry>
5742       <entry>Name of the schema that contains the table that the trigger is defined on</entry>
5743      </row>
5744
5745      <row>
5746       <entry><literal>event_object_table</literal></entry>
5747       <entry><type>sql_identifier</type></entry>
5748       <entry>Name of the table that the trigger is defined on</entry>
5749      </row>
5750
5751      <row>
5752       <entry><literal>event_object_column</literal></entry>
5753       <entry><type>sql_identifier</type></entry>
5754       <entry>Name of the column that the trigger is defined on</entry>
5755      </row>
5756     </tbody>
5757    </tgroup>
5758   </table>
5759  </sect1>
5760
5761  <sect1 id="infoschema-triggers">
5762   <title><literal>triggers</literal></title>
5763
5764   <para>
5765    The view <literal>triggers</literal> contains all triggers defined
5766    in the current database on tables and views that the current user owns
5767    or has some privilege other than <literal>SELECT</literal> on.
5768   </para>
5769
5770   <table>
5771    <title><literal>triggers</literal> Columns</title>
5772
5773    <tgroup cols="3">
5774     <thead>
5775      <row>
5776       <entry>Name</entry>
5777       <entry>Data Type</entry>
5778       <entry>Description</entry>
5779      </row>
5780     </thead>
5781
5782     <tbody>
5783      <row>
5784       <entry><literal>trigger_catalog</literal></entry>
5785       <entry><type>sql_identifier</type></entry>
5786       <entry>Name of the database that contains the trigger (always the current database)</entry>
5787      </row>
5788
5789      <row>
5790       <entry><literal>trigger_schema</literal></entry>
5791       <entry><type>sql_identifier</type></entry>
5792       <entry>Name of the schema that contains the trigger</entry>
5793      </row>
5794
5795      <row>
5796       <entry><literal>trigger_name</literal></entry>
5797       <entry><type>sql_identifier</type></entry>
5798       <entry>Name of the trigger</entry>
5799      </row>
5800
5801      <row>
5802       <entry><literal>event_manipulation</literal></entry>
5803       <entry><type>character_data</type></entry>
5804       <entry>
5805        Event that fires the trigger (<literal>INSERT</literal>,
5806        <literal>UPDATE</literal>, or <literal>DELETE</literal>)
5807       </entry>
5808      </row>
5809
5810      <row>
5811       <entry><literal>event_object_catalog</literal></entry>
5812       <entry><type>sql_identifier</type></entry>
5813       <entry>
5814        Name of the database that contains the table that the trigger
5815        is defined on (always the current database)
5816       </entry>
5817      </row>
5818
5819      <row>
5820       <entry><literal>event_object_schema</literal></entry>
5821       <entry><type>sql_identifier</type></entry>
5822       <entry>Name of the schema that contains the table that the trigger is defined on</entry>
5823      </row>
5824
5825      <row>
5826       <entry><literal>event_object_table</literal></entry>
5827       <entry><type>sql_identifier</type></entry>
5828       <entry>Name of the table that the trigger is defined on</entry>
5829      </row>
5830
5831      <row>
5832       <entry><literal>action_order</literal></entry>
5833       <entry><type>cardinal_number</type></entry>
5834       <entry>
5835        Firing order among triggers on the same table having the same
5836        <literal>event_manipulation</literal>,
5837        <literal>action_timing</literal>, and
5838        <literal>action_orientation</literal>.  In
5839        <productname>PostgreSQL</productname>, triggers are fired in name
5840        order, so this column reflects that.
5841       </entry>
5842      </row>
5843
5844      <row>
5845       <entry><literal>action_condition</literal></entry>
5846       <entry><type>character_data</type></entry>
5847       <entry>
5848        <literal>WHEN</literal> condition of the trigger, null if none
5849        (also null if the table is not owned by a currently enabled
5850        role)
5851       </entry>
5852      </row>
5853
5854      <row>
5855       <entry><literal>action_statement</literal></entry>
5856       <entry><type>character_data</type></entry>
5857       <entry>
5858        Statement that is executed by the trigger (currently always
5859        <literal>EXECUTE FUNCTION
5860        <replaceable>function</replaceable>(...)</literal>)
5861       </entry>
5862      </row>
5863
5864      <row>
5865       <entry><literal>action_orientation</literal></entry>
5866       <entry><type>character_data</type></entry>
5867       <entry>
5868        Identifies whether the trigger fires once for each processed
5869        row or once for each statement (<literal>ROW</literal> or
5870        <literal>STATEMENT</literal>)
5871       </entry>
5872      </row>
5873
5874      <row>
5875       <entry><literal>action_timing</literal></entry>
5876       <entry><type>character_data</type></entry>
5877       <entry>
5878        Time at which the trigger fires (<literal>BEFORE</literal>,
5879        <literal>AFTER</literal>, or <literal>INSTEAD OF</literal>)
5880       </entry>
5881      </row>
5882
5883      <row>
5884       <entry><literal>action_reference_old_table</literal></entry>
5885       <entry><type>sql_identifier</type></entry>
5886       <entry>Name of the <quote>old</quote> transition table, or null if none</entry>
5887      </row>
5888
5889      <row>
5890       <entry><literal>action_reference_new_table</literal></entry>
5891       <entry><type>sql_identifier</type></entry>
5892       <entry>Name of the <quote>new</quote> transition table, or null if none</entry>
5893      </row>
5894
5895      <row>
5896       <entry><literal>action_reference_old_row</literal></entry>
5897       <entry><type>sql_identifier</type></entry>
5898       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
5899      </row>
5900
5901      <row>
5902       <entry><literal>action_reference_new_row</literal></entry>
5903       <entry><type>sql_identifier</type></entry>
5904       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
5905      </row>
5906
5907      <row>
5908       <entry><literal>created</literal></entry>
5909       <entry><type>time_stamp</type></entry>
5910       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
5911      </row>
5912     </tbody>
5913    </tgroup>
5914   </table>
5915
5916   <para>
5917    Triggers in <productname>PostgreSQL</productname> have two
5918    incompatibilities with the SQL standard that affect the
5919    representation in the information schema.  First, trigger names are
5920    local to each table in <productname>PostgreSQL</productname>, rather
5921    than being independent schema objects.  Therefore there can be duplicate
5922    trigger names defined in one schema, so long as they belong to
5923    different tables.  (<literal>trigger_catalog</literal> and
5924    <literal>trigger_schema</literal> are really the values pertaining
5925    to the table that the trigger is defined on.)  Second, triggers can
5926    be defined to fire on multiple events in
5927    <productname>PostgreSQL</productname> (e.g., <literal>ON INSERT OR
5928    UPDATE</literal>), whereas the SQL standard only allows one.  If a
5929    trigger is defined to fire on multiple events, it is represented as
5930    multiple rows in the information schema, one for each type of
5931    event.  As a consequence of these two issues, the primary key of
5932    the view <literal>triggers</literal> is really
5933    <literal>(trigger_catalog, trigger_schema, event_object_table,
5934    trigger_name, event_manipulation)</literal> instead of
5935    <literal>(trigger_catalog, trigger_schema, trigger_name)</literal>,
5936    which is what the SQL standard specifies.  Nonetheless, if you
5937    define your triggers in a manner that conforms with the SQL
5938    standard (trigger names unique in the schema and only one event
5939    type per trigger), this will not affect you.
5940   </para>
5941
5942   <note>
5943    <para>
5944     Prior to <productname>PostgreSQL</productname> 9.1, this view's columns
5945     <structfield>action_timing</structfield>,
5946     <structfield>action_reference_old_table</structfield>,
5947     <structfield>action_reference_new_table</structfield>,
5948     <structfield>action_reference_old_row</structfield>, and
5949     <structfield>action_reference_new_row</structfield>
5950     were named
5951     <structfield>condition_timing</structfield>,
5952     <structfield>condition_reference_old_table</structfield>,
5953     <structfield>condition_reference_new_table</structfield>,
5954     <structfield>condition_reference_old_row</structfield>, and
5955     <structfield>condition_reference_new_row</structfield>
5956     respectively.
5957     That was how they were named in the SQL:1999 standard.
5958     The new naming conforms to SQL:2003 and later.
5959    </para>
5960   </note>
5961  </sect1>
5962
5963  <sect1 id="infoschema-udt-privileges">
5964   <title><literal>udt_privileges</literal></title>
5965
5966   <para>
5967    The view <literal>udt_privileges</literal> identifies
5968    <literal>USAGE</literal> privileges granted on user-defined types to a
5969    currently enabled role or by a currently enabled role.  There is one row for
5970    each combination of type, grantor, and grantee.  This view shows only
5971    composite types (see under <xref linkend="infoschema-user-defined-types"/>
5972    for why); see
5973    <xref linkend="infoschema-usage-privileges"/> for domain privileges.
5974   </para>
5975
5976   <table>
5977    <title><literal>udt_privileges</literal> Columns</title>
5978
5979    <tgroup cols="3">
5980     <thead>
5981      <row>
5982       <entry>Name</entry>
5983       <entry>Data Type</entry>
5984       <entry>Description</entry>
5985      </row>
5986     </thead>
5987
5988     <tbody>
5989      <row>
5990       <entry><literal>grantor</literal></entry>
5991       <entry><type>sql_identifier</type></entry>
5992       <entry>Name of the role that granted the privilege</entry>
5993      </row>
5994
5995      <row>
5996       <entry><literal>grantee</literal></entry>
5997       <entry><type>sql_identifier</type></entry>
5998       <entry>Name of the role that the privilege was granted to</entry>
5999      </row>
6000
6001      <row>
6002       <entry><literal>udt_catalog</literal></entry>
6003       <entry><type>sql_identifier</type></entry>
6004       <entry>Name of the database containing the type (always the current database)</entry>
6005      </row>
6006
6007      <row>
6008       <entry><literal>udt_schema</literal></entry>
6009       <entry><type>sql_identifier</type></entry>
6010       <entry>Name of the schema containing the type</entry>
6011      </row>
6012
6013      <row>
6014       <entry><literal>udt_name</literal></entry>
6015       <entry><type>sql_identifier</type></entry>
6016       <entry>Name of the type</entry>
6017      </row>
6018
6019      <row>
6020       <entry><literal>privilege_type</literal></entry>
6021       <entry><type>character_data</type></entry>
6022       <entry>Always <literal>TYPE USAGE</literal></entry>
6023      </row>
6024
6025      <row>
6026       <entry><literal>is_grantable</literal></entry>
6027       <entry><type>yes_or_no</type></entry>
6028       <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
6029      </row>
6030     </tbody>
6031    </tgroup>
6032   </table>
6033  </sect1>
6034
6035  <sect1 id="infoschema-usage-privileges">
6036   <title><literal>usage_privileges</literal></title>
6037
6038   <para>
6039    The view <literal>usage_privileges</literal> identifies
6040    <literal>USAGE</literal> privileges granted on various kinds of
6041    objects to a currently enabled role or by a currently enabled role.
6042    In <productname>PostgreSQL</productname>, this currently applies to
6043    collations, domains, foreign-data wrappers, foreign servers, and sequences.  There is one
6044    row for each combination of object, grantor, and grantee.
6045   </para>
6046
6047   <para>
6048    Since collations do not have real privileges
6049    in <productname>PostgreSQL</productname>, this view shows implicit
6050    non-grantable <literal>USAGE</literal> privileges granted by the
6051    owner to <literal>PUBLIC</literal> for all collations.  The other
6052    object types, however, show real privileges.
6053   </para>
6054
6055   <para>
6056    In PostgreSQL, sequences also support <literal>SELECT</literal>
6057    and <literal>UPDATE</literal> privileges in addition to
6058    the <literal>USAGE</literal> privilege.  These are nonstandard and therefore
6059    not visible in the information schema.
6060   </para>
6061
6062   <table>
6063    <title><literal>usage_privileges</literal> Columns</title>
6064
6065    <tgroup cols="3">
6066     <thead>
6067      <row>
6068       <entry>Name</entry>
6069       <entry>Data Type</entry>
6070       <entry>Description</entry>
6071      </row>
6072     </thead>
6073
6074     <tbody>
6075      <row>
6076       <entry><literal>grantor</literal></entry>
6077       <entry><type>sql_identifier</type></entry>
6078       <entry>Name of the role that granted the privilege</entry>
6079      </row>
6080
6081      <row>
6082       <entry><literal>grantee</literal></entry>
6083       <entry><type>sql_identifier</type></entry>
6084       <entry>Name of the role that the privilege was granted to</entry>
6085      </row>
6086
6087      <row>
6088       <entry><literal>object_catalog</literal></entry>
6089       <entry><type>sql_identifier</type></entry>
6090       <entry>Name of the database containing the object (always the current database)</entry>
6091      </row>
6092
6093      <row>
6094       <entry><literal>object_schema</literal></entry>
6095       <entry><type>sql_identifier</type></entry>
6096       <entry>Name of the schema containing the object, if applicable,
6097       else an empty string</entry>
6098      </row>
6099
6100      <row>
6101       <entry><literal>object_name</literal></entry>
6102       <entry><type>sql_identifier</type></entry>
6103       <entry>Name of the object</entry>
6104      </row>
6105
6106      <row>
6107       <entry><literal>object_type</literal></entry>
6108       <entry><type>character_data</type></entry>
6109       <entry><literal>COLLATION</literal> or <literal>DOMAIN</literal> or <literal>FOREIGN DATA WRAPPER</literal> or <literal>FOREIGN SERVER</literal> or <literal>SEQUENCE</literal></entry>
6110      </row>
6111
6112      <row>
6113       <entry><literal>privilege_type</literal></entry>
6114       <entry><type>character_data</type></entry>
6115       <entry>Always <literal>USAGE</literal></entry>
6116      </row>
6117
6118      <row>
6119       <entry><literal>is_grantable</literal></entry>
6120       <entry><type>yes_or_no</type></entry>
6121       <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
6122      </row>
6123     </tbody>
6124    </tgroup>
6125   </table>
6126  </sect1>
6127
6128  <sect1 id="infoschema-user-defined-types">
6129   <title><literal>user_defined_types</literal></title>
6130
6131   <para>
6132    The view <literal>user_defined_types</literal> currently contains
6133    all composite types defined in the current database.
6134    Only those types are shown that the current user has access to (by way
6135    of being the owner or having some privilege).
6136   </para>
6137
6138   <para>
6139    SQL knows about two kinds of user-defined types: structured types
6140    (also known as composite types
6141    in <productname>PostgreSQL</productname>) and distinct types (not
6142    implemented in <productname>PostgreSQL</productname>).  To be
6143    future-proof, use the
6144    column <literal>user_defined_type_category</literal> to
6145    differentiate between these.  Other user-defined types such as base
6146    types and enums, which are <productname>PostgreSQL</productname>
6147    extensions, are not shown here.  For domains,
6148    see <xref linkend="infoschema-domains"/> instead.
6149   </para>
6150
6151   <table>
6152    <title><literal>user_defined_types</literal> Columns</title>
6153
6154    <tgroup cols="3">
6155     <thead>
6156      <row>
6157       <entry>Name</entry>
6158       <entry>Data Type</entry>
6159       <entry>Description</entry>
6160      </row>
6161     </thead>
6162
6163     <tbody>
6164      <row>
6165       <entry><literal>user_defined_type_catalog</literal></entry>
6166       <entry><type>sql_identifier</type></entry>
6167       <entry>Name of the database that contains the type (always the current database)</entry>
6168      </row>
6169
6170      <row>
6171       <entry><literal>user_defined_type_schema</literal></entry>
6172       <entry><type>sql_identifier</type></entry>
6173       <entry>Name of the schema that contains the type</entry>
6174      </row>
6175
6176      <row>
6177       <entry><literal>user_defined_type_name</literal></entry>
6178       <entry><type>sql_identifier</type></entry>
6179       <entry>Name of the type</entry>
6180      </row>
6181
6182      <row>
6183       <entry><literal>user_defined_type_category</literal></entry>
6184       <entry><type>character_data</type></entry>
6185       <entry>
6186        Currently always <literal>STRUCTURED</literal>
6187       </entry>
6188      </row>
6189
6190      <row>
6191       <entry><literal>is_instantiable</literal></entry>
6192       <entry><type>yes_or_no</type></entry>
6193       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
6194      </row>
6195
6196      <row>
6197       <entry><literal>is_final</literal></entry>
6198       <entry><type>yes_or_no</type></entry>
6199       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
6200      </row>
6201
6202      <row>
6203       <entry><literal>ordering_form</literal></entry>
6204       <entry><type>character_data</type></entry>
6205       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
6206      </row>
6207
6208      <row>
6209       <entry><literal>ordering_category</literal></entry>
6210       <entry><type>character_data</type></entry>
6211       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
6212      </row>
6213
6214      <row>
6215       <entry><literal>ordering_routine_catalog</literal></entry>
6216       <entry><type>sql_identifier</type></entry>
6217       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
6218      </row>
6219
6220      <row>
6221       <entry><literal>ordering_routine_schema</literal></entry>
6222       <entry><type>sql_identifier</type></entry>
6223       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
6224      </row>
6225
6226      <row>
6227       <entry><literal>ordering_routine_name</literal></entry>
6228       <entry><type>sql_identifier</type></entry>
6229       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
6230      </row>
6231
6232      <row>
6233       <entry><literal>reference_type</literal></entry>
6234       <entry><type>character_data</type></entry>
6235       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
6236      </row>
6237
6238      <row>
6239       <entry><literal>data_type</literal></entry>
6240       <entry><type>character_data</type></entry>
6241       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
6242      </row>
6243
6244      <row>
6245       <entry><literal>character_maximum_length</literal></entry>
6246       <entry><type>cardinal_number</type></entry>
6247       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
6248      </row>
6249
6250      <row>
6251       <entry><literal>character_octet_length</literal></entry>
6252       <entry><type>cardinal_number</type></entry>
6253       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
6254      </row>
6255
6256      <row>
6257       <entry><literal>character_set_catalog</literal></entry>
6258       <entry><type>sql_identifier</type></entry>
6259       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
6260      </row>
6261
6262      <row>
6263       <entry><literal>character_set_schema</literal></entry>
6264       <entry><type>sql_identifier</type></entry>
6265       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
6266      </row>
6267
6268      <row>
6269       <entry><literal>character_set_name</literal></entry>
6270       <entry><type>sql_identifier</type></entry>
6271       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
6272      </row>
6273
6274      <row>
6275       <entry><literal>collation_catalog</literal></entry>
6276       <entry><type>sql_identifier</type></entry>
6277       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
6278      </row>
6279
6280      <row>
6281       <entry><literal>collation_schema</literal></entry>
6282       <entry><type>sql_identifier</type></entry>
6283       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
6284      </row>
6285
6286      <row>
6287       <entry><literal>collation_name</literal></entry>
6288       <entry><type>sql_identifier</type></entry>
6289       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
6290      </row>
6291
6292      <row>
6293       <entry><literal>numeric_precision</literal></entry>
6294       <entry><type>cardinal_number</type></entry>
6295       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
6296      </row>
6297
6298      <row>
6299       <entry><literal>numeric_precision_radix</literal></entry>
6300       <entry><type>cardinal_number</type></entry>
6301       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
6302      </row>
6303
6304      <row>
6305       <entry><literal>numeric_scale</literal></entry>
6306       <entry><type>cardinal_number</type></entry>
6307       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
6308      </row>
6309
6310      <row>
6311       <entry><literal>datetime_precision</literal></entry>
6312       <entry><type>cardinal_number</type></entry>
6313       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
6314      </row>
6315
6316      <row>
6317       <entry><literal>interval_type</literal></entry>
6318       <entry><type>character_data</type></entry>
6319       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
6320      </row>
6321
6322      <row>
6323       <entry><literal>interval_precision</literal></entry>
6324       <entry><type>cardinal_number</type></entry>
6325       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
6326      </row>
6327
6328      <row>
6329       <entry><literal>source_dtd_identifier</literal></entry>
6330       <entry><type>sql_identifier</type></entry>
6331       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
6332      </row>
6333
6334      <row>
6335       <entry><literal>ref_dtd_identifier</literal></entry>
6336       <entry><type>sql_identifier</type></entry>
6337       <entry>Applies to a feature not available in <productname>PostgreSQL</productname></entry>
6338      </row>
6339     </tbody>
6340    </tgroup>
6341   </table>
6342  </sect1>
6343
6344  <sect1 id="infoschema-user-mapping-options">
6345   <title><literal>user_mapping_options</literal></title>
6346
6347   <para>
6348    The view <literal>user_mapping_options</literal> contains all the
6349    options defined for user mappings in the current database.  Only
6350    those user mappings are shown where the current user has access to
6351    the corresponding foreign server (by way of being the owner or
6352    having some privilege).
6353   </para>
6354
6355   <table>
6356    <title><literal>user_mapping_options</literal> Columns</title>
6357
6358    <tgroup cols="3">
6359     <thead>
6360      <row>
6361       <entry>Name</entry>
6362       <entry>Data Type</entry>
6363       <entry>Description</entry>
6364      </row>
6365     </thead>
6366
6367     <tbody>
6368      <row>
6369       <entry><literal>authorization_identifier</literal></entry>
6370       <entry><type>sql_identifier</type></entry>
6371       <entry>Name of the user being mapped,
6372       or <literal>PUBLIC</literal> if the mapping is public</entry>
6373      </row>
6374
6375      <row>
6376       <entry><literal>foreign_server_catalog</literal></entry>
6377       <entry><type>sql_identifier</type></entry>
6378       <entry>Name of the database that the foreign server used by this
6379       mapping is defined in (always the current database)</entry>
6380      </row>
6381
6382      <row>
6383       <entry><literal>foreign_server_name</literal></entry>
6384       <entry><type>sql_identifier</type></entry>
6385       <entry>Name of the foreign server used by this mapping</entry>
6386      </row>
6387
6388      <row>
6389       <entry><literal>option_name</literal></entry>
6390       <entry><type>sql_identifier</type></entry>
6391       <entry>Name of an option</entry>
6392      </row>
6393
6394      <row>
6395       <entry><literal>option_value</literal></entry>
6396       <entry><type>character_data</type></entry>
6397       <entry>Value of the option.  This column will show as null
6398       unless the current user is the user being mapped, or the mapping
6399       is for <literal>PUBLIC</literal> and the current user is the
6400       server owner, or the current user is a superuser.  The intent is
6401       to protect password information stored as user mapping
6402       option.</entry>
6403      </row>
6404     </tbody>
6405    </tgroup>
6406   </table>
6407  </sect1>
6408
6409  <sect1 id="infoschema-user-mappings">
6410   <title><literal>user_mappings</literal></title>
6411
6412   <para>
6413    The view <literal>user_mappings</literal> contains all user
6414    mappings defined in the current database.  Only those user mappings
6415    are shown where the current user has access to the corresponding
6416    foreign server (by way of being the owner or having some
6417    privilege).
6418   </para>
6419
6420   <table>
6421    <title><literal>user_mappings</literal> Columns</title>
6422
6423    <tgroup cols="3">
6424     <thead>
6425      <row>
6426       <entry>Name</entry>
6427       <entry>Data Type</entry>
6428       <entry>Description</entry>
6429      </row>
6430     </thead>
6431
6432     <tbody>
6433      <row>
6434       <entry><literal>authorization_identifier</literal></entry>
6435       <entry><type>sql_identifier</type></entry>
6436       <entry>Name of the user being mapped,
6437       or <literal>PUBLIC</literal> if the mapping is public</entry>
6438      </row>
6439
6440      <row>
6441       <entry><literal>foreign_server_catalog</literal></entry>
6442       <entry><type>sql_identifier</type></entry>
6443       <entry>Name of the database that the foreign server used by this
6444       mapping is defined in (always the current database)</entry>
6445      </row>
6446
6447      <row>
6448       <entry><literal>foreign_server_name</literal></entry>
6449       <entry><type>sql_identifier</type></entry>
6450       <entry>Name of the foreign server used by this mapping</entry>
6451      </row>
6452     </tbody>
6453    </tgroup>
6454   </table>
6455  </sect1>
6456
6457  <sect1 id="infoschema-view-column-usage">
6458   <title><literal>view_column_usage</literal></title>
6459
6460   <para>
6461    The view <literal>view_column_usage</literal> identifies all
6462    columns that are used in the query expression of a view (the
6463    <command>SELECT</command> statement that defines the view).  A
6464    column is only included if the table that contains the column is
6465    owned by a currently enabled role.
6466   </para>
6467
6468   <note>
6469    <para>
6470     Columns of system tables are not included.  This should be fixed
6471     sometime.
6472    </para>
6473   </note>
6474
6475   <table>
6476    <title><literal>view_column_usage</literal> Columns</title>
6477
6478    <tgroup cols="3">
6479     <thead>
6480      <row>
6481       <entry>Name</entry>
6482       <entry>Data Type</entry>
6483       <entry>Description</entry>
6484      </row>
6485     </thead>
6486
6487     <tbody>
6488      <row>
6489       <entry><literal>view_catalog</literal></entry>
6490       <entry><type>sql_identifier</type></entry>
6491       <entry>Name of the database that contains the view (always the current database)</entry>
6492      </row>
6493
6494      <row>
6495       <entry><literal>view_schema</literal></entry>
6496       <entry><type>sql_identifier</type></entry>
6497       <entry>Name of the schema that contains the view</entry>
6498      </row>
6499
6500      <row>
6501       <entry><literal>view_name</literal></entry>
6502       <entry><type>sql_identifier</type></entry>
6503       <entry>Name of the view</entry>
6504      </row>
6505
6506      <row>
6507       <entry><literal>table_catalog</literal></entry>
6508       <entry><type>sql_identifier</type></entry>
6509       <entry>
6510        Name of the database that contains the table that contains the
6511        column that is used by the view (always the current database)
6512       </entry>
6513      </row>
6514
6515      <row>
6516       <entry><literal>table_schema</literal></entry>
6517       <entry><type>sql_identifier</type></entry>
6518       <entry>
6519        Name of the schema that contains the table that contains the
6520        column that is used by the view
6521       </entry>
6522      </row>
6523
6524      <row>
6525       <entry><literal>table_name</literal></entry>
6526       <entry><type>sql_identifier</type></entry>
6527       <entry>
6528        Name of the table that contains the column that is used by the
6529        view
6530       </entry>
6531      </row>
6532
6533      <row>
6534       <entry><literal>column_name</literal></entry>
6535       <entry><type>sql_identifier</type></entry>
6536       <entry>Name of the column that is used by the view</entry>
6537      </row>
6538     </tbody>
6539    </tgroup>
6540   </table>
6541  </sect1>
6542
6543  <sect1 id="infoschema-view-routine-usage">
6544   <title><literal>view_routine_usage</literal></title>
6545
6546   <para>
6547    The view <literal>view_routine_usage</literal> identifies all
6548    routines (functions and procedures) that are used in the query
6549    expression of a view (the <command>SELECT</command> statement that
6550    defines the view).  A routine is only included if that routine is
6551    owned by a currently enabled role.
6552   </para>
6553
6554   <table>
6555    <title><literal>view_routine_usage</literal> Columns</title>
6556
6557    <tgroup cols="3">
6558     <thead>
6559      <row>
6560       <entry>Name</entry>
6561       <entry>Data Type</entry>
6562       <entry>Description</entry>
6563      </row>
6564     </thead>
6565
6566     <tbody>
6567      <row>
6568       <entry><literal>table_catalog</literal></entry>
6569       <entry><literal>sql_identifier</literal></entry>
6570       <entry>Name of the database containing the view (always the current database)</entry>
6571      </row>
6572
6573      <row>
6574       <entry><literal>table_schema</literal></entry>
6575       <entry><literal>sql_identifier</literal></entry>
6576       <entry>Name of the schema containing the view</entry>
6577      </row>
6578
6579      <row>
6580       <entry><literal>table_name</literal></entry>
6581       <entry><literal>sql_identifier</literal></entry>
6582       <entry>Name of the view</entry>
6583      </row>
6584
6585      <row>
6586       <entry><literal>specific_catalog</literal></entry>
6587       <entry><literal>sql_identifier</literal></entry>
6588       <entry>Name of the database containing the function (always the current database)</entry>
6589      </row>
6590
6591      <row>
6592       <entry><literal>specific_schema</literal></entry>
6593       <entry><literal>sql_identifier</literal></entry>
6594       <entry>Name of the schema containing the function</entry>
6595      </row>
6596
6597      <row>
6598       <entry><literal>specific_name</literal></entry>
6599       <entry><literal>sql_identifier</literal></entry>
6600       <entry>
6601        The <quote>specific name</quote> of the function.  See <xref
6602        linkend="infoschema-routines"/> for more information.
6603       </entry>
6604      </row>
6605     </tbody>
6606    </tgroup>
6607   </table>
6608  </sect1>
6609
6610  <sect1 id="infoschema-view-table-usage">
6611   <title><literal>view_table_usage</literal></title>
6612
6613   <para>
6614    The view <literal>view_table_usage</literal> identifies all tables
6615    that are used in the query expression of a view (the
6616    <command>SELECT</command> statement that defines the view).  A
6617    table is only included if that table is owned by a currently
6618    enabled role.
6619   </para>
6620
6621   <note>
6622    <para>
6623     System tables are not included.  This should be fixed sometime.
6624    </para>
6625   </note>
6626
6627   <table>
6628    <title><literal>view_table_usage</literal> Columns</title>
6629
6630    <tgroup cols="3">
6631     <thead>
6632      <row>
6633       <entry>Name</entry>
6634       <entry>Data Type</entry>
6635       <entry>Description</entry>
6636      </row>
6637     </thead>
6638
6639     <tbody>
6640      <row>
6641       <entry><literal>view_catalog</literal></entry>
6642       <entry><type>sql_identifier</type></entry>
6643       <entry>Name of the database that contains the view (always the current database)</entry>
6644      </row>
6645
6646      <row>
6647       <entry><literal>view_schema</literal></entry>
6648       <entry><type>sql_identifier</type></entry>
6649       <entry>Name of the schema that contains the view</entry>
6650      </row>
6651
6652      <row>
6653       <entry><literal>view_name</literal></entry>
6654       <entry><type>sql_identifier</type></entry>
6655       <entry>Name of the view</entry>
6656      </row>
6657
6658      <row>
6659       <entry><literal>table_catalog</literal></entry>
6660       <entry><type>sql_identifier</type></entry>
6661       <entry>
6662        Name of the database that contains the table that is
6663        used by the view (always the current database)
6664       </entry>
6665      </row>
6666
6667      <row>
6668       <entry><literal>table_schema</literal></entry>
6669       <entry><type>sql_identifier</type></entry>
6670       <entry>
6671        Name of the schema that contains the table that is used by the
6672        view
6673       </entry>
6674      </row>
6675
6676      <row>
6677       <entry><literal>table_name</literal></entry>
6678       <entry><type>sql_identifier</type></entry>
6679       <entry>
6680        Name of the table that is used by the view
6681       </entry>
6682      </row>
6683     </tbody>
6684    </tgroup>
6685   </table>
6686  </sect1>
6687
6688  <sect1 id="infoschema-views">
6689   <title><literal>views</literal></title>
6690
6691   <para>
6692    The view <literal>views</literal> contains all views defined in the
6693    current database.  Only those views are shown that the current user
6694    has access to (by way of being the owner or having some privilege).
6695   </para>
6696
6697   <table>
6698    <title><literal>views</literal> Columns</title>
6699
6700    <tgroup cols="3">
6701     <thead>
6702      <row>
6703       <entry>Name</entry>
6704       <entry>Data Type</entry>
6705       <entry>Description</entry>
6706      </row>
6707     </thead>
6708
6709     <tbody>
6710      <row>
6711       <entry><literal>table_catalog</literal></entry>
6712       <entry><type>sql_identifier</type></entry>
6713       <entry>Name of the database that contains the view (always the current database)</entry>
6714      </row>
6715
6716      <row>
6717       <entry><literal>table_schema</literal></entry>
6718       <entry><type>sql_identifier</type></entry>
6719       <entry>Name of the schema that contains the view</entry>
6720      </row>
6721
6722      <row>
6723       <entry><literal>table_name</literal></entry>
6724       <entry><type>sql_identifier</type></entry>
6725       <entry>Name of the view</entry>
6726      </row>
6727
6728      <row>
6729       <entry><literal>view_definition</literal></entry>
6730       <entry><type>character_data</type></entry>
6731       <entry>
6732        Query expression defining the view (null if the view is not
6733        owned by a currently enabled role)
6734       </entry>
6735      </row>
6736
6737      <row>
6738       <entry><literal>check_option</literal></entry>
6739       <entry><type>character_data</type></entry>
6740       <entry>
6741        <literal>CASCADED</literal> or <literal>LOCAL</literal> if the view
6742        has a <literal>CHECK OPTION</literal> defined on it,
6743        <literal>NONE</literal> if not
6744       </entry>
6745      </row>
6746
6747      <row>
6748       <entry><literal>is_updatable</literal></entry>
6749       <entry><type>yes_or_no</type></entry>
6750       <entry>
6751        <literal>YES</literal> if the view is updatable (allows
6752        <command>UPDATE</command> and <command>DELETE</command>),
6753        <literal>NO</literal> if not
6754       </entry>
6755      </row>
6756
6757      <row>
6758       <entry><literal>is_insertable_into</literal></entry>
6759       <entry><type>yes_or_no</type></entry>
6760       <entry>
6761        <literal>YES</literal> if the view is insertable into (allows
6762        <command>INSERT</command>), <literal>NO</literal> if not
6763       </entry>
6764      </row>
6765
6766      <row>
6767       <entry><literal>is_trigger_updatable</literal></entry>
6768       <entry><type>yes_or_no</type></entry>
6769       <entry>
6770        <literal>YES</literal> if the view has an <literal>INSTEAD OF</literal>
6771        <command>UPDATE</command> trigger defined on it, <literal>NO</literal> if not
6772       </entry>
6773      </row>
6774
6775      <row>
6776       <entry><literal>is_trigger_deletable</literal></entry>
6777       <entry><type>yes_or_no</type></entry>
6778       <entry>
6779        <literal>YES</literal> if the view has an <literal>INSTEAD OF</literal>
6780        <command>DELETE</command> trigger defined on it, <literal>NO</literal> if not
6781       </entry>
6782      </row>
6783
6784      <row>
6785       <entry><literal>is_trigger_insertable_into</literal></entry>
6786       <entry><type>yes_or_no</type></entry>
6787       <entry>
6788        <literal>YES</literal> if the view has an <literal>INSTEAD OF</literal>
6789        <command>INSERT</command> trigger defined on it, <literal>NO</literal> if not
6790       </entry>
6791      </row>
6792     </tbody>
6793    </tgroup>
6794   </table>
6795  </sect1>
6796
6797 </chapter>