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