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