The code to unlink dropped relations in FinishPreparedTransaction() was
[PostgreSQL.git] / doc / src / sgml / information_schema.sgml
blob8e145d7ef1163d8cfd1fd3689999378e71565523
1 <!-- $PostgreSQL$ -->
3 <chapter id="information-schema">
4 <title>The Information Schema</title>
6 <indexterm zone="information-schema">
7 <primary>information schema</primary>
8 </indexterm>
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>
24 <sect1 id="infoschema-schema">
25 <title>The Schema</title>
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>
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>
46 <sect1 id="infoschema-datatypes">
47 <title>Data Types</title>
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>
58 <para>
59 These types are:
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>
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>
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>
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>
101 Every column in the information schema has one of these four types.
102 </para>
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>
115 <sect1 id="infoschema-information-schema-catalog-name">
116 <title><literal>information_schema_catalog_name</literal></title>
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>
124 <table>
125 <title><literal>information_schema_catalog_name</literal> Columns</title>
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>
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>
147 <sect1 id="infoschema-administrable-role-authorizations">
148 <title><literal>administrable_role_authorizations</literal></title>
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>
156 <table>
157 <title><literal>administrable_role_authorizations</literal> Columns</title>
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>
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>
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>
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>
195 <sect1 id="infoschema-applicable-roles">
196 <title><literal>applicable_roles</literal></title>
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>
208 <table>
209 <title><literal>applicable_roles</literal> Columns</title>
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>
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>
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>
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>
250 <sect1 id="infoschema-attributes">
251 <title><literal>attributes</literal></title>
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>
260 <table>
261 <title><literal>attributes</literal> Columns</title>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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 (this
347 should not be of concern to
348 <productname>PostgreSQL</productname> users); null for all
349 other data types.
350 </entry>
351 </row>
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>
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>
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>
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>
407 <row>
408 <entry><literal>interval_type</literal></entry>
409 <entry><type>character_data</type></entry>
410 <entry>Not yet implemented</entry>
411 </row>
413 <row>
414 <entry><literal>interval_precision</literal></entry>
415 <entry><type>character_data</type></entry>
416 <entry>Not yet implemented</entry>
417 </row>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
496 <sect1 id="infoschema-check-constraint-routine-usage">
497 <title><literal>check_constraint_routine_usage</literal></title>
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>
506 <table>
507 <title><literal>check_constraint_routine_usage</literal> Columns</title>
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>
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>
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>
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>
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>
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>
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>
562 <sect1 id="infoschema-check-constraints">
563 <title><literal>check_constraints</literal></title>
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>
572 <table>
573 <title><literal>check_constraints</literal> Columns</title>
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>
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>
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>
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>
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>
613 <sect1 id="infoschema-column-domain-usage">
614 <title><literal>column_domain_usage</literal></title>
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>
622 <table>
623 <title><literal>column_domain_usage</literal> Columns</title>
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>
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>
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>
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>
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>
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>
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>
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>
681 <sect1 id="infoschema-column-privileges">
682 <title><literal>column_privileges</literal></title>
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>
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>
699 <table>
700 <title><literal>column_privileges</literal> Columns</title>
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>
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>
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>
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>
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>
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>
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>
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>
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>
768 <sect1 id="infoschema-column-udt-usage">
769 <title><literal>column_udt_usage</literal></title>
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>
779 <table>
780 <title><literal>column_udt_usage</literal> Columns</title>
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>
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>
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>
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>
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>
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>
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>
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>
848 <sect1 id="infoschema-columns">
849 <title><literal>columns</literal></title>
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>
859 <table>
860 <title><literal>columns</literal> Columns</title>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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 (this
951 should not be of concern to <productname>PostgreSQL</productname> users); null for all
952 other data types.
953 </entry>
954 </row>
956 <row>
957 <entry><literal>numeric_precision</literal></entry>
958 <entry><type>cardinal_number</type></entry>
959 <entry>
960 If <literal>data_type</literal> identifies a numeric type, this
961 column contains the (declared or implicit) precision of the
962 type for this column. The precision indicates the number of
963 significant digits. It can be expressed in decimal (base 10)
964 or binary (base 2) terms, as specified in the column
965 <literal>numeric_precision_radix</literal>. For all other data
966 types, this column is null.
967 </entry>
968 </row>
970 <row>
971 <entry><literal>numeric_precision_radix</literal></entry>
972 <entry><type>cardinal_number</type></entry>
973 <entry>
974 If <literal>data_type</literal> identifies a numeric type, this
975 column indicates in which base the values in the columns
976 <literal>numeric_precision</literal> and
977 <literal>numeric_scale</literal> are expressed. The value is
978 either 2 or 10. For all other data types, this column is null.
979 </entry>
980 </row>
982 <row>
983 <entry><literal>numeric_scale</literal></entry>
984 <entry><type>cardinal_number</type></entry>
985 <entry>
986 If <literal>data_type</literal> identifies an exact numeric
987 type, this column contains the (declared or implicit) scale of
988 the type for this column. The scale indicates the number of
989 significant digits to the right of the decimal point. It can
990 be expressed in decimal (base 10) or binary (base 2) terms, as
991 specified in the column
992 <literal>numeric_precision_radix</literal>. For all other data
993 types, this column is null.
994 </entry>
995 </row>
997 <row>
998 <entry><literal>datetime_precision</literal></entry>
999 <entry><type>cardinal_number</type></entry>
1000 <entry>
1001 If <literal>data_type</literal> identifies a date, time,
1002 timestamp, or interval type, this column contains the (declared
1003 or implicit) fractional seconds precision of the type for this
1004 column, that is, the number of decimal digits maintained
1005 following the decimal point in the seconds value. For all
1006 other data types, this column is null.
1007 </entry>
1008 </row>
1010 <row>
1011 <entry><literal>interval_type</literal></entry>
1012 <entry><type>character_data</type></entry>
1013 <entry>Not yet implemented</entry>
1014 </row>
1016 <row>
1017 <entry><literal>interval_precision</literal></entry>
1018 <entry><type>character_data</type></entry>
1019 <entry>Not yet implemented</entry>
1020 </row>
1022 <row>
1023 <entry><literal>character_set_catalog</literal></entry>
1024 <entry><type>sql_identifier</type></entry>
1025 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1026 </row>
1028 <row>
1029 <entry><literal>character_set_schema</literal></entry>
1030 <entry><type>sql_identifier</type></entry>
1031 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1032 </row>
1034 <row>
1035 <entry><literal>character_set_name</literal></entry>
1036 <entry><type>sql_identifier</type></entry>
1037 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1038 </row>
1040 <row>
1041 <entry><literal>collation_catalog</literal></entry>
1042 <entry><type>sql_identifier</type></entry>
1043 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1044 </row>
1046 <row>
1047 <entry><literal>collation_schema</literal></entry>
1048 <entry><type>sql_identifier</type></entry>
1049 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1050 </row>
1052 <row>
1053 <entry><literal>collation_name</literal></entry>
1054 <entry><type>sql_identifier</type></entry>
1055 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1056 </row>
1058 <row>
1059 <entry><literal>domain_catalog</literal></entry>
1060 <entry><type>sql_identifier</type></entry>
1061 <entry>
1062 If the column has a domain type, the name of the database that
1063 the domain is defined in (always the current database), else
1064 null.
1065 </entry>
1066 </row>
1068 <row>
1069 <entry><literal>domain_schema</literal></entry>
1070 <entry><type>sql_identifier</type></entry>
1071 <entry>
1072 If the column has a domain type, the name of the schema that
1073 the domain is defined in, else null.
1074 </entry>
1075 </row>
1077 <row>
1078 <entry><literal>domain_name</literal></entry>
1079 <entry><type>sql_identifier</type></entry>
1080 <entry>If the column has a domain type, the name of the domain, else null.</entry>
1081 </row>
1083 <row>
1084 <entry><literal>udt_catalog</literal></entry>
1085 <entry><type>sql_identifier</type></entry>
1086 <entry>
1087 Name of the database that the column data type (the underlying
1088 type of the domain, if applicable) is defined in (always the
1089 current database)
1090 </entry>
1091 </row>
1093 <row>
1094 <entry><literal>udt_schema</literal></entry>
1095 <entry><type>sql_identifier</type></entry>
1096 <entry>
1097 Name of the schema that the column data type (the underlying
1098 type of the domain, if applicable) is defined in
1099 </entry>
1100 </row>
1102 <row>
1103 <entry><literal>udt_name</literal></entry>
1104 <entry><type>sql_identifier</type></entry>
1105 <entry>
1106 Name of the column data type (the underlying type of the
1107 domain, if applicable)
1108 </entry>
1109 </row>
1111 <row>
1112 <entry><literal>scope_catalog</literal></entry>
1113 <entry><type>sql_identifier</type></entry>
1114 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1115 </row>
1117 <row>
1118 <entry><literal>scope_schema</literal></entry>
1119 <entry><type>sql_identifier</type></entry>
1120 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1121 </row>
1123 <row>
1124 <entry><literal>scope_name</literal></entry>
1125 <entry><type>sql_identifier</type></entry>
1126 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1127 </row>
1129 <row>
1130 <entry><literal>maximum_cardinality</literal></entry>
1131 <entry><type>cardinal_number</type></entry>
1132 <entry>Always null, because arrays always have unlimited maximum cardinality in <productname>PostgreSQL</></entry>
1133 </row>
1135 <row>
1136 <entry><literal>dtd_identifier</literal></entry>
1137 <entry><type>sql_identifier</type></entry>
1138 <entry>
1139 An identifier of the data type descriptor of the column, unique
1140 among the data type descriptors pertaining to the table. This
1141 is mainly useful for joining with other instances of such
1142 identifiers. (The specific format of the identifier is not
1143 defined and not guaranteed to remain the same in future
1144 versions.)
1145 </entry>
1146 </row>
1148 <row>
1149 <entry><literal>is_self_referencing</literal></entry>
1150 <entry><type>character_data</type></entry>
1151 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1152 </row>
1154 <row>
1155 <entry><literal>is_identity</literal></entry>
1156 <entry><type>character_data</type></entry>
1157 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1158 </row>
1160 <row>
1161 <entry><literal>identity_generation</literal></entry>
1162 <entry><type>character_data</type></entry>
1163 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1164 </row>
1166 <row>
1167 <entry><literal>identity_start</literal></entry>
1168 <entry><type>character_data</type></entry>
1169 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1170 </row>
1172 <row>
1173 <entry><literal>identity_increment</literal></entry>
1174 <entry><type>character_data</type></entry>
1175 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1176 </row>
1178 <row>
1179 <entry><literal>identity_maximum</literal></entry>
1180 <entry><type>character_data</type></entry>
1181 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1182 </row>
1184 <row>
1185 <entry><literal>identity_minimum</literal></entry>
1186 <entry><type>character_data</type></entry>
1187 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1188 </row>
1190 <row>
1191 <entry><literal>identity_cycle</literal></entry>
1192 <entry><type>character_data</type></entry>
1193 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1194 </row>
1196 <row>
1197 <entry><literal>is_generated</literal></entry>
1198 <entry><type>character_data</type></entry>
1199 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1200 </row>
1202 <row>
1203 <entry><literal>generation_expression</literal></entry>
1204 <entry><type>character_data</type></entry>
1205 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1206 </row>
1208 <row>
1209 <entry><literal>is_updatable</literal></entry>
1210 <entry><type>character_data</type></entry>
1211 <entry>
1212 <literal>YES</literal> if the column is updatable,
1213 <literal>NO</literal> if not (Columns in base tables are always
1214 updatable, columns in views not necessarily)
1215 </entry>
1216 </row>
1217 </tbody>
1218 </tgroup>
1219 </table>
1221 <para>
1222 Since data types can be defined in a variety of ways in SQL, and
1223 <productname>PostgreSQL</productname> contains additional ways to
1224 define data types, their representation in the information schema
1225 can be somewhat difficult. The column <literal>data_type</literal>
1226 is supposed to identify the underlying built-in type of the column.
1227 In <productname>PostgreSQL</productname>, this means that the type
1228 is defined in the system catalog schema
1229 <literal>pg_catalog</literal>. This column might be useful if the
1230 application can handle the well-known built-in types specially (for
1231 example, format the numeric types differently or use the data in
1232 the precision columns). The columns <literal>udt_name</literal>,
1233 <literal>udt_schema</literal>, and <literal>udt_catalog</literal>
1234 always identify the underlying data type of the column, even if the
1235 column is based on a domain. (Since
1236 <productname>PostgreSQL</productname> treats built-in types like
1237 user-defined types, built-in types appear here as well. This is an
1238 extension of the SQL standard.) These columns should be used if an
1239 application wants to process data differently according to the
1240 type, because in that case it wouldn't matter if the column is
1241 really based on a domain. If the column is based on a domain, the
1242 identity of the domain is stored in the columns
1243 <literal>domain_name</literal>, <literal>domain_schema</literal>,
1244 and <literal>domain_catalog</literal>. If you want to pair up
1245 columns with their associated data types and treat domains as
1246 separate types, you could write <literal>coalesce(domain_name,
1247 udt_name)</literal>, etc.
1248 </para>
1249 </sect1>
1251 <sect1 id="infoschema-constraint-column-usage">
1252 <title><literal>constraint_column_usage</literal></title>
1254 <para>
1255 The view <literal>constraint_column_usage</literal> identifies all
1256 columns in the current database that are used by some constraint.
1257 Only those columns are shown that are contained in a table owned by
1258 a currently enabled role. For a check constraint, this view
1259 identifies the columns that are used in the check expression. For
1260 a foreign key constraint, this view identifies the columns that the
1261 foreign key references. For a unique or primary key constraint,
1262 this view identifies the constrained columns.
1263 </para>
1265 <table>
1266 <title><literal>constraint_column_usage</literal> Columns</title>
1268 <tgroup cols="3">
1269 <thead>
1270 <row>
1271 <entry>Name</entry>
1272 <entry>Data Type</entry>
1273 <entry>Description</entry>
1274 </row>
1275 </thead>
1277 <tbody>
1278 <row>
1279 <entry><literal>table_catalog</literal></entry>
1280 <entry><type>sql_identifier</type></entry>
1281 <entry>
1282 Name of the database that contains the table that contains the
1283 column that is used by some constraint (always the current
1284 database)
1285 </entry>
1286 </row>
1288 <row>
1289 <entry><literal>table_schema</literal></entry>
1290 <entry><type>sql_identifier</type></entry>
1291 <entry>
1292 Name of the schema that contains the table that contains the
1293 column that is used by some constraint
1294 </entry>
1295 </row>
1297 <row>
1298 <entry><literal>table_name</literal></entry>
1299 <entry><type>sql_identifier</type></entry>
1300 <entry>
1301 Name of the table that contains the column that is used by some
1302 constraint
1303 </entry>
1304 </row>
1306 <row>
1307 <entry><literal>column_name</literal></entry>
1308 <entry><type>sql_identifier</type></entry>
1309 <entry>
1310 Name of the column that is used by some constraint
1311 </entry>
1312 </row>
1314 <row>
1315 <entry><literal>constraint_catalog</literal></entry>
1316 <entry><type>sql_identifier</type></entry>
1317 <entry>Name of the database that contains the constraint (always the current database)</entry>
1318 </row>
1320 <row>
1321 <entry><literal>constraint_schema</literal></entry>
1322 <entry><type>sql_identifier</type></entry>
1323 <entry>Name of the schema that contains the constraint</entry>
1324 </row>
1326 <row>
1327 <entry><literal>constraint_name</literal></entry>
1328 <entry><type>sql_identifier</type></entry>
1329 <entry>Name of the constraint</entry>
1330 </row>
1331 </tbody>
1332 </tgroup>
1333 </table>
1334 </sect1>
1336 <sect1 id="infoschema-constraint-table-usage">
1337 <title><literal>constraint_table_usage</literal></title>
1339 <para>
1340 The view <literal>constraint_table_usage</literal> identifies all
1341 tables in the current database that are used by some constraint and
1342 are owned by a currently enabled role. (This is different from the
1343 view <literal>table_constraints</literal>, which identifies all
1344 table constraints along with the table they are defined on.) For a
1345 foreign key constraint, this view identifies the table that the
1346 foreign key references. For a unique or primary key constraint,
1347 this view simply identifies the table the constraint belongs to.
1348 Check constraints and not-null constraints are not included in this
1349 view.
1350 </para>
1352 <table>
1353 <title><literal>constraint_table_usage</literal> Columns</title>
1355 <tgroup cols="3">
1356 <thead>
1357 <row>
1358 <entry>Name</entry>
1359 <entry>Data Type</entry>
1360 <entry>Description</entry>
1361 </row>
1362 </thead>
1364 <tbody>
1365 <row>
1366 <entry><literal>table_catalog</literal></entry>
1367 <entry><type>sql_identifier</type></entry>
1368 <entry>
1369 Name of the database that contains the table that is used by
1370 some constraint (always the current database)
1371 </entry>
1372 </row>
1374 <row>
1375 <entry><literal>table_schema</literal></entry>
1376 <entry><type>sql_identifier</type></entry>
1377 <entry>
1378 Name of the schema that contains the table that is used by some
1379 constraint
1380 </entry>
1381 </row>
1383 <row>
1384 <entry><literal>table_name</literal></entry>
1385 <entry><type>sql_identifier</type></entry>
1386 <entry>Name of the table that is used by some constraint</entry>
1387 </row>
1389 <row>
1390 <entry><literal>constraint_catalog</literal></entry>
1391 <entry><type>sql_identifier</type></entry>
1392 <entry>Name of the database that contains the constraint (always the current database)</entry>
1393 </row>
1395 <row>
1396 <entry><literal>constraint_schema</literal></entry>
1397 <entry><type>sql_identifier</type></entry>
1398 <entry>Name of the schema that contains the constraint</entry>
1399 </row>
1401 <row>
1402 <entry><literal>constraint_name</literal></entry>
1403 <entry><type>sql_identifier</type></entry>
1404 <entry>Name of the constraint</entry>
1405 </row>
1406 </tbody>
1407 </tgroup>
1408 </table>
1409 </sect1>
1411 <sect1 id="infoschema-data-type-privileges">
1412 <title><literal>data_type_privileges</literal></title>
1414 <para>
1415 The view <literal>data_type_privileges</literal> identifies all
1416 data type descriptors that the current user has access to, by way
1417 of being the owner of the described object or having some privilege
1418 for it. A data type descriptor is generated whenever a data type
1419 is used in the definition of a table column, a domain, or a
1420 function (as parameter or return type) and stores some information
1421 about how the data type is used in that instance (for example, the
1422 declared maximum length, if applicable). Each data type
1423 descriptor is assigned an arbitrary identifier that is unique
1424 among the data type descriptor identifiers assigned for one object
1425 (table, domain, function). This view is probably not useful for
1426 applications, but it is used to define some other views in the
1427 information schema.
1428 </para>
1430 <table>
1431 <title><literal>data_type_privileges</literal> Columns</title>
1433 <tgroup cols="3">
1434 <thead>
1435 <row>
1436 <entry>Name</entry>
1437 <entry>Data Type</entry>
1438 <entry>Description</entry>
1439 </row>
1440 </thead>
1442 <tbody>
1443 <row>
1444 <entry><literal>object_catalog</literal></entry>
1445 <entry><type>sql_identifier</type></entry>
1446 <entry>Name of the database that contains the described object (always the current database)</entry>
1447 </row>
1449 <row>
1450 <entry><literal>object_schema</literal></entry>
1451 <entry><type>sql_identifier</type></entry>
1452 <entry>Name of the schema that contains the described object</entry>
1453 </row>
1455 <row>
1456 <entry><literal>object_name</literal></entry>
1457 <entry><type>sql_identifier</type></entry>
1458 <entry>Name of the described object</entry>
1459 </row>
1461 <row>
1462 <entry><literal>object_type</literal></entry>
1463 <entry><type>character_data</type></entry>
1464 <entry>
1465 The type of the described object: one of
1466 <literal>TABLE</literal> (the data type descriptor pertains to
1467 a column of that table), <literal>DOMAIN</literal> (the data
1468 type descriptors pertains to that domain),
1469 <literal>ROUTINE</literal> (the data type descriptor pertains
1470 to a parameter or the return data type of that function).
1471 </entry>
1472 </row>
1474 <row>
1475 <entry><literal>dtd_identifier</literal></entry>
1476 <entry><type>sql_identifier</type></entry>
1477 <entry>
1478 The identifier of the data type descriptor, which is unique
1479 among the data type descriptors for that same object.
1480 </entry>
1481 </row>
1482 </tbody>
1483 </tgroup>
1484 </table>
1485 </sect1>
1487 <sect1 id="infoschema-domain-constraints">
1488 <title><literal>domain_constraints</literal></title>
1490 <para>
1491 The view <literal>domain_constraints</literal> contains all
1492 constraints belonging to domains defined in the current database.
1493 </para>
1495 <table>
1496 <title><literal>domain_constraints</literal> Columns</title>
1498 <tgroup cols="3">
1499 <thead>
1500 <row>
1501 <entry>Name</entry>
1502 <entry>Data Type</entry>
1503 <entry>Description</entry>
1504 </row>
1505 </thead>
1507 <tbody>
1508 <row>
1509 <entry><literal>constraint_catalog</literal></entry>
1510 <entry><type>sql_identifier</type></entry>
1511 <entry>Name of the database that contains the constraint (always the current database)</entry>
1512 </row>
1514 <row>
1515 <entry><literal>constraint_schema</literal></entry>
1516 <entry><type>sql_identifier</type></entry>
1517 <entry>Name of the schema that contains the constraint</entry>
1518 </row>
1520 <row>
1521 <entry><literal>constraint_name</literal></entry>
1522 <entry><type>sql_identifier</type></entry>
1523 <entry>Name of the constraint</entry>
1524 </row>
1526 <row>
1527 <entry><literal>domain_catalog</literal></entry>
1528 <entry><type>sql_identifier</type></entry>
1529 <entry>Name of the database that contains the domain (always the current database)</entry>
1530 </row>
1532 <row>
1533 <entry><literal>domain_schema</literal></entry>
1534 <entry><type>sql_identifier</type></entry>
1535 <entry>Name of the schema that contains the domain</entry>
1536 </row>
1538 <row>
1539 <entry><literal>domain_name</literal></entry>
1540 <entry><type>sql_identifier</type></entry>
1541 <entry>Name of the domain</entry>
1542 </row>
1544 <row>
1545 <entry><literal>is_deferrable</literal></entry>
1546 <entry><type>character_data</type></entry>
1547 <entry><literal>YES</literal> if the constraint is deferrable, <literal>NO</literal> if not</entry>
1548 </row>
1550 <row>
1551 <entry><literal>initially_deferred</literal></entry>
1552 <entry><type>character_data</type></entry>
1553 <entry><literal>YES</literal> if the constraint is deferrable and initially deferred, <literal>NO</literal> if not</entry>
1554 </row>
1555 </tbody>
1556 </tgroup>
1557 </table>
1558 </sect1>
1560 <sect1 id="infoschema-domain-udt-usage">
1561 <title><literal>domain_udt_usage</literal></title>
1563 <para>
1564 The view <literal>domain_udt_usage</literal> identifies all domains
1565 that are based on data types owned by a currently enabled role.
1566 Note that in <productname>PostgreSQL</productname>, built-in data
1567 types behave like user-defined types, so they are included here as
1568 well.
1569 </para>
1571 <table>
1572 <title><literal>domain_udt_usage</literal> Columns</title>
1574 <tgroup cols="3">
1575 <thead>
1576 <row>
1577 <entry>Name</entry>
1578 <entry>Data Type</entry>
1579 <entry>Description</entry>
1580 </row>
1581 </thead>
1583 <tbody>
1584 <row>
1585 <entry><literal>udt_catalog</literal></entry>
1586 <entry><type>sql_identifier</type></entry>
1587 <entry>Name of the database that the domain data type is defined in (always the current database)</entry>
1588 </row>
1590 <row>
1591 <entry><literal>udt_schema</literal></entry>
1592 <entry><type>sql_identifier</type></entry>
1593 <entry>Name of the schema that the domain data type is defined in</entry>
1594 </row>
1596 <row>
1597 <entry><literal>udt_name</literal></entry>
1598 <entry><type>sql_identifier</type></entry>
1599 <entry>Name of the domain data type</entry>
1600 </row>
1602 <row>
1603 <entry><literal>domain_catalog</literal></entry>
1604 <entry><type>sql_identifier</type></entry>
1605 <entry>Name of the database that contains the domain (always the current database)</entry>
1606 </row>
1608 <row>
1609 <entry><literal>domain_schema</literal></entry>
1610 <entry><type>sql_identifier</type></entry>
1611 <entry>Name of the schema that contains the domain</entry>
1612 </row>
1614 <row>
1615 <entry><literal>domain_name</literal></entry>
1616 <entry><type>sql_identifier</type></entry>
1617 <entry>Name of the domain</entry>
1618 </row>
1619 </tbody>
1620 </tgroup>
1621 </table>
1622 </sect1>
1624 <sect1 id="infoschema-domains">
1625 <title><literal>domains</literal></title>
1627 <para>
1628 The view <literal>domains</literal> contains all domains defined in
1629 the current database.
1630 </para>
1632 <table>
1633 <title><literal>domains</literal> Columns</title>
1635 <tgroup cols="3">
1636 <thead>
1637 <row>
1638 <entry>Name</entry>
1639 <entry>Data Type</entry>
1640 <entry>Description</entry>
1641 </row>
1642 </thead>
1644 <tbody>
1645 <row>
1646 <entry><literal>domain_catalog</literal></entry>
1647 <entry><type>sql_identifier</type></entry>
1648 <entry>Name of the database that contains the domain (always the current database)</entry>
1649 </row>
1651 <row>
1652 <entry><literal>domain_schema</literal></entry>
1653 <entry><type>sql_identifier</type></entry>
1654 <entry>Name of the schema that contains the domain</entry>
1655 </row>
1657 <row>
1658 <entry><literal>domain_name</literal></entry>
1659 <entry><type>sql_identifier</type></entry>
1660 <entry>Name of the domain</entry>
1661 </row>
1663 <row>
1664 <entry><literal>data_type</literal></entry>
1665 <entry><type>character_data</type></entry>
1666 <entry>
1667 Data type of the domain, if it is a built-in type, or
1668 <literal>ARRAY</literal> if it is some array (in that case, see
1669 the view <literal>element_types</literal>), else
1670 <literal>USER-DEFINED</literal> (in that case, the type is
1671 identified in <literal>udt_name</literal> and associated
1672 columns).
1673 </entry>
1674 </row>
1676 <row>
1677 <entry><literal>character_maximum_length</literal></entry>
1678 <entry><type>cardinal_number</type></entry>
1679 <entry>
1680 If the domain has a character or bit string type, the declared
1681 maximum length; null for all other data types or if no maximum
1682 length was declared.
1683 </entry>
1684 </row>
1686 <row>
1687 <entry><literal>character_octet_length</literal></entry>
1688 <entry><type>cardinal_number</type></entry>
1689 <entry>
1690 If the domain has a character type, the maximum possible length
1691 in octets (bytes) of a datum (this should not be of concern to
1692 <productname>PostgreSQL</productname> users); null for all
1693 other data types.
1694 </entry>
1695 </row>
1697 <row>
1698 <entry><literal>character_set_catalog</literal></entry>
1699 <entry><type>sql_identifier</type></entry>
1700 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1701 </row>
1703 <row>
1704 <entry><literal>character_set_schema</literal></entry>
1705 <entry><type>sql_identifier</type></entry>
1706 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1707 </row>
1709 <row>
1710 <entry><literal>character_set_name</literal></entry>
1711 <entry><type>sql_identifier</type></entry>
1712 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1713 </row>
1715 <row>
1716 <entry><literal>collation_catalog</literal></entry>
1717 <entry><type>sql_identifier</type></entry>
1718 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1719 </row>
1721 <row>
1722 <entry><literal>collation_schema</literal></entry>
1723 <entry><type>sql_identifier</type></entry>
1724 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1725 </row>
1727 <row>
1728 <entry><literal>collation_name</literal></entry>
1729 <entry><type>sql_identifier</type></entry>
1730 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1731 </row>
1733 <row>
1734 <entry><literal>numeric_precision</literal></entry>
1735 <entry><type>cardinal_number</type></entry>
1736 <entry>
1737 If the domain has a numeric type, this column contains the
1738 (declared or implicit) precision of the type for this domain.
1739 The precision indicates the number of significant digits. It
1740 can be expressed in decimal (base 10) or binary (base 2) terms,
1741 as specified in the column
1742 <literal>numeric_precision_radix</literal>. For all other data
1743 types, this column is null.
1744 </entry>
1745 </row>
1747 <row>
1748 <entry><literal>numeric_precision_radix</literal></entry>
1749 <entry><type>cardinal_number</type></entry>
1750 <entry>
1751 If the domain has a numeric type, this column indicates in
1752 which base the values in the columns
1753 <literal>numeric_precision</literal> and
1754 <literal>numeric_scale</literal> are expressed. The value is
1755 either 2 or 10. For all other data types, this column is null.
1756 </entry>
1757 </row>
1759 <row>
1760 <entry><literal>numeric_scale</literal></entry>
1761 <entry><type>cardinal_number</type></entry>
1762 <entry>
1763 If the domain has an exact numeric type, this column contains
1764 the (declared or implicit) scale of the type for this domain.
1765 The scale indicates the number of significant digits to the
1766 right of the decimal point. It can be expressed in decimal
1767 (base 10) or binary (base 2) terms, as specified in the column
1768 <literal>numeric_precision_radix</literal>. For all other data
1769 types, this column is null.
1770 </entry>
1771 </row>
1773 <row>
1774 <entry><literal>datetime_precision</literal></entry>
1775 <entry><type>cardinal_number</type></entry>
1776 <entry>
1777 If <literal>data_type</literal> identifies a date, time,
1778 timestamp, or interval type, this column contains the (declared
1779 or implicit) fractional seconds precision of the type for this
1780 domain, that is, the number of decimal digits maintained
1781 following the decimal point in the seconds value. For all
1782 other data types, this column is null.
1783 </entry>
1784 </row>
1786 <row>
1787 <entry><literal>interval_type</literal></entry>
1788 <entry><type>character_data</type></entry>
1789 <entry>Not yet implemented</entry>
1790 </row>
1792 <row>
1793 <entry><literal>interval_precision</literal></entry>
1794 <entry><type>character_data</type></entry>
1795 <entry>Not yet implemented</entry>
1796 </row>
1798 <row>
1799 <entry><literal>domain_default</literal></entry>
1800 <entry><type>character_data</type></entry>
1801 <entry>Default expression of the domain</entry>
1802 </row>
1804 <row>
1805 <entry><literal>udt_catalog</literal></entry>
1806 <entry><type>sql_identifier</type></entry>
1807 <entry>Name of the database that the domain data type is defined in (always the current database)</entry>
1808 </row>
1810 <row>
1811 <entry><literal>udt_schema</literal></entry>
1812 <entry><type>sql_identifier</type></entry>
1813 <entry>Name of the schema that the domain data type is defined in</entry>
1814 </row>
1816 <row>
1817 <entry><literal>udt_name</literal></entry>
1818 <entry><type>sql_identifier</type></entry>
1819 <entry>Name of the domain data type</entry>
1820 </row>
1822 <row>
1823 <entry><literal>scope_catalog</literal></entry>
1824 <entry><type>sql_identifier</type></entry>
1825 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1826 </row>
1828 <row>
1829 <entry><literal>scope_schema</literal></entry>
1830 <entry><type>sql_identifier</type></entry>
1831 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1832 </row>
1834 <row>
1835 <entry><literal>scope_name</literal></entry>
1836 <entry><type>sql_identifier</type></entry>
1837 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1838 </row>
1840 <row>
1841 <entry><literal>maximum_cardinality</literal></entry>
1842 <entry><type>cardinal_number</type></entry>
1843 <entry>Always null, because arrays always have unlimited maximum cardinality in <productname>PostgreSQL</></entry>
1844 </row>
1846 <row>
1847 <entry><literal>dtd_identifier</literal></entry>
1848 <entry><type>sql_identifier</type></entry>
1849 <entry>
1850 An identifier of the data type descriptor of the domain, unique
1851 among the data type descriptors pertaining to the domain (which
1852 is trivial, because a domain only contains one data type
1853 descriptor). This is mainly useful for joining with other
1854 instances of such identifiers. (The specific format of the
1855 identifier is not defined and not guaranteed to remain the same
1856 in future versions.)
1857 </entry>
1858 </row>
1859 </tbody>
1860 </tgroup>
1861 </table>
1862 </sect1>
1864 <sect1 id="infoschema-element-types">
1865 <title><literal>element_types</literal></title>
1867 <para>
1868 The view <literal>element_types</literal> contains the data type
1869 descriptors of the elements of arrays. When a table column,
1870 domain, function parameter, or function return value is defined to
1871 be of an array type, the respective information schema view only
1872 contains <literal>ARRAY</literal> in the column
1873 <literal>data_type</literal>. To obtain information on the element
1874 type of the array, you can join the respective view with this view.
1875 For example, to show the columns of a table with data types and
1876 array element types, if applicable, you could do:
1877 <programlisting>
1878 SELECT c.column_name, c.data_type, e.data_type AS element_type
1879 FROM information_schema.columns c LEFT JOIN information_schema.element_types e
1880 ON ((c.table_catalog, c.table_schema, c.table_name, 'TABLE', c.dtd_identifier)
1881 = (e.object_catalog, e.object_schema, e.object_name, e.object_type, e.dtd_identifier))
1882 WHERE c.table_schema = '...' AND c.table_name = '...'
1883 ORDER BY c.ordinal_position;
1884 </programlisting>
1885 This view only includes objects that the current user has access
1886 to, by way of being the owner or having some privilege.
1887 </para>
1889 <table>
1890 <title><literal>element_types</literal> Columns</title>
1892 <tgroup cols="3">
1893 <thead>
1894 <row>
1895 <entry>Name</entry>
1896 <entry>Data Type</entry>
1897 <entry>Description</entry>
1898 </row>
1899 </thead>
1901 <tbody>
1902 <row>
1903 <entry><literal>object_catalog</literal></entry>
1904 <entry><type>sql_identifier</type></entry>
1905 <entry>
1906 Name of the database that contains the object that uses the
1907 array being described (always the current database)
1908 </entry>
1909 </row>
1911 <row>
1912 <entry><literal>object_schema</literal></entry>
1913 <entry><type>sql_identifier</type></entry>
1914 <entry>
1915 Name of the schema that contains the object that uses the array
1916 being described
1917 </entry>
1918 </row>
1920 <row>
1921 <entry><literal>object_name</literal></entry>
1922 <entry><type>sql_identifier</type></entry>
1923 <entry>
1924 Name of the object that uses the array being described
1925 </entry>
1926 </row>
1928 <row>
1929 <entry><literal>object_type</literal></entry>
1930 <entry><type>character_data</type></entry>
1931 <entry>
1932 The type of the object that uses the array being described: one
1933 of <literal>TABLE</literal> (the array is used by a column of
1934 that table), <literal>DOMAIN</literal> (the array is used by
1935 that domain), <literal>ROUTINE</literal> (the array is used by
1936 a parameter or the return data type of that function).
1937 </entry>
1938 </row>
1940 <row>
1941 <entry><literal>dtd_identifier</literal></entry>
1942 <entry><type>sql_identifier</type></entry>
1943 <entry>
1944 The identifier of the data type descriptor of the array being
1945 described
1946 </entry>
1947 </row>
1949 <row>
1950 <entry><literal>data_type</literal></entry>
1951 <entry><type>character_data</type></entry>
1952 <entry>
1953 Data type of the array elements, if it is a built-in type, else
1954 <literal>USER-DEFINED</literal> (in that case, the type is
1955 identified in <literal>udt_name</literal> and associated
1956 columns).
1957 </entry>
1958 </row>
1960 <row>
1961 <entry><literal>character_maximum_length</literal></entry>
1962 <entry><type>cardinal_number</type></entry>
1963 <entry>Always null, since this information is not applied to array element data types in <productname>PostgreSQL</></entry>
1964 </row>
1966 <row>
1967 <entry><literal>character_octet_length</literal></entry>
1968 <entry><type>cardinal_number</type></entry>
1969 <entry>Always null, since this information is not applied to array element data types in <productname>PostgreSQL</></entry>
1970 </row>
1972 <row>
1973 <entry><literal>character_set_catalog</literal></entry>
1974 <entry><type>sql_identifier</type></entry>
1975 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1976 </row>
1978 <row>
1979 <entry><literal>character_set_schema</literal></entry>
1980 <entry><type>sql_identifier</type></entry>
1981 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1982 </row>
1984 <row>
1985 <entry><literal>character_set_name</literal></entry>
1986 <entry><type>sql_identifier</type></entry>
1987 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1988 </row>
1990 <row>
1991 <entry><literal>collation_catalog</literal></entry>
1992 <entry><type>sql_identifier</type></entry>
1993 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1994 </row>
1996 <row>
1997 <entry><literal>collation_schema</literal></entry>
1998 <entry><type>sql_identifier</type></entry>
1999 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2000 </row>
2002 <row>
2003 <entry><literal>collation_name</literal></entry>
2004 <entry><type>sql_identifier</type></entry>
2005 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2006 </row>
2008 <row>
2009 <entry><literal>numeric_precision</literal></entry>
2010 <entry><type>cardinal_number</type></entry>
2011 <entry>Always null, since this information is not applied to array element data types in <productname>PostgreSQL</></entry>
2012 </row>
2014 <row>
2015 <entry><literal>numeric_precision_radix</literal></entry>
2016 <entry><type>cardinal_number</type></entry>
2017 <entry>Always null, since this information is not applied to array element data types in <productname>PostgreSQL</></entry>
2018 </row>
2020 <row>
2021 <entry><literal>numeric_scale</literal></entry>
2022 <entry><type>cardinal_number</type></entry>
2023 <entry>Always null, since this information is not applied to array element data types in <productname>PostgreSQL</></entry>
2024 </row>
2026 <row>
2027 <entry><literal>datetime_precision</literal></entry>
2028 <entry><type>cardinal_number</type></entry>
2029 <entry>Always null, since this information is not applied to array element data types in <productname>PostgreSQL</></entry>
2030 </row>
2032 <row>
2033 <entry><literal>interval_type</literal></entry>
2034 <entry><type>character_data</type></entry>
2035 <entry>Always null, since this information is not applied to array element data types in <productname>PostgreSQL</></entry>
2036 </row>
2038 <row>
2039 <entry><literal>interval_precision</literal></entry>
2040 <entry><type>character_data</type></entry>
2041 <entry>Always null, since this information is not applied to array element data types in <productname>PostgreSQL</></entry>
2042 </row>
2044 <row>
2045 <entry><literal>domain_default</literal></entry>
2046 <entry><type>character_data</type></entry>
2047 <entry>Not yet implemented</entry>
2048 </row>
2050 <row>
2051 <entry><literal>udt_catalog</literal></entry>
2052 <entry><type>sql_identifier</type></entry>
2053 <entry>
2054 Name of the database that the data type of the elements is
2055 defined in (always the current database)
2056 </entry>
2057 </row>
2059 <row>
2060 <entry><literal>udt_schema</literal></entry>
2061 <entry><type>sql_identifier</type></entry>
2062 <entry>
2063 Name of the schema that the data type of the elements is
2064 defined in
2065 </entry>
2066 </row>
2068 <row>
2069 <entry><literal>udt_name</literal></entry>
2070 <entry><type>sql_identifier</type></entry>
2071 <entry>
2072 Name of the data type of the elements
2073 </entry>
2074 </row>
2076 <row>
2077 <entry><literal>scope_catalog</literal></entry>
2078 <entry><type>sql_identifier</type></entry>
2079 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2080 </row>
2082 <row>
2083 <entry><literal>scope_schema</literal></entry>
2084 <entry><type>sql_identifier</type></entry>
2085 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2086 </row>
2088 <row>
2089 <entry><literal>scope_name</literal></entry>
2090 <entry><type>sql_identifier</type></entry>
2091 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2092 </row>
2094 <row>
2095 <entry><literal>maximum_cardinality</literal></entry>
2096 <entry><type>cardinal_number</type></entry>
2097 <entry>Always null, because arrays always have unlimited maximum cardinality in <productname>PostgreSQL</></entry>
2098 </row>
2100 </tbody>
2101 </tgroup>
2102 </table>
2103 </sect1>
2105 <sect1 id="infoschema-enabled-roles">
2106 <title><literal>enabled_roles</literal></title>
2108 <para>
2109 The view <literal>enabled_roles</literal> identifies the currently
2110 <quote>enabled roles</quote>. The enabled roles are recursively
2111 defined as the current user together with all roles that have been
2112 granted to the enabled roles with automatic inheritance. In other
2113 words, these are all roles that the current user has direct or
2114 indirect, automatically inheriting membership in.
2115 <indexterm><primary>enabled role</primary></indexterm>
2116 <indexterm><primary>role</primary><secondary>enabled</secondary></indexterm>
2117 </para>
2119 <para>
2120 For permission checking, the set of <quote>applicable roles</quote>
2121 is applied, which can be broader than the set of enabled roles. So
2122 generally, it is better to use the view
2123 <literal>applicable_roles</literal> instead of this one; see also
2124 there.
2125 </para>
2127 <table>
2128 <title><literal>enabled_roles</literal> Columns</title>
2130 <tgroup cols="3">
2131 <thead>
2132 <row>
2133 <entry>Name</entry>
2134 <entry>Data Type</entry>
2135 <entry>Description</entry>
2136 </row>
2137 </thead>
2139 <tbody>
2140 <row>
2141 <entry><literal>role_name</literal></entry>
2142 <entry><type>sql_identifier</type></entry>
2143 <entry>Name of a role</entry>
2144 </row>
2145 </tbody>
2146 </tgroup>
2147 </table>
2148 </sect1>
2150 <sect1 id="infoschema-foreign-data-wrapper-options">
2151 <title><literal>foreign_data_wrapper_options</literal></title>
2153 <para>
2154 The view <literal>foreign_data_wrapper_options</literal> contains
2155 all the options defined for foreign-data wrappers in the current
2156 database. Only those foreign-data wrappers are shown that the
2157 current user has access to (by way of being the owner or having
2158 some privilege).
2159 </para>
2161 <table>
2162 <title><literal>foreign_data_wrapper_options</literal> Columns</title>
2164 <tgroup cols="3">
2165 <thead>
2166 <row>
2167 <entry>Name</entry>
2168 <entry>Data Type</entry>
2169 <entry>Description</entry>
2170 </row>
2171 </thead>
2173 <tbody>
2174 <row>
2175 <entry><literal>foreign_data_wrapper_catalog</literal></entry>
2176 <entry><type>sql_identifier</type></entry>
2177 <entry>Name of the database that the foreign-data wrapper is defined in (always the current database)</entry>
2178 </row>
2180 <row>
2181 <entry><literal>foreign_data_wrapper_name</literal></entry>
2182 <entry><type>sql_identifier</type></entry>
2183 <entry>Name of the foreign-data wrapper</entry>
2184 </row>
2186 <row>
2187 <entry><literal>option_name</literal></entry>
2188 <entry><type>sql_identifier</type></entry>
2189 <entry>Name of an option</entry>
2190 </row>
2192 <row>
2193 <entry><literal>option_value</literal></entry>
2194 <entry><type>character_data</type></entry>
2195 <entry>Value of the option</entry>
2196 </row>
2197 </tbody>
2198 </tgroup>
2199 </table>
2200 </sect1>
2202 <sect1 id="infoschema-foreign-data-wrappers">
2203 <title><literal>foreign_data_wrappers</literal></title>
2205 <para>
2206 The view <literal>foreign_data_wrappers</literal> contains all
2207 foreign-data wrappers defined in the current database. Only those
2208 foreign-data wrappers are shown that the current user has access to
2209 (by way of being the owner or having some privilege).
2210 </para>
2212 <table>
2213 <title><literal>foreign_data_wrappers</literal> Columns</title>
2215 <tgroup cols="3">
2216 <thead>
2217 <row>
2218 <entry>Name</entry>
2219 <entry>Data Type</entry>
2220 <entry>Description</entry>
2221 </row>
2222 </thead>
2224 <tbody>
2225 <row>
2226 <entry><literal>foreign_data_wrapper_catalog</literal></entry>
2227 <entry><type>sql_identifier</type></entry>
2228 <entry>Name of the database that contains the foreign-data
2229 wrapper (always the current database)</entry>
2230 </row>
2232 <row>
2233 <entry><literal>foreign_data_wrapper_name</literal></entry>
2234 <entry><type>sql_identifier</type></entry>
2235 <entry>Name of the foreign-data wrapper</entry>
2236 </row>
2238 <row>
2239 <entry><literal>authorization_identifier</literal></entry>
2240 <entry><type>sql_identifier</type></entry>
2241 <entry>Name of the owner of the foreign server</entry>
2242 </row>
2244 <row>
2245 <entry><literal>library_name</literal></entry>
2246 <entry><type>character_data</type></entry>
2247 <entry>File name of the library that implementing this foreign-data wrapper</entry>
2248 </row>
2250 <row>
2251 <entry><literal>foreign_data_wrapper_language</literal></entry>
2252 <entry><type>character_data</type></entry>
2253 <entry>Language used to implement this foreign-data wrapper</entry>
2254 </row>
2255 </tbody>
2256 </tgroup>
2257 </table>
2258 </sect1>
2260 <sect1 id="infoschema-foreign-server-options">
2261 <title><literal>foreign_server_options</literal></title>
2263 <para>
2264 The view <literal>foreign_server_options</literal> contains all the
2265 options defined for foreign servers in the current database. Only
2266 those foreign servers are shown that the current user has access to
2267 (by way of being the owner or having some privilege).
2268 </para>
2270 <table>
2271 <title><literal>foreign_server_options</literal> Columns</title>
2273 <tgroup cols="3">
2274 <thead>
2275 <row>
2276 <entry>Name</entry>
2277 <entry>Data Type</entry>
2278 <entry>Description</entry>
2279 </row>
2280 </thead>
2282 <tbody>
2283 <row>
2284 <entry><literal>foreign_server_catalog</literal></entry>
2285 <entry><type>sql_identifier</type></entry>
2286 <entry>Name of the database that the foreign server is defined in (always the current database)</entry>
2287 </row>
2289 <row>
2290 <entry><literal>foreign_server_name</literal></entry>
2291 <entry><type>sql_identifier</type></entry>
2292 <entry>Name of the foreign server</entry>
2293 </row>
2295 <row>
2296 <entry><literal>option_name</literal></entry>
2297 <entry><type>sql_identifier</type></entry>
2298 <entry>Name of an option</entry>
2299 </row>
2301 <row>
2302 <entry><literal>option_value</literal></entry>
2303 <entry><type>character_data</type></entry>
2304 <entry>Value of the option</entry>
2305 </row>
2306 </tbody>
2307 </tgroup>
2308 </table>
2309 </sect1>
2311 <sect1 id="infoschema-foreign-servers">
2312 <title><literal>foreign_servers</literal></title>
2314 <para>
2315 The view <literal>foreign_servers</literal> contains all foreign
2316 servers defined in the current database. Only those foreign
2317 servers are shown that the current user has access to (by way of
2318 being the owner or having some privilege).
2319 </para>
2321 <table>
2322 <title><literal>foreign_servers</literal> Columns</title>
2324 <tgroup cols="3">
2325 <thead>
2326 <row>
2327 <entry>Name</entry>
2328 <entry>Data Type</entry>
2329 <entry>Description</entry>
2330 </row>
2331 </thead>
2333 <tbody>
2334 <row>
2335 <entry><literal>foreign_server_catalog</literal></entry>
2336 <entry><type>sql_identifier</type></entry>
2337 <entry>Name of the database that the foreign server is defined in (always the current database)</entry>
2338 </row>
2340 <row>
2341 <entry><literal>foreign_server_name</literal></entry>
2342 <entry><type>sql_identifier</type></entry>
2343 <entry>Name of the foreign server</entry>
2344 </row>
2346 <row>
2347 <entry><literal>foreign_data_wrapper_catalog</literal></entry>
2348 <entry><type>sql_identifier</type></entry>
2349 <entry>Name of the database that contains the foreign-data
2350 wrapper used by the foreign server (always the current database)</entry>
2351 </row>
2353 <row>
2354 <entry><literal>foreign_data_wrapper_name</literal></entry>
2355 <entry><type>sql_identifier</type></entry>
2356 <entry>Name of the foreign-data wrapper used by the foreign server</entry>
2357 </row>
2359 <row>
2360 <entry><literal>foreign_server_type</literal></entry>
2361 <entry><type>character_data</type></entry>
2362 <entry>Foreign server type information, if specified upon creation</entry>
2363 </row>
2365 <row>
2366 <entry><literal>foreign_server_version</literal></entry>
2367 <entry><type>character_data</type></entry>
2368 <entry>Foreign server version information, if specified upon creation</entry>
2369 </row>
2371 <row>
2372 <entry><literal>authorization_identifier</literal></entry>
2373 <entry><type>sql_identifier</type></entry>
2374 <entry>Name of the owner of the foreign server</entry>
2375 </row>
2376 </tbody>
2377 </tgroup>
2378 </table>
2379 </sect1>
2381 <sect1 id="infoschema-key-column-usage">
2382 <title><literal>key_column_usage</literal></title>
2384 <para>
2385 The view <literal>key_column_usage</literal> identifies all columns
2386 in the current database that are restricted by some unique, primary
2387 key, or foreign key constraint. Check constraints are not included
2388 in this view. Only those columns are shown that the current user
2389 has access to, by way of being the owner or having some privilege.
2390 </para>
2392 <table>
2393 <title><literal>key_column_usage</literal> Columns</title>
2395 <tgroup cols="3">
2396 <thead>
2397 <row>
2398 <entry>Name</entry>
2399 <entry>Data Type</entry>
2400 <entry>Description</entry>
2401 </row>
2402 </thead>
2404 <tbody>
2405 <row>
2406 <entry><literal>constraint_catalog</literal></entry>
2407 <entry><type>sql_identifier</type></entry>
2408 <entry>Name of the database that contains the constraint (always the current database)</entry>
2409 </row>
2411 <row>
2412 <entry><literal>constraint_schema</literal></entry>
2413 <entry><type>sql_identifier</type></entry>
2414 <entry>Name of the schema that contains the constraint</entry>
2415 </row>
2417 <row>
2418 <entry><literal>constraint_name</literal></entry>
2419 <entry><type>sql_identifier</type></entry>
2420 <entry>Name of the constraint</entry>
2421 </row>
2423 <row>
2424 <entry><literal>table_catalog</literal></entry>
2425 <entry><type>sql_identifier</type></entry>
2426 <entry>
2427 Name of the database that contains the table that contains the
2428 column that is restricted by this constraint (always the
2429 current database)
2430 </entry>
2431 </row>
2433 <row>
2434 <entry><literal>table_schema</literal></entry>
2435 <entry><type>sql_identifier</type></entry>
2436 <entry>
2437 Name of the schema that contains the table that contains the
2438 column that is restricted by this constraint
2439 </entry>
2440 </row>
2442 <row>
2443 <entry><literal>table_name</literal></entry>
2444 <entry><type>sql_identifier</type></entry>
2445 <entry>
2446 Name of the table that contains the column that is restricted
2447 by this constraint
2448 </entry>
2449 </row>
2451 <row>
2452 <entry><literal>column_name</literal></entry>
2453 <entry><type>sql_identifier</type></entry>
2454 <entry>
2455 Name of the column that is restricted by this constraint
2456 </entry>
2457 </row>
2459 <row>
2460 <entry><literal>ordinal_position</literal></entry>
2461 <entry><type>cardinal_number</type></entry>
2462 <entry>
2463 Ordinal position of the column within the constraint key (count
2464 starts at 1)
2465 </entry>
2466 </row>
2468 <row>
2469 <entry><literal>position_in_unique_constraint</literal></entry>
2470 <entry><type>cardinal_number</type></entry>
2471 <entry>
2472 For a foreign-key constraint, ordinal position of the referenced
2473 column within its unique constraint (count starts at 1);
2474 otherwise null
2475 </entry>
2476 </row>
2477 </tbody>
2478 </tgroup>
2479 </table>
2480 </sect1>
2482 <sect1 id="infoschema-parameters">
2483 <title><literal>parameters</literal></title>
2485 <para>
2486 The view <literal>parameters</literal> contains information about
2487 the parameters (arguments) of all functions in the current database.
2488 Only those functions are shown that the current user has access to
2489 (by way of being the owner or having some privilege).
2490 </para>
2492 <table>
2493 <title><literal>parameters</literal> Columns</title>
2495 <tgroup cols="3">
2496 <thead>
2497 <row>
2498 <entry>Name</entry>
2499 <entry>Data Type</entry>
2500 <entry>Description</entry>
2501 </row>
2502 </thead>
2504 <tbody>
2505 <row>
2506 <entry><literal>specific_catalog</literal></entry>
2507 <entry><type>sql_identifier</type></entry>
2508 <entry>Name of the database containing the function (always the current database)</entry>
2509 </row>
2511 <row>
2512 <entry><literal>specific_schema</literal></entry>
2513 <entry><type>sql_identifier</type></entry>
2514 <entry>Name of the schema containing the function</entry>
2515 </row>
2517 <row>
2518 <entry><literal>specific_name</literal></entry>
2519 <entry><type>sql_identifier</type></entry>
2520 <entry>
2521 The <quote>specific name</quote> of the function. See <xref
2522 linkend="infoschema-routines"> for more information.
2523 </entry>
2524 </row>
2526 <row>
2527 <entry><literal>ordinal_position</literal></entry>
2528 <entry><type>cardinal_number</type></entry>
2529 <entry>
2530 Ordinal position of the parameter in the argument list of the
2531 function (count starts at 1)
2532 </entry>
2533 </row>
2535 <row>
2536 <entry><literal>parameter_mode</literal></entry>
2537 <entry><type>character_data</type></entry>
2538 <entry>
2539 <literal>IN</literal> for input parameter,
2540 <literal>OUT</literal> for output parameter,
2541 and <literal>INOUT</literal> for input/output parameter.
2542 </entry>
2543 </row>
2545 <row>
2546 <entry><literal>is_result</literal></entry>
2547 <entry><type>character_data</type></entry>
2548 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2549 </row>
2551 <row>
2552 <entry><literal>as_locator</literal></entry>
2553 <entry><type>character_data</type></entry>
2554 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2555 </row>
2557 <row>
2558 <entry><literal>parameter_name</literal></entry>
2559 <entry><type>sql_identifier</type></entry>
2560 <entry>Name of the parameter, or null if the parameter has no name</entry>
2561 </row>
2563 <row>
2564 <entry><literal>data_type</literal></entry>
2565 <entry><type>character_data</type></entry>
2566 <entry>
2567 Data type of the parameter, if it is a built-in type, or
2568 <literal>ARRAY</literal> if it is some array (in that case, see
2569 the view <literal>element_types</literal>), else
2570 <literal>USER-DEFINED</literal> (in that case, the type is
2571 identified in <literal>udt_name</literal> and associated
2572 columns).
2573 </entry>
2574 </row>
2576 <row>
2577 <entry><literal>character_maximum_length</literal></entry>
2578 <entry><type>cardinal_number</type></entry>
2579 <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</></entry>
2580 </row>
2582 <row>
2583 <entry><literal>character_octet_length</literal></entry>
2584 <entry><type>cardinal_number</type></entry>
2585 <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</></entry>
2586 </row>
2588 <row>
2589 <entry><literal>character_set_catalog</literal></entry>
2590 <entry><type>sql_identifier</type></entry>
2591 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2592 </row>
2594 <row>
2595 <entry><literal>character_set_schema</literal></entry>
2596 <entry><type>sql_identifier</type></entry>
2597 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2598 </row>
2600 <row>
2601 <entry><literal>character_set_name</literal></entry>
2602 <entry><type>sql_identifier</type></entry>
2603 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2604 </row>
2606 <row>
2607 <entry><literal>collation_catalog</literal></entry>
2608 <entry><type>sql_identifier</type></entry>
2609 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2610 </row>
2612 <row>
2613 <entry><literal>collation_schema</literal></entry>
2614 <entry><type>sql_identifier</type></entry>
2615 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2616 </row>
2618 <row>
2619 <entry><literal>collation_name</literal></entry>
2620 <entry><type>sql_identifier</type></entry>
2621 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2622 </row>
2624 <row>
2625 <entry><literal>numeric_precision</literal></entry>
2626 <entry><type>cardinal_number</type></entry>
2627 <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</></entry>
2628 </row>
2630 <row>
2631 <entry><literal>numeric_precision_radix</literal></entry>
2632 <entry><type>cardinal_number</type></entry>
2633 <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</></entry>
2634 </row>
2636 <row>
2637 <entry><literal>numeric_scale</literal></entry>
2638 <entry><type>cardinal_number</type></entry>
2639 <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</></entry>
2640 </row>
2642 <row>
2643 <entry><literal>datetime_precision</literal></entry>
2644 <entry><type>cardinal_number</type></entry>
2645 <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</></entry>
2646 </row>
2648 <row>
2649 <entry><literal>interval_type</literal></entry>
2650 <entry><type>character_data</type></entry>
2651 <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</></entry>
2652 </row>
2654 <row>
2655 <entry><literal>interval_precision</literal></entry>
2656 <entry><type>character_data</type></entry>
2657 <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</></entry>
2658 </row>
2660 <row>
2661 <entry><literal>udt_catalog</literal></entry>
2662 <entry><type>sql_identifier</type></entry>
2663 <entry>
2664 Name of the database that the data type of the parameter is
2665 defined in (always the current database)
2666 </entry>
2667 </row>
2669 <row>
2670 <entry><literal>udt_schema</literal></entry>
2671 <entry><type>sql_identifier</type></entry>
2672 <entry>
2673 Name of the schema that the data type of the parameter is
2674 defined in
2675 </entry>
2676 </row>
2678 <row>
2679 <entry><literal>udt_name</literal></entry>
2680 <entry><type>sql_identifier</type></entry>
2681 <entry>
2682 Name of the data type of the parameter
2683 </entry>
2684 </row>
2686 <row>
2687 <entry><literal>scope_catalog</literal></entry>
2688 <entry><type>sql_identifier</type></entry>
2689 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2690 </row>
2692 <row>
2693 <entry><literal>scope_schema</literal></entry>
2694 <entry><type>sql_identifier</type></entry>
2695 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2696 </row>
2698 <row>
2699 <entry><literal>scope_name</literal></entry>
2700 <entry><type>sql_identifier</type></entry>
2701 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2702 </row>
2704 <row>
2705 <entry><literal>maximum_cardinality</literal></entry>
2706 <entry><type>cardinal_number</type></entry>
2707 <entry>Always null, because arrays always have unlimited maximum cardinality in <productname>PostgreSQL</></entry>
2708 </row>
2710 <row>
2711 <entry><literal>dtd_identifier</literal></entry>
2712 <entry><type>sql_identifier</type></entry>
2713 <entry>
2714 An identifier of the data type descriptor of the parameter,
2715 unique among the data type descriptors pertaining to the
2716 function. This is mainly useful for joining with other
2717 instances of such identifiers. (The specific format of the
2718 identifier is not defined and not guaranteed to remain the same
2719 in future versions.)
2720 </entry>
2721 </row>
2722 </tbody>
2723 </tgroup>
2724 </table>
2725 </sect1>
2727 <sect1 id="infoschema-referential-constraints">
2728 <title><literal>referential_constraints</literal></title>
2730 <para>
2731 The view <literal>referential_constraints</literal> contains all
2732 referential (foreign key) constraints in the current database.
2733 Only those constraints are shown for which the current user has
2734 write access to the referencing table (by way of being the
2735 owner or having some privilege other than SELECT).
2736 </para>
2738 <table>
2739 <title><literal>referential_constraints</literal> Columns</title>
2741 <tgroup cols="3">
2742 <thead>
2743 <row>
2744 <entry>Name</entry>
2745 <entry>Data Type</entry>
2746 <entry>Description</entry>
2747 </row>
2748 </thead>
2750 <tbody>
2751 <row>
2752 <entry><literal>constraint_catalog</literal></entry>
2753 <entry><literal>sql_identifier</literal></entry>
2754 <entry>Name of the database containing the constraint (always the current database)</entry>
2755 </row>
2757 <row>
2758 <entry><literal>constraint_schema</literal></entry>
2759 <entry><literal>sql_identifier</literal></entry>
2760 <entry>Name of the schema containing the constraint</entry>
2761 </row>
2763 <row>
2764 <entry><literal>constraint_name</literal></entry>
2765 <entry><literal>sql_identifier</literal></entry>
2766 <entry>Name of the constraint</entry>
2767 </row>
2769 <row>
2770 <entry><literal>unique_constraint_catalog</literal></entry>
2771 <entry><literal>sql_identifier</literal></entry>
2772 <entry>
2773 Name of the database that contains the unique or primary key
2774 constraint that the foreign key constraint references (always
2775 the current database)
2776 </entry>
2777 </row>
2779 <row>
2780 <entry><literal>unique_constraint_schema</literal></entry>
2781 <entry><literal>sql_identifier</literal></entry>
2782 <entry>
2783 Name of the schema that contains the unique or primary key
2784 constraint that the foreign key constraint references
2785 </entry>
2786 </row>
2788 <row>
2789 <entry><literal>unique_constraint_name</literal></entry>
2790 <entry><literal>sql_identifier</literal></entry>
2791 <entry>
2792 Name of the unique or primary key constraint that the foreign
2793 key constraint references
2794 </entry>
2795 </row>
2797 <row>
2798 <entry><literal>match_option</literal></entry>
2799 <entry><literal>character_data</literal></entry>
2800 <entry>
2801 Match option of the foreign key constraint:
2802 <literal>FULL</literal>, <literal>PARTIAL</literal>, or
2803 <literal>NONE</literal>.
2804 </entry>
2805 </row>
2807 <row>
2808 <entry><literal>update_rule</literal></entry>
2809 <entry><literal>character_data</literal></entry>
2810 <entry>
2811 Update rule of the foreign key constraint:
2812 <literal>CASCADE</literal>, <literal>SET NULL</literal>,
2813 <literal>SET DEFAULT</literal>, <literal>RESTRICT</literal>, or
2814 <literal>NO ACTION</literal>.
2815 </entry>
2816 </row>
2818 <row>
2819 <entry><literal>delete_rule</literal></entry>
2820 <entry><literal>character_data</literal></entry>
2821 <entry>
2822 Delete rule of the foreign key constraint:
2823 <literal>CASCADE</literal>, <literal>SET NULL</literal>,
2824 <literal>SET DEFAULT</literal>, <literal>RESTRICT</literal>, or
2825 <literal>NO ACTION</literal>.
2826 </entry>
2827 </row>
2828 </tbody>
2829 </tgroup>
2830 </table>
2831 </sect1>
2833 <sect1 id="infoschema-role-column-grants">
2834 <title><literal>role_column_grants</literal></title>
2836 <para>
2837 The view <literal>role_column_grants</literal> identifies all
2838 privileges granted on columns where the grantor or grantee is a
2839 currently enabled role. Further information can be found under
2840 <literal>column_privileges</literal>.
2841 </para>
2843 <table>
2844 <title><literal>role_column_grants</literal> Columns</title>
2846 <tgroup cols="3">
2847 <thead>
2848 <row>
2849 <entry>Name</entry>
2850 <entry>Data Type</entry>
2851 <entry>Description</entry>
2852 </row>
2853 </thead>
2855 <tbody>
2856 <row>
2857 <entry><literal>grantor</literal></entry>
2858 <entry><type>sql_identifier</type></entry>
2859 <entry>Name of the role that granted the privilege</entry>
2860 </row>
2862 <row>
2863 <entry><literal>grantee</literal></entry>
2864 <entry><type>sql_identifier</type></entry>
2865 <entry>Name of the role that the privilege was granted to</entry>
2866 </row>
2868 <row>
2869 <entry><literal>table_catalog</literal></entry>
2870 <entry><type>sql_identifier</type></entry>
2871 <entry>Name of the database that contains the table that contains the column (always the current database)</entry>
2872 </row>
2874 <row>
2875 <entry><literal>table_schema</literal></entry>
2876 <entry><type>sql_identifier</type></entry>
2877 <entry>Name of the schema that contains the table that contains the column</entry>
2878 </row>
2880 <row>
2881 <entry><literal>table_name</literal></entry>
2882 <entry><type>sql_identifier</type></entry>
2883 <entry>Name of the table that contains the column</entry>
2884 </row>
2886 <row>
2887 <entry><literal>column_name</literal></entry>
2888 <entry><type>sql_identifier</type></entry>
2889 <entry>Name of the column</entry>
2890 </row>
2892 <row>
2893 <entry><literal>privilege_type</literal></entry>
2894 <entry><type>character_data</type></entry>
2895 <entry>
2896 Type of the privilege: <literal>SELECT</literal>,
2897 <literal>INSERT</literal>, <literal>UPDATE</literal>, or
2898 <literal>REFERENCES</literal>
2899 </entry>
2900 </row>
2902 <row>
2903 <entry><literal>is_grantable</literal></entry>
2904 <entry><type>character_data</type></entry>
2905 <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
2906 </row>
2907 </tbody>
2908 </tgroup>
2909 </table>
2910 </sect1>
2912 <sect1 id="infoschema-role-routine-grants">
2913 <title><literal>role_routine_grants</literal></title>
2915 <para>
2916 The view <literal>role_routine_grants</literal> identifies all
2917 privileges granted on functions where the grantor or grantee is a
2918 currently enabled role. Further information can be found under
2919 <literal>routine_privileges</literal>.
2920 </para>
2922 <table>
2923 <title><literal>role_routine_grants</literal> Columns</title>
2925 <tgroup cols="3">
2926 <thead>
2927 <row>
2928 <entry>Name</entry>
2929 <entry>Data Type</entry>
2930 <entry>Description</entry>
2931 </row>
2932 </thead>
2934 <tbody>
2935 <row>
2936 <entry><literal>grantor</literal></entry>
2937 <entry><type>sql_identifier</type></entry>
2938 <entry>Name of the role that granted the privilege</entry>
2939 </row>
2941 <row>
2942 <entry><literal>grantee</literal></entry>
2943 <entry><type>sql_identifier</type></entry>
2944 <entry>Name of the role that the privilege was granted to</entry>
2945 </row>
2947 <row>
2948 <entry><literal>specific_catalog</literal></entry>
2949 <entry><type>sql_identifier</type></entry>
2950 <entry>Name of the database containing the function (always the current database)</entry>
2951 </row>
2953 <row>
2954 <entry><literal>specific_schema</literal></entry>
2955 <entry><type>sql_identifier</type></entry>
2956 <entry>Name of the schema containing the function</entry>
2957 </row>
2959 <row>
2960 <entry><literal>specific_name</literal></entry>
2961 <entry><type>sql_identifier</type></entry>
2962 <entry>
2963 The <quote>specific name</quote> of the function. See <xref
2964 linkend="infoschema-routines"> for more information.
2965 </entry>
2966 </row>
2968 <row>
2969 <entry><literal>routine_catalog</literal></entry>
2970 <entry><type>sql_identifier</type></entry>
2971 <entry>Name of the database containing the function (always the current database)</entry>
2972 </row>
2974 <row>
2975 <entry><literal>routine_schema</literal></entry>
2976 <entry><type>sql_identifier</type></entry>
2977 <entry>Name of the schema containing the function</entry>
2978 </row>
2980 <row>
2981 <entry><literal>routine_name</literal></entry>
2982 <entry><type>sql_identifier</type></entry>
2983 <entry>Name of the function (might be duplicated in case of overloading)</entry>
2984 </row>
2986 <row>
2987 <entry><literal>privilege_type</literal></entry>
2988 <entry><type>character_data</type></entry>
2989 <entry>Always <literal>EXECUTE</literal> (the only privilege type for functions)</entry>
2990 </row>
2992 <row>
2993 <entry><literal>is_grantable</literal></entry>
2994 <entry><type>character_data</type></entry>
2995 <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
2996 </row>
2997 </tbody>
2998 </tgroup>
2999 </table>
3000 </sect1>
3002 <sect1 id="infoschema-role-table-grants">
3003 <title><literal>role_table_grants</literal></title>
3005 <para>
3006 The view <literal>role_table_grants</literal> identifies all
3007 privileges granted on tables or views where the grantor or grantee
3008 is a currently enabled role. Further information can be found
3009 under <literal>table_privileges</literal>.
3010 </para>
3012 <table>
3013 <title><literal>role_table_grants</literal> Columns</title>
3015 <tgroup cols="3">
3016 <thead>
3017 <row>
3018 <entry>Name</entry>
3019 <entry>Data Type</entry>
3020 <entry>Description</entry>
3021 </row>
3022 </thead>
3024 <tbody>
3025 <row>
3026 <entry><literal>grantor</literal></entry>
3027 <entry><type>sql_identifier</type></entry>
3028 <entry>Name of the role that granted the privilege</entry>
3029 </row>
3031 <row>
3032 <entry><literal>grantee</literal></entry>
3033 <entry><type>sql_identifier</type></entry>
3034 <entry>Name of the role that the privilege was granted to</entry>
3035 </row>
3037 <row>
3038 <entry><literal>table_catalog</literal></entry>
3039 <entry><type>sql_identifier</type></entry>
3040 <entry>Name of the database that contains the table (always the current database)</entry>
3041 </row>
3043 <row>
3044 <entry><literal>table_schema</literal></entry>
3045 <entry><type>sql_identifier</type></entry>
3046 <entry>Name of the schema that contains the table</entry>
3047 </row>
3049 <row>
3050 <entry><literal>table_name</literal></entry>
3051 <entry><type>sql_identifier</type></entry>
3052 <entry>Name of the table</entry>
3053 </row>
3055 <row>
3056 <entry><literal>privilege_type</literal></entry>
3057 <entry><type>character_data</type></entry>
3058 <entry>
3059 Type of the privilege: <literal>SELECT</literal>,
3060 <literal>INSERT</literal>, <literal>UPDATE</literal>,
3061 <literal>DELETE</literal>, <literal>TRUNCATE</literal>,
3062 <literal>REFERENCES</literal>, or <literal>TRIGGER</literal>
3063 </entry>
3064 </row>
3066 <row>
3067 <entry><literal>is_grantable</literal></entry>
3068 <entry><type>character_data</type></entry>
3069 <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
3070 </row>
3072 <row>
3073 <entry><literal>with_hierarchy</literal></entry>
3074 <entry><type>character_data</type></entry>
3075 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3076 </row>
3077 </tbody>
3078 </tgroup>
3079 </table>
3080 </sect1>
3082 <sect1 id="infoschema-role-usage-grants">
3083 <title><literal>role_usage_grants</literal></title>
3085 <para>
3086 The view <literal>role_usage_grants</literal> identifies
3087 <literal>USAGE</literal> privileges granted on various kinds of
3088 objects where the grantor or grantee is a currently enabled role.
3089 Further information can be found under
3090 <literal>usage_privileges</literal>.
3091 </para>
3093 <table>
3094 <title><literal>role_usage_grants</literal> Columns</title>
3096 <tgroup cols="3">
3097 <thead>
3098 <row>
3099 <entry>Name</entry>
3100 <entry>Data Type</entry>
3101 <entry>Description</entry>
3102 </row>
3103 </thead>
3105 <tbody>
3106 <row>
3107 <entry><literal>grantor</literal></entry>
3108 <entry><type>sql_identifier</type></entry>
3109 <entry>The name of the role that granted the privilege</entry>
3110 </row>
3112 <row>
3113 <entry><literal>grantee</literal></entry>
3114 <entry><type>sql_identifier</type></entry>
3115 <entry>The name of the role that the privilege was granted to</entry>
3116 </row>
3118 <row>
3119 <entry><literal>object_catalog</literal></entry>
3120 <entry><type>sql_identifier</type></entry>
3121 <entry>Name of the database containing the object (always the current database)</entry>
3122 </row>
3124 <row>
3125 <entry><literal>object_schema</literal></entry>
3126 <entry><type>sql_identifier</type></entry>
3127 <entry>Name of the schema containing the object, if applicable,
3128 else an empty string</entry>
3129 </row>
3131 <row>
3132 <entry><literal>object_name</literal></entry>
3133 <entry><type>sql_identifier</type></entry>
3134 <entry>Name of the object</entry>
3135 </row>
3137 <row>
3138 <entry><literal>object_type</literal></entry>
3139 <entry><type>character_data</type></entry>
3140 <entry><literal>DOMAIN</literal> or <literal>FOREIGN DATA WRAPPER</literal> or <literal>FOREIGN SERVER</literal></entry>
3141 </row>
3143 <row>
3144 <entry><literal>privilege_type</literal></entry>
3145 <entry><type>character_data</type></entry>
3146 <entry>Always <literal>USAGE</literal></entry>
3147 </row>
3149 <row>
3150 <entry><literal>is_grantable</literal></entry>
3151 <entry><type>character_data</type></entry>
3152 <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
3153 </row>
3154 </tbody>
3155 </tgroup>
3156 </table>
3157 </sect1>
3159 <sect1 id="infoschema-routine-privileges">
3160 <title><literal>routine_privileges</literal></title>
3162 <para>
3163 The view <literal>routine_privileges</literal> identifies all
3164 privileges granted on functions to a currently enabled role or by a
3165 currently enabled role. There is one row for each combination of function,
3166 grantor, and grantee.
3167 </para>
3169 <table>
3170 <title><literal>routine_privileges</literal> Columns</title>
3172 <tgroup cols="3">
3173 <thead>
3174 <row>
3175 <entry>Name</entry>
3176 <entry>Data Type</entry>
3177 <entry>Description</entry>
3178 </row>
3179 </thead>
3181 <tbody>
3182 <row>
3183 <entry><literal>grantor</literal></entry>
3184 <entry><type>sql_identifier</type></entry>
3185 <entry>Name of the role that granted the privilege</entry>
3186 </row>
3188 <row>
3189 <entry><literal>grantee</literal></entry>
3190 <entry><type>sql_identifier</type></entry>
3191 <entry>Name of the role that the privilege was granted to</entry>
3192 </row>
3194 <row>
3195 <entry><literal>specific_catalog</literal></entry>
3196 <entry><type>sql_identifier</type></entry>
3197 <entry>Name of the database containing the function (always the current database)</entry>
3198 </row>
3200 <row>
3201 <entry><literal>specific_schema</literal></entry>
3202 <entry><type>sql_identifier</type></entry>
3203 <entry>Name of the schema containing the function</entry>
3204 </row>
3206 <row>
3207 <entry><literal>specific_name</literal></entry>
3208 <entry><type>sql_identifier</type></entry>
3209 <entry>
3210 The <quote>specific name</quote> of the function. See <xref
3211 linkend="infoschema-routines"> for more information.
3212 </entry>
3213 </row>
3215 <row>
3216 <entry><literal>routine_catalog</literal></entry>
3217 <entry><type>sql_identifier</type></entry>
3218 <entry>Name of the database containing the function (always the current database)</entry>
3219 </row>
3221 <row>
3222 <entry><literal>routine_schema</literal></entry>
3223 <entry><type>sql_identifier</type></entry>
3224 <entry>Name of the schema containing the function</entry>
3225 </row>
3227 <row>
3228 <entry><literal>routine_name</literal></entry>
3229 <entry><type>sql_identifier</type></entry>
3230 <entry>Name of the function (might be duplicated in case of overloading)</entry>
3231 </row>
3233 <row>
3234 <entry><literal>privilege_type</literal></entry>
3235 <entry><type>character_data</type></entry>
3236 <entry>Always <literal>EXECUTE</literal> (the only privilege type for functions)</entry>
3237 </row>
3239 <row>
3240 <entry><literal>is_grantable</literal></entry>
3241 <entry><type>character_data</type></entry>
3242 <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
3243 </row>
3244 </tbody>
3245 </tgroup>
3246 </table>
3247 </sect1>
3249 <sect1 id="infoschema-routines">
3250 <title><literal>routines</literal></title>
3252 <para>
3253 The view <literal>routines</literal> contains all functions in the
3254 current database. Only those functions are shown that the current
3255 user has access to (by way of being the owner or having some
3256 privilege).
3257 </para>
3259 <table>
3260 <title><literal>routines</literal> Columns</title>
3262 <tgroup cols="3">
3263 <thead>
3264 <row>
3265 <entry>Name</entry>
3266 <entry>Data Type</entry>
3267 <entry>Description</entry>
3268 </row>
3269 </thead>
3271 <tbody>
3272 <row>
3273 <entry><literal>specific_catalog</literal></entry>
3274 <entry><type>sql_identifier</type></entry>
3275 <entry>Name of the database containing the function (always the current database)</entry>
3276 </row>
3278 <row>
3279 <entry><literal>specific_schema</literal></entry>
3280 <entry><type>sql_identifier</type></entry>
3281 <entry>Name of the schema containing the function</entry>
3282 </row>
3284 <row>
3285 <entry><literal>specific_name</literal></entry>
3286 <entry><type>sql_identifier</type></entry>
3287 <entry>
3288 The <quote>specific name</quote> of the function. This is a
3289 name that uniquely identifies the function in the schema, even
3290 if the real name of the function is overloaded. The format of
3291 the specific name is not defined, it should only be used to
3292 compare it to other instances of specific routine names.
3293 </entry>
3294 </row>
3296 <row>
3297 <entry><literal>routine_catalog</literal></entry>
3298 <entry><type>sql_identifier</type></entry>
3299 <entry>Name of the database containing the function (always the current database)</entry>
3300 </row>
3302 <row>
3303 <entry><literal>routine_schema</literal></entry>
3304 <entry><type>sql_identifier</type></entry>
3305 <entry>Name of the schema containing the function</entry>
3306 </row>
3308 <row>
3309 <entry><literal>routine_name</literal></entry>
3310 <entry><type>sql_identifier</type></entry>
3311 <entry>Name of the function (might be duplicated in case of overloading)</entry>
3312 </row>
3314 <row>
3315 <entry><literal>routine_type</literal></entry>
3316 <entry><type>character_data</type></entry>
3317 <entry>
3318 Always <literal>FUNCTION</literal> (In the future there might
3319 be other types of routines.)
3320 </entry>
3321 </row>
3323 <row>
3324 <entry><literal>module_catalog</literal></entry>
3325 <entry><type>sql_identifier</type></entry>
3326 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3327 </row>
3329 <row>
3330 <entry><literal>module_schema</literal></entry>
3331 <entry><type>sql_identifier</type></entry>
3332 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3333 </row>
3335 <row>
3336 <entry><literal>module_name</literal></entry>
3337 <entry><type>sql_identifier</type></entry>
3338 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3339 </row>
3341 <row>
3342 <entry><literal>udt_catalog</literal></entry>
3343 <entry><type>sql_identifier</type></entry>
3344 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3345 </row>
3347 <row>
3348 <entry><literal>udt_schema</literal></entry>
3349 <entry><type>sql_identifier</type></entry>
3350 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3351 </row>
3353 <row>
3354 <entry><literal>udt_name</literal></entry>
3355 <entry><type>sql_identifier</type></entry>
3356 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3357 </row>
3359 <row>
3360 <entry><literal>data_type</literal></entry>
3361 <entry><type>character_data</type></entry>
3362 <entry>
3363 Return data type of the function, if it is a built-in type, or
3364 <literal>ARRAY</literal> if it is some array (in that case, see
3365 the view <literal>element_types</literal>), else
3366 <literal>USER-DEFINED</literal> (in that case, the type is
3367 identified in <literal>type_udt_name</literal> and associated
3368 columns).
3369 </entry>
3370 </row>
3372 <row>
3373 <entry><literal>character_maximum_length</literal></entry>
3374 <entry><type>cardinal_number</type></entry>
3375 <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
3376 </row>
3378 <row>
3379 <entry><literal>character_octet_length</literal></entry>
3380 <entry><type>cardinal_number</type></entry>
3381 <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
3382 </row>
3384 <row>
3385 <entry><literal>character_set_catalog</literal></entry>
3386 <entry><type>sql_identifier</type></entry>
3387 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3388 </row>
3390 <row>
3391 <entry><literal>character_set_schema</literal></entry>
3392 <entry><type>sql_identifier</type></entry>
3393 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3394 </row>
3396 <row>
3397 <entry><literal>character_set_name</literal></entry>
3398 <entry><type>sql_identifier</type></entry>
3399 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3400 </row>
3402 <row>
3403 <entry><literal>collation_catalog</literal></entry>
3404 <entry><type>sql_identifier</type></entry>
3405 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3406 </row>
3408 <row>
3409 <entry><literal>collation_schema</literal></entry>
3410 <entry><type>sql_identifier</type></entry>
3411 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3412 </row>
3414 <row>
3415 <entry><literal>collation_name</literal></entry>
3416 <entry><type>sql_identifier</type></entry>
3417 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3418 </row>
3420 <row>
3421 <entry><literal>numeric_precision</literal></entry>
3422 <entry><type>cardinal_number</type></entry>
3423 <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
3424 </row>
3426 <row>
3427 <entry><literal>numeric_precision_radix</literal></entry>
3428 <entry><type>cardinal_number</type></entry>
3429 <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
3430 </row>
3432 <row>
3433 <entry><literal>numeric_scale</literal></entry>
3434 <entry><type>cardinal_number</type></entry>
3435 <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
3436 </row>
3438 <row>
3439 <entry><literal>datetime_precision</literal></entry>
3440 <entry><type>cardinal_number</type></entry>
3441 <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
3442 </row>
3444 <row>
3445 <entry><literal>interval_type</literal></entry>
3446 <entry><type>character_data</type></entry>
3447 <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
3448 </row>
3450 <row>
3451 <entry><literal>interval_precision</literal></entry>
3452 <entry><type>character_data</type></entry>
3453 <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
3454 </row>
3456 <row>
3457 <entry><literal>type_udt_catalog</literal></entry>
3458 <entry><type>sql_identifier</type></entry>
3459 <entry>
3460 Name of the database that the return data type of the function
3461 is defined in (always the current database)
3462 </entry>
3463 </row>
3465 <row>
3466 <entry><literal>type_udt_schema</literal></entry>
3467 <entry><type>sql_identifier</type></entry>
3468 <entry>
3469 Name of the schema that the return data type of the function is
3470 defined in
3471 </entry>
3472 </row>
3474 <row>
3475 <entry><literal>type_udt_name</literal></entry>
3476 <entry><type>sql_identifier</type></entry>
3477 <entry>
3478 Name of the return data type of the function
3479 </entry>
3480 </row>
3482 <row>
3483 <entry><literal>scope_catalog</literal></entry>
3484 <entry><type>sql_identifier</type></entry>
3485 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3486 </row>
3488 <row>
3489 <entry><literal>scope_schema</literal></entry>
3490 <entry><type>sql_identifier</type></entry>
3491 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3492 </row>
3494 <row>
3495 <entry><literal>scope_name</literal></entry>
3496 <entry><type>sql_identifier</type></entry>
3497 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3498 </row>
3500 <row>
3501 <entry><literal>maximum_cardinality</literal></entry>
3502 <entry><type>cardinal_number</type></entry>
3503 <entry>Always null, because arrays always have unlimited maximum cardinality in <productname>PostgreSQL</></entry>
3504 </row>
3506 <row>
3507 <entry><literal>dtd_identifier</literal></entry>
3508 <entry><type>sql_identifier</type></entry>
3509 <entry>
3510 An identifier of the data type descriptor of the return data
3511 type of this function, unique among the data type descriptors
3512 pertaining to the function. This is mainly useful for joining
3513 with other instances of such identifiers. (The specific format
3514 of the identifier is not defined and not guaranteed to remain
3515 the same in future versions.)
3516 </entry>
3517 </row>
3519 <row>
3520 <entry><literal>routine_body</literal></entry>
3521 <entry><type>character_data</type></entry>
3522 <entry>
3523 If the function is an SQL function, then
3524 <literal>SQL</literal>, else <literal>EXTERNAL</literal>.
3525 </entry>
3526 </row>
3528 <row>
3529 <entry><literal>routine_definition</literal></entry>
3530 <entry><type>character_data</type></entry>
3531 <entry>
3532 The source text of the function (null if the function is not
3533 owned by a currently enabled role). (According to the SQL
3534 standard, this column is only applicable if
3535 <literal>routine_body</literal> is <literal>SQL</literal>, but
3536 in <productname>PostgreSQL</productname> it will contain
3537 whatever source text was specified when the function was
3538 created.)
3539 </entry>
3540 </row>
3542 <row>
3543 <entry><literal>external_name</literal></entry>
3544 <entry><type>character_data</type></entry>
3545 <entry>
3546 If this function is a C function, then the external name (link
3547 symbol) of the function; else null. (This works out to be the
3548 same value that is shown in
3549 <literal>routine_definition</literal>.)
3550 </entry>
3551 </row>
3553 <row>
3554 <entry><literal>external_language</literal></entry>
3555 <entry><type>character_data</type></entry>
3556 <entry>The language the function is written in</entry>
3557 </row>
3559 <row>
3560 <entry><literal>parameter_style</literal></entry>
3561 <entry><type>character_data</type></entry>
3562 <entry>
3563 Always <literal>GENERAL</literal> (The SQL standard defines
3564 other parameter styles, which are not available in <productname>PostgreSQL</>.)
3565 </entry>
3566 </row>
3568 <row>
3569 <entry><literal>is_deterministic</literal></entry>
3570 <entry><type>character_data</type></entry>
3571 <entry>
3572 If the function is declared immutable (called deterministic in
3573 the SQL standard), then <literal>YES</literal>, else
3574 <literal>NO</literal>. (You cannot query the other volatility
3575 levels available in <productname>PostgreSQL</> through the information schema.)
3576 </entry>
3577 </row>
3579 <row>
3580 <entry><literal>sql_data_access</literal></entry>
3581 <entry><type>character_data</type></entry>
3582 <entry>
3583 Always <literal>MODIFIES</literal>, meaning that the function
3584 possibly modifies SQL data. This information is not useful for
3585 <productname>PostgreSQL</>.
3586 </entry>
3587 </row>
3589 <row>
3590 <entry><literal>is_null_call</literal></entry>
3591 <entry><type>character_data</type></entry>
3592 <entry>
3593 If the function automatically returns null if any of its
3594 arguments are null, then <literal>YES</literal>, else
3595 <literal>NO</literal>.
3596 </entry>
3597 </row>
3599 <row>
3600 <entry><literal>sql_path</literal></entry>
3601 <entry><type>character_data</type></entry>
3602 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3603 </row>
3605 <row>
3606 <entry><literal>schema_level_routine</literal></entry>
3607 <entry><type>character_data</type></entry>
3608 <entry>
3609 Always <literal>YES</literal> (The opposite would be a method
3610 of a user-defined type, which is a feature not available in
3611 <productname>PostgreSQL</>.)
3612 </entry>
3613 </row>
3615 <row>
3616 <entry><literal>max_dynamic_result_sets</literal></entry>
3617 <entry><type>cardinal_number</type></entry>
3618 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3619 </row>
3621 <row>
3622 <entry><literal>is_user_defined_cast</literal></entry>
3623 <entry><type>character_data</type></entry>
3624 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3625 </row>
3627 <row>
3628 <entry><literal>is_implicitly_invocable</literal></entry>
3629 <entry><type>character_data</type></entry>
3630 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3631 </row>
3633 <row>
3634 <entry><literal>security_type</literal></entry>
3635 <entry><type>character_data</type></entry>
3636 <entry>
3637 If the function runs with the privileges of the current user,
3638 then <literal>INVOKER</literal>, if the function runs with the
3639 privileges of the user who defined it, then
3640 <literal>DEFINER</literal>.
3641 </entry>
3642 </row>
3644 <row>
3645 <entry><literal>to_sql_specific_catalog</literal></entry>
3646 <entry><type>sql_identifier</type></entry>
3647 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3648 </row>
3650 <row>
3651 <entry><literal>to_sql_specific_schema</literal></entry>
3652 <entry><type>sql_identifier</type></entry>
3653 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3654 </row>
3656 <row>
3657 <entry><literal>to_sql_specific_name</literal></entry>
3658 <entry><type>sql_identifier</type></entry>
3659 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3660 </row>
3662 <row>
3663 <entry><literal>as_locator</literal></entry>
3664 <entry><type>character_data</type></entry>
3665 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3666 </row>
3668 <row>
3669 <entry><literal>created</literal></entry>
3670 <entry><type>time_stamp</type></entry>
3671 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3672 </row>
3674 <row>
3675 <entry><literal>last_altered</literal></entry>
3676 <entry><type>time_stamp</type></entry>
3677 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3678 </row>
3680 <row>
3681 <entry><literal>new_savepoint_level</literal></entry>
3682 <entry><type>character_data</type></entry>
3683 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3684 </row>
3686 <row>
3687 <entry><literal>is_udt_dependent</literal></entry>
3688 <entry><type>character_data</type></entry>
3689 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3690 </row>
3692 <row>
3693 <entry><literal>result_cast_from_data_type</literal></entry>
3694 <entry><type>character_data</type></entry>
3695 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3696 </row>
3698 <row>
3699 <entry><literal>result_cast_as_locator</literal></entry>
3700 <entry><type>character_data</type></entry>
3701 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3702 </row>
3704 <row>
3705 <entry><literal>result_cast_char_max_length</literal></entry>
3706 <entry><type>cardinal_number</type></entry>
3707 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3708 </row>
3710 <row>
3711 <entry><literal>result_cast_char_octet_length</literal></entry>
3712 <entry><type>character_data</type></entry>
3713 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3714 </row>
3716 <row>
3717 <entry><literal>result_cast_char_set_catalog</literal></entry>
3718 <entry><type>sql_identifier</type></entry>
3719 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3720 </row>
3722 <row>
3723 <entry><literal>result_cast_char_set_schema</literal></entry>
3724 <entry><type>sql_identifier</type></entry>
3725 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3726 </row>
3728 <row>
3729 <entry><literal>result_cast_char_set_name</literal></entry>
3730 <entry><type>sql_identifier</type></entry>
3731 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3732 </row>
3734 <row>
3735 <entry><literal>result_cast_collation_catalog</literal></entry>
3736 <entry><type>sql_identifier</type></entry>
3737 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3738 </row>
3740 <row>
3741 <entry><literal>result_cast_collation_schema</literal></entry>
3742 <entry><type>sql_identifier</type></entry>
3743 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3744 </row>
3746 <row>
3747 <entry><literal>result_cast_collation_name</literal></entry>
3748 <entry><type>sql_identifier</type></entry>
3749 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3750 </row>
3752 <row>
3753 <entry><literal>result_cast_numeric_precision</literal></entry>
3754 <entry><type>cardinal_number</type></entry>
3755 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3756 </row>
3758 <row>
3759 <entry><literal>result_cast_numeric_precision_radix</literal></entry>
3760 <entry><type>cardinal_number</type></entry>
3761 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3762 </row>
3764 <row>
3765 <entry><literal>result_cast_numeric_scale</literal></entry>
3766 <entry><type>cardinal_number</type></entry>
3767 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3768 </row>
3770 <row>
3771 <entry><literal>result_cast_datetime_precision</literal></entry>
3772 <entry><type>character_data</type></entry>
3773 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3774 </row>
3776 <row>
3777 <entry><literal>result_cast_interval_type</literal></entry>
3778 <entry><type>character_data</type></entry>
3779 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3780 </row>
3782 <row>
3783 <entry><literal>result_cast_interval_precision</literal></entry>
3784 <entry><type>character_data</type></entry>
3785 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3786 </row>
3788 <row>
3789 <entry><literal>result_cast_type_udt_catalog</literal></entry>
3790 <entry><type>sql_identifier</type></entry>
3791 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3792 </row>
3794 <row>
3795 <entry><literal>result_cast_type_udt_schema</literal></entry>
3796 <entry><type>sql_identifier</type></entry>
3797 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3798 </row>
3800 <row>
3801 <entry><literal>result_cast_type_udt_name</literal></entry>
3802 <entry><type>sql_identifier</type></entry>
3803 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3804 </row>
3806 <row>
3807 <entry><literal>result_cast_scope_catalog</literal></entry>
3808 <entry><type>sql_identifier</type></entry>
3809 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3810 </row>
3812 <row>
3813 <entry><literal>result_cast_scope_schema</literal></entry>
3814 <entry><type>sql_identifier</type></entry>
3815 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3816 </row>
3818 <row>
3819 <entry><literal>result_cast_scope_name</literal></entry>
3820 <entry><type>sql_identifier</type></entry>
3821 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3822 </row>
3824 <row>
3825 <entry><literal>result_cast_maximum_cardinality</literal></entry>
3826 <entry><type>cardinal_number</type></entry>
3827 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3828 </row>
3830 <row>
3831 <entry><literal>result_cast_dtd_identifier</literal></entry>
3832 <entry><type>sql_identifier</type></entry>
3833 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3834 </row>
3835 </tbody>
3836 </tgroup>
3837 </table>
3838 </sect1>
3840 <sect1 id="infoschema-schemata">
3841 <title><literal>schemata</literal></title>
3843 <para>
3844 The view <literal>schemata</literal> contains all schemas in the
3845 current database that are owned by a currently enabled role.
3846 </para>
3848 <table>
3849 <title><literal>schemata</literal> Columns</title>
3851 <tgroup cols="3">
3852 <thead>
3853 <row>
3854 <entry>Name</entry>
3855 <entry>Data Type</entry>
3856 <entry>Description</entry>
3857 </row>
3858 </thead>
3860 <tbody>
3861 <row>
3862 <entry><literal>catalog_name</literal></entry>
3863 <entry><type>sql_identifier</type></entry>
3864 <entry>Name of the database that the schema is contained in (always the current database)</entry>
3865 </row>
3867 <row>
3868 <entry><literal>schema_name</literal></entry>
3869 <entry><type>sql_identifier</type></entry>
3870 <entry>Name of the schema</entry>
3871 </row>
3873 <row>
3874 <entry><literal>schema_owner</literal></entry>
3875 <entry><type>sql_identifier</type></entry>
3876 <entry>Name of the owner of the schema</entry>
3877 </row>
3879 <row>
3880 <entry><literal>default_character_set_catalog</literal></entry>
3881 <entry><type>sql_identifier</type></entry>
3882 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3883 </row>
3885 <row>
3886 <entry><literal>default_character_set_schema</literal></entry>
3887 <entry><type>sql_identifier</type></entry>
3888 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3889 </row>
3891 <row>
3892 <entry><literal>default_character_set_name</literal></entry>
3893 <entry><type>sql_identifier</type></entry>
3894 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3895 </row>
3897 <row>
3898 <entry><literal>sql_path</literal></entry>
3899 <entry><type>character_data</type></entry>
3900 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3901 </row>
3902 </tbody>
3903 </tgroup>
3904 </table>
3905 </sect1>
3907 <sect1 id="infoschema-sequences">
3908 <title><literal>sequences</literal></title>
3910 <para>
3911 The view <literal>sequences</literal> contains all sequences
3912 defined in the current database. Only those sequences are shown
3913 that the current user has access to (by way of being the owner or
3914 having some privilege).
3915 </para>
3917 <table>
3918 <title><literal>sequences</literal> Columns</title>
3920 <tgroup cols="3">
3921 <thead>
3922 <row>
3923 <entry>Name</entry>
3924 <entry>Data Type</entry>
3925 <entry>Description</entry>
3926 </row>
3927 </thead>
3929 <tbody>
3930 <row>
3931 <entry><literal>sequence_catalog</literal></entry>
3932 <entry><type>sql_identifier</type></entry>
3933 <entry>Name of the database that contains the sequence (always the current database)</entry>
3934 </row>
3936 <row>
3937 <entry><literal>sequence_schema</literal></entry>
3938 <entry><type>sql_identifier</type></entry>
3939 <entry>Name of the schema that contains the sequence</entry>
3940 </row>
3942 <row>
3943 <entry><literal>sequence_name</literal></entry>
3944 <entry><type>sql_identifier</type></entry>
3945 <entry>Name of the sequence</entry>
3946 </row>
3948 <row>
3949 <entry><literal>data_type</literal></entry>
3950 <entry><type>character_data</type></entry>
3951 <entry>
3952 The data type of the sequence. In
3953 <productname>PostgreSQL</productname>, this is currently always
3954 <literal>bigint</literal>.
3955 </entry>
3956 </row>
3958 <row>
3959 <entry><literal>numeric_precision</literal></entry>
3960 <entry><type>cardinal_number</type></entry>
3961 <entry>
3962 This column contains the (declared or implicit) precision of
3963 the sequence data type (see above). The precision indicates
3964 the number of significant digits. It can be expressed in
3965 decimal (base 10) or binary (base 2) terms, as specified in the
3966 column <literal>numeric_precision_radix</literal>.
3967 </entry>
3968 </row>
3970 <row>
3971 <entry><literal>numeric_precision_radix</literal></entry>
3972 <entry><type>cardinal_number</type></entry>
3973 <entry>
3974 This column indicates in which base the values in the columns
3975 <literal>numeric_precision</literal> and
3976 <literal>numeric_scale</literal> are expressed. The value is
3977 either 2 or 10.
3978 </entry>
3979 </row>
3981 <row>
3982 <entry><literal>numeric_scale</literal></entry>
3983 <entry><type>cardinal_number</type></entry>
3984 <entry>
3985 This column contains the (declared or implicit) scale of the
3986 sequence data type (see above). The scale indicates the number
3987 of significant digits to the right of the decimal point. It
3988 can be expressed in decimal (base 10) or binary (base 2) terms,
3989 as specified in the column
3990 <literal>numeric_precision_radix</literal>.
3991 </entry>
3992 </row>
3994 <row>
3995 <entry><literal>maximum_value</literal></entry>
3996 <entry><type>cardinal_number</type></entry>
3997 <entry>Not yet implemented</entry>
3998 </row>
4000 <row>
4001 <entry><literal>minimum_value</literal></entry>
4002 <entry><type>cardinal_number</type></entry>
4003 <entry>Not yet implemented</entry>
4004 </row>
4006 <row>
4007 <entry><literal>increment</literal></entry>
4008 <entry><type>cardinal_number</type></entry>
4009 <entry>Not yet implemented</entry>
4010 </row>
4012 <row>
4013 <entry><literal>cycle_option</literal></entry>
4014 <entry><type>character_data</type></entry>
4015 <entry>Not yet implemented</entry>
4016 </row>
4017 </tbody>
4018 </tgroup>
4019 </table>
4020 </sect1>
4022 <sect1 id="infoschema-sql-features">
4023 <title><literal>sql_features</literal></title>
4025 <para>
4026 The table <literal>sql_features</literal> contains information
4027 about which formal features defined in the SQL standard are
4028 supported by <productname>PostgreSQL</productname>. This is the
4029 same information that is presented in <xref linkend="features">.
4030 There you can also find some additional background information.
4031 </para>
4033 <table>
4034 <title><literal>sql_features</literal> Columns</title>
4036 <tgroup cols="3">
4037 <thead>
4038 <row>
4039 <entry>Name</entry>
4040 <entry>Data Type</entry>
4041 <entry>Description</entry>
4042 </row>
4043 </thead>
4045 <tbody>
4046 <row>
4047 <entry><literal>feature_id</literal></entry>
4048 <entry><type>character_data</type></entry>
4049 <entry>Identifier string of the feature</entry>
4050 </row>
4052 <row>
4053 <entry><literal>feature_name</literal></entry>
4054 <entry><type>character_data</type></entry>
4055 <entry>Descriptive name of the feature</entry>
4056 </row>
4058 <row>
4059 <entry><literal>sub_feature_id</literal></entry>
4060 <entry><type>character_data</type></entry>
4061 <entry>Identifier string of the subfeature, or a zero-length string if not a subfeature</entry>
4062 </row>
4064 <row>
4065 <entry><literal>sub_feature_name</literal></entry>
4066 <entry><type>character_data</type></entry>
4067 <entry>Descriptive name of the subfeature, or a zero-length string if not a subfeature</entry>
4068 </row>
4070 <row>
4071 <entry><literal>is_supported</literal></entry>
4072 <entry><type>character_data</type></entry>
4073 <entry>
4074 <literal>YES</literal> if the feature is fully supported by the
4075 current version of <productname>PostgreSQL</>, <literal>NO</literal> if not
4076 </entry>
4077 </row>
4079 <row>
4080 <entry><literal>is_verified_by</literal></entry>
4081 <entry><type>character_data</type></entry>
4082 <entry>
4083 Always null, since the <productname>PostgreSQL</> development group does not
4084 perform formal testing of feature conformance
4085 </entry>
4086 </row>
4088 <row>
4089 <entry><literal>comments</literal></entry>
4090 <entry><type>character_data</type></entry>
4091 <entry>Possibly a comment about the supported status of the feature</entry>
4092 </row>
4093 </tbody>
4094 </tgroup>
4095 </table>
4096 </sect1>
4098 <sect1 id="infoschema-sql-implementation-info">
4099 <title><literal>sql_implementation_info</literal></title>
4101 <para>
4102 The table <literal>sql_implementation_info</literal> contains
4103 information about various aspects that are left
4104 implementation-defined by the SQL standard. This information is
4105 primarily intended for use in the context of the ODBC interface;
4106 users of other interfaces will probably find this information to be
4107 of little use. For this reason, the individual implementation
4108 information items are not described here; you will find them in the
4109 description of the ODBC interface.
4110 </para>
4112 <table>
4113 <title><literal>sql_implementation_info</literal> Columns</title>
4115 <tgroup cols="3">
4116 <thead>
4117 <row>
4118 <entry>Name</entry>
4119 <entry>Data Type</entry>
4120 <entry>Description</entry>
4121 </row>
4122 </thead>
4124 <tbody>
4125 <row>
4126 <entry><literal>implementation_info_id</literal></entry>
4127 <entry><type>character_data</type></entry>
4128 <entry>Identifier string of the implementation information item</entry>
4129 </row>
4131 <row>
4132 <entry><literal>implementation_info_name</literal></entry>
4133 <entry><type>character_data</type></entry>
4134 <entry>Descriptive name of the implementation information item</entry>
4135 </row>
4137 <row>
4138 <entry><literal>integer_value</literal></entry>
4139 <entry><type>cardinal_number</type></entry>
4140 <entry>
4141 Value of the implementation information item, or null if the
4142 value is contained in the column
4143 <literal>character_value</literal>
4144 </entry>
4145 </row>
4147 <row>
4148 <entry><literal>character_value</literal></entry>
4149 <entry><type>character_data</type></entry>
4150 <entry>
4151 Value of the implementation information item, or null if the
4152 value is contained in the column
4153 <literal>integer_value</literal>
4154 </entry>
4155 </row>
4157 <row>
4158 <entry><literal>comments</literal></entry>
4159 <entry><type>character_data</type></entry>
4160 <entry>Possibly a comment pertaining to the implementation information item</entry>
4161 </row>
4162 </tbody>
4163 </tgroup>
4164 </table>
4165 </sect1>
4167 <sect1 id="infoschema-sql-languages">
4168 <title><literal>sql_languages</literal></title>
4170 <para>
4171 The table <literal>sql_languages</literal> contains one row for
4172 each SQL language binding that is supported by
4173 <productname>PostgreSQL</productname>.
4174 <productname>PostgreSQL</productname> supports direct SQL and
4175 embedded SQL in C; that is all you will learn from this table.
4176 </para>
4178 <table>
4179 <title><literal>sql_languages</literal> Columns</title>
4181 <tgroup cols="3">
4182 <thead>
4183 <row>
4184 <entry>Name</entry>
4185 <entry>Data Type</entry>
4186 <entry>Description</entry>
4187 </row>
4188 </thead>
4190 <tbody>
4191 <row>
4192 <entry><literal>sql_language_source</literal></entry>
4193 <entry><type>character_data</type></entry>
4194 <entry>
4195 The name of the source of the language definition; always
4196 <literal>ISO 9075</literal>, that is, the SQL standard
4197 </entry>
4198 </row>
4200 <row>
4201 <entry><literal>sql_language_year</literal></entry>
4202 <entry><type>character_data</type></entry>
4203 <entry>
4204 The year the standard referenced in
4205 <literal>sql_language_source</literal> was approved; currently
4206 <literal>2003</>
4207 </entry>
4208 </row>
4210 <row>
4211 <entry><literal>sql_language_conformance</literal></entry>
4212 <entry><type>character_data</type></entry>
4213 <entry>
4214 The standard conformance level for the language binding. For
4215 ISO 9075:2003 this is always <literal>CORE</literal>.
4216 </entry>
4217 </row>
4219 <row>
4220 <entry><literal>sql_language_integrity</literal></entry>
4221 <entry><type>character_data</type></entry>
4222 <entry>Always null (This value is relevant to an earlier version of the SQL standard.)</entry>
4223 </row>
4225 <row>
4226 <entry><literal>sql_language_implementation</literal></entry>
4227 <entry><type>character_data</type></entry>
4228 <entry>Always null</entry>
4229 </row>
4231 <row>
4232 <entry><literal>sql_language_binding_style</literal></entry>
4233 <entry><type>character_data</type></entry>
4234 <entry>
4235 The language binding style, either <literal>DIRECT</literal> or
4236 <literal>EMBEDDED</literal>
4237 </entry>
4238 </row>
4240 <row>
4241 <entry><literal>sql_language_programming_language</literal></entry>
4242 <entry><type>character_data</type></entry>
4243 <entry>
4244 The programming language, if the binding style is
4245 <literal>EMBEDDED</literal>, else null. <productname>PostgreSQL</> only
4246 supports the language C.
4247 </entry>
4248 </row>
4249 </tbody>
4250 </tgroup>
4251 </table>
4252 </sect1>
4254 <sect1 id="infoschema-sql-packages">
4255 <title><literal>sql_packages</literal></title>
4257 <para>
4258 The table <literal>sql_packages</literal> contains information
4259 about which feature packages defined in the SQL standard are
4260 supported by <productname>PostgreSQL</productname>. Refer to <xref
4261 linkend="features"> for background information on feature packages.
4262 </para>
4264 <table>
4265 <title><literal>sql_packages</literal> Columns</title>
4267 <tgroup cols="3">
4268 <thead>
4269 <row>
4270 <entry>Name</entry>
4271 <entry>Data Type</entry>
4272 <entry>Description</entry>
4273 </row>
4274 </thead>
4276 <tbody>
4277 <row>
4278 <entry><literal>feature_id</literal></entry>
4279 <entry><type>character_data</type></entry>
4280 <entry>Identifier string of the package</entry>
4281 </row>
4283 <row>
4284 <entry><literal>feature_name</literal></entry>
4285 <entry><type>character_data</type></entry>
4286 <entry>Descriptive name of the package</entry>
4287 </row>
4289 <row>
4290 <entry><literal>is_supported</literal></entry>
4291 <entry><type>character_data</type></entry>
4292 <entry>
4293 <literal>YES</literal> if the package is fully supported by the
4294 current version of <productname>PostgreSQL</>, <literal>NO</literal> if not
4295 </entry>
4296 </row>
4298 <row>
4299 <entry><literal>is_verified_by</literal></entry>
4300 <entry><type>character_data</type></entry>
4301 <entry>
4302 Always null, since the <productname>PostgreSQL</> development group does not
4303 perform formal testing of feature conformance
4304 </entry>
4305 </row>
4307 <row>
4308 <entry><literal>comments</literal></entry>
4309 <entry><type>character_data</type></entry>
4310 <entry>Possibly a comment about the supported status of the package</entry>
4311 </row>
4312 </tbody>
4313 </tgroup>
4314 </table>
4315 </sect1>
4317 <sect1 id="infoschema-sql-parts">
4318 <title><literal>sql_parts</literal></title>
4320 <para>
4321 The table <literal>sql_parts</literal> contains information about
4322 which of the several parts of the SQL standard are supported by
4323 <productname>PostgreSQL</productname>.
4324 </para>
4326 <table>
4327 <title><literal>sql_parts</literal> Columns</title>
4329 <tgroup cols="3">
4330 <thead>
4331 <row>
4332 <entry>Name</entry>
4333 <entry>Data Type</entry>
4334 <entry>Description</entry>
4335 </row>
4336 </thead>
4338 <tbody>
4339 <row>
4340 <entry><literal>feature_id</literal></entry>
4341 <entry><type>character_data</type></entry>
4342 <entry>An identifier string containing the number of the part</entry>
4343 </row>
4345 <row>
4346 <entry><literal>feature_name</literal></entry>
4347 <entry><type>character_data</type></entry>
4348 <entry>Descriptive name of the part</entry>
4349 </row>
4351 <row>
4352 <entry><literal>is_supported</literal></entry>
4353 <entry><type>character_data</type></entry>
4354 <entry>
4355 <literal>YES</literal> if the part is fully supported by the
4356 current version of <productname>PostgreSQL</>,
4357 <literal>NO</literal> if not
4358 </entry>
4359 </row>
4361 <row>
4362 <entry><literal>is_verified_by</literal></entry>
4363 <entry><type>character_data</type></entry>
4364 <entry>
4365 Always null, since the <productname>PostgreSQL</> development group does not
4366 perform formal testing of feature conformance
4367 </entry>
4368 </row>
4370 <row>
4371 <entry><literal>comments</literal></entry>
4372 <entry><type>character_data</type></entry>
4373 <entry>Possibly a comment about the supported status of the part</entry>
4374 </row>
4375 </tbody>
4376 </tgroup>
4377 </table>
4378 </sect1>
4380 <sect1 id="infoschema-sql-sizing">
4381 <title><literal>sql_sizing</literal></title>
4383 <para>
4384 The table <literal>sql_sizing</literal> contains information about
4385 various size limits and maximum values in
4386 <productname>PostgreSQL</productname>. This information is
4387 primarily intended for use in the context of the ODBC interface;
4388 users of other interfaces will probably find this information to be
4389 of little use. For this reason, the individual sizing items are
4390 not described here; you will find them in the description of the
4391 ODBC interface.
4392 </para>
4394 <table>
4395 <title><literal>sql_sizing</literal> Columns</title>
4397 <tgroup cols="3">
4398 <thead>
4399 <row>
4400 <entry>Name</entry>
4401 <entry>Data Type</entry>
4402 <entry>Description</entry>
4403 </row>
4404 </thead>
4406 <tbody>
4407 <row>
4408 <entry><literal>sizing_id</literal></entry>
4409 <entry><type>cardinal_number</type></entry>
4410 <entry>Identifier of the sizing item</entry>
4411 </row>
4413 <row>
4414 <entry><literal>sizing_name</literal></entry>
4415 <entry><type>character_data</type></entry>
4416 <entry>Descriptive name of the sizing item</entry>
4417 </row>
4419 <row>
4420 <entry><literal>supported_value</literal></entry>
4421 <entry><type>cardinal_number</type></entry>
4422 <entry>
4423 Value of the sizing item, or 0 if the size is unlimited or
4424 cannot be determined, or null if the features for which the
4425 sizing item is applicable are not supported
4426 </entry>
4427 </row>
4429 <row>
4430 <entry><literal>comments</literal></entry>
4431 <entry><type>character_data</type></entry>
4432 <entry>Possibly a comment pertaining to the sizing item</entry>
4433 </row>
4434 </tbody>
4435 </tgroup>
4436 </table>
4437 </sect1>
4439 <sect1 id="infoschema-sql-sizing-profiles">
4440 <title><literal>sql_sizing_profiles</literal></title>
4442 <para>
4443 The table <literal>sql_sizing_profiles</literal> contains
4444 information about the <literal>sql_sizing</literal> values that are
4445 required by various profiles of the SQL standard. <productname>PostgreSQL</> does
4446 not track any SQL profiles, so this table is empty.
4447 </para>
4449 <table>
4450 <title><literal>sql_sizing_profiles</literal> Columns</title>
4452 <tgroup cols="3">
4453 <thead>
4454 <row>
4455 <entry>Name</entry>
4456 <entry>Data Type</entry>
4457 <entry>Description</entry>
4458 </row>
4459 </thead>
4461 <tbody>
4462 <row>
4463 <entry><literal>sizing_id</literal></entry>
4464 <entry><type>cardinal_number</type></entry>
4465 <entry>Identifier of the sizing item</entry>
4466 </row>
4468 <row>
4469 <entry><literal>sizing_name</literal></entry>
4470 <entry><type>character_data</type></entry>
4471 <entry>Descriptive name of the sizing item</entry>
4472 </row>
4474 <row>
4475 <entry><literal>profile_id</literal></entry>
4476 <entry><type>character_data</type></entry>
4477 <entry>Identifier string of a profile</entry>
4478 </row>
4480 <row>
4481 <entry><literal>required_value</literal></entry>
4482 <entry><type>cardinal_number</type></entry>
4483 <entry>
4484 The value required by the SQL profile for the sizing item, or 0
4485 if the profile places no limit on the sizing item, or null if
4486 the profile does not require any of the features for which the
4487 sizing item is applicable
4488 </entry>
4489 </row>
4491 <row>
4492 <entry><literal>comments</literal></entry>
4493 <entry><type>character_data</type></entry>
4494 <entry>Possibly a comment pertaining to the sizing item within the profile</entry>
4495 </row>
4496 </tbody>
4497 </tgroup>
4498 </table>
4499 </sect1>
4501 <sect1 id="infoschema-table-constraints">
4502 <title><literal>table_constraints</literal></title>
4504 <para>
4505 The view <literal>table_constraints</literal> contains all
4506 constraints belonging to tables that the current user owns or has
4507 some non-SELECT privilege on.
4508 </para>
4510 <table>
4511 <title><literal>table_constraints</literal> Columns</title>
4513 <tgroup cols="3">
4514 <thead>
4515 <row>
4516 <entry>Name</entry>
4517 <entry>Data Type</entry>
4518 <entry>Description</entry>
4519 </row>
4520 </thead>
4522 <tbody>
4523 <row>
4524 <entry><literal>constraint_catalog</literal></entry>
4525 <entry><type>sql_identifier</type></entry>
4526 <entry>Name of the database that contains the constraint (always the current database)</entry>
4527 </row>
4529 <row>
4530 <entry><literal>constraint_schema</literal></entry>
4531 <entry><type>sql_identifier</type></entry>
4532 <entry>Name of the schema that contains the constraint</entry>
4533 </row>
4535 <row>
4536 <entry><literal>constraint_name</literal></entry>
4537 <entry><type>sql_identifier</type></entry>
4538 <entry>Name of the constraint</entry>
4539 </row>
4541 <row>
4542 <entry><literal>table_catalog</literal></entry>
4543 <entry><type>sql_identifier</type></entry>
4544 <entry>Name of the database that contains the table (always the current database)</entry>
4545 </row>
4547 <row>
4548 <entry><literal>table_schema</literal></entry>
4549 <entry><type>sql_identifier</type></entry>
4550 <entry>Name of the schema that contains the table</entry>
4551 </row>
4553 <row>
4554 <entry><literal>table_name</literal></entry>
4555 <entry><type>sql_identifier</type></entry>
4556 <entry>Name of the table</entry>
4557 </row>
4559 <row>
4560 <entry><literal>constraint_type</literal></entry>
4561 <entry><type>character_data</type></entry>
4562 <entry>
4563 Type of the constraint: <literal>CHECK</literal>,
4564 <literal>FOREIGN KEY</literal>, <literal>PRIMARY KEY</literal>,
4565 or <literal>UNIQUE</literal>
4566 </entry>
4567 </row>
4569 <row>
4570 <entry><literal>is_deferrable</literal></entry>
4571 <entry><type>character_data</type></entry>
4572 <entry><literal>YES</literal> if the constraint is deferrable, <literal>NO</literal> if not</entry>
4573 </row>
4575 <row>
4576 <entry><literal>initially_deferred</literal></entry>
4577 <entry><type>character_data</type></entry>
4578 <entry><literal>YES</literal> if the constraint is deferrable and initially deferred, <literal>NO</literal> if not</entry>
4579 </row>
4580 </tbody>
4581 </tgroup>
4582 </table>
4583 </sect1>
4585 <sect1 id="infoschema-table-privileges">
4586 <title><literal>table_privileges</literal></title>
4588 <para>
4589 The view <literal>table_privileges</literal> identifies all
4590 privileges granted on tables or views to a currently enabled role
4591 or by a currently enabled role. There is one row for each
4592 combination of table, grantor, and grantee.
4593 </para>
4595 <table>
4596 <title><literal>table_privileges</literal> Columns</title>
4598 <tgroup cols="3">
4599 <thead>
4600 <row>
4601 <entry>Name</entry>
4602 <entry>Data Type</entry>
4603 <entry>Description</entry>
4604 </row>
4605 </thead>
4607 <tbody>
4608 <row>
4609 <entry><literal>grantor</literal></entry>
4610 <entry><type>sql_identifier</type></entry>
4611 <entry>Name of the role that granted the privilege</entry>
4612 </row>
4614 <row>
4615 <entry><literal>grantee</literal></entry>
4616 <entry><type>sql_identifier</type></entry>
4617 <entry>Name of the role that the privilege was granted to</entry>
4618 </row>
4620 <row>
4621 <entry><literal>table_catalog</literal></entry>
4622 <entry><type>sql_identifier</type></entry>
4623 <entry>Name of the database that contains the table (always the current database)</entry>
4624 </row>
4626 <row>
4627 <entry><literal>table_schema</literal></entry>
4628 <entry><type>sql_identifier</type></entry>
4629 <entry>Name of the schema that contains the table</entry>
4630 </row>
4632 <row>
4633 <entry><literal>table_name</literal></entry>
4634 <entry><type>sql_identifier</type></entry>
4635 <entry>Name of the table</entry>
4636 </row>
4638 <row>
4639 <entry><literal>privilege_type</literal></entry>
4640 <entry><type>character_data</type></entry>
4641 <entry>
4642 Type of the privilege: <literal>SELECT</literal>,
4643 <literal>INSERT</literal>, <literal>UPDATE</literal>,
4644 <literal>DELETE</literal>, <literal>TRUNCATE</literal>,
4645 <literal>REFERENCES</literal>, or <literal>TRIGGER</literal>
4646 </entry>
4647 </row>
4649 <row>
4650 <entry><literal>is_grantable</literal></entry>
4651 <entry><type>character_data</type></entry>
4652 <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
4653 </row>
4655 <row>
4656 <entry><literal>with_hierarchy</literal></entry>
4657 <entry><type>character_data</type></entry>
4658 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4659 </row>
4660 </tbody>
4661 </tgroup>
4662 </table>
4663 </sect1>
4665 <sect1 id="infoschema-tables">
4666 <title><literal>tables</literal></title>
4668 <para>
4669 The view <literal>tables</literal> contains all tables and views
4670 defined in the current database. Only those tables and views are
4671 shown that the current user has access to (by way of being the
4672 owner or having some privilege).
4673 </para>
4675 <table>
4676 <title><literal>tables</literal> Columns</title>
4678 <tgroup cols="3">
4679 <thead>
4680 <row>
4681 <entry>Name</entry>
4682 <entry>Data Type</entry>
4683 <entry>Description</entry>
4684 </row>
4685 </thead>
4687 <tbody>
4688 <row>
4689 <entry><literal>table_catalog</literal></entry>
4690 <entry><type>sql_identifier</type></entry>
4691 <entry>Name of the database that contains the table (always the current database)</entry>
4692 </row>
4694 <row>
4695 <entry><literal>table_schema</literal></entry>
4696 <entry><type>sql_identifier</type></entry>
4697 <entry>Name of the schema that contains the table</entry>
4698 </row>
4700 <row>
4701 <entry><literal>table_name</literal></entry>
4702 <entry><type>sql_identifier</type></entry>
4703 <entry>Name of the table</entry>
4704 </row>
4706 <row>
4707 <entry><literal>table_type</literal></entry>
4708 <entry><type>character_data</type></entry>
4709 <entry>
4710 Type of the table: <literal>BASE TABLE</literal> for a
4711 persistent base table (the normal table type),
4712 <literal>VIEW</literal> for a view, or <literal>LOCAL
4713 TEMPORARY</literal> for a temporary table
4714 </entry>
4715 </row>
4717 <row>
4718 <entry><literal>self_referencing_column_name</literal></entry>
4719 <entry><type>sql_identifier</type></entry>
4720 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4721 </row>
4723 <row>
4724 <entry><literal>reference_generation</literal></entry>
4725 <entry><type>character_data</type></entry>
4726 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4727 </row>
4729 <row>
4730 <entry><literal>user_defined_type_catalog</literal></entry>
4731 <entry><type>sql_identifier</type></entry>
4732 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4733 </row>
4735 <row>
4736 <entry><literal>user_defined_type_schema</literal></entry>
4737 <entry><type>sql_identifier</type></entry>
4738 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4739 </row>
4741 <row>
4742 <entry><literal>user_defined_type_name</literal></entry>
4743 <entry><type>sql_identifier</type></entry>
4744 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4745 </row>
4747 <row>
4748 <entry><literal>is_insertable_into</literal></entry>
4749 <entry><type>character_data</type></entry>
4750 <entry>
4751 <literal>YES</literal> if the table is insertable into,
4752 <literal>NO</literal> if not (Base tables are always insertable
4753 into, views not necessarily.)
4754 </entry>
4755 </row>
4757 <row>
4758 <entry><literal>is_typed</literal></entry>
4759 <entry><type>character_data</type></entry>
4760 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4761 </row>
4763 <row>
4764 <entry><literal>commit_action</literal></entry>
4765 <entry><type>character_data</type></entry>
4766 <entry>
4767 If the table is a temporary table, then
4768 <literal>PRESERVE</literal>, else null. (The SQL standard
4769 defines other commit actions for temporary tables, which are
4770 not supported by <productname>PostgreSQL</>.)
4771 </entry>
4772 </row>
4773 </tbody>
4774 </tgroup>
4775 </table>
4776 </sect1>
4778 <sect1 id="infoschema-triggers">
4779 <title><literal>triggers</literal></title>
4781 <para>
4782 The view <literal>triggers</literal> contains all triggers defined
4783 in the current database on tables that the current user owns or has
4784 some non-SELECT privilege on.
4785 </para>
4787 <table>
4788 <title><literal>triggers</literal> Columns</title>
4790 <tgroup cols="3">
4791 <thead>
4792 <row>
4793 <entry>Name</entry>
4794 <entry>Data Type</entry>
4795 <entry>Description</entry>
4796 </row>
4797 </thead>
4799 <tbody>
4800 <row>
4801 <entry><literal>trigger_catalog</literal></entry>
4802 <entry><type>sql_identifier</type></entry>
4803 <entry>Name of the database that contains the trigger (always the current database)</entry>
4804 </row>
4806 <row>
4807 <entry><literal>trigger_schema</literal></entry>
4808 <entry><type>sql_identifier</type></entry>
4809 <entry>Name of the schema that contains the trigger</entry>
4810 </row>
4812 <row>
4813 <entry><literal>trigger_name</literal></entry>
4814 <entry><type>sql_identifier</type></entry>
4815 <entry>Name of the trigger</entry>
4816 </row>
4818 <row>
4819 <entry><literal>event_manipulation</literal></entry>
4820 <entry><type>character_data</type></entry>
4821 <entry>
4822 Event that fires the trigger (<literal>INSERT</literal>,
4823 <literal>UPDATE</literal>, or <literal>DELETE</literal>)
4824 </entry>
4825 </row>
4827 <row>
4828 <entry><literal>event_object_catalog</literal></entry>
4829 <entry><type>sql_identifier</type></entry>
4830 <entry>
4831 Name of the database that contains the table that the trigger
4832 is defined on (always the current database)
4833 </entry>
4834 </row>
4836 <row>
4837 <entry><literal>event_object_schema</literal></entry>
4838 <entry><type>sql_identifier</type></entry>
4839 <entry>Name of the schema that contains the table that the trigger is defined on</entry>
4840 </row>
4842 <row>
4843 <entry><literal>event_object_table</literal></entry>
4844 <entry><type>sql_identifier</type></entry>
4845 <entry>Name of the table that the trigger is defined on</entry>
4846 </row>
4848 <row>
4849 <entry><literal>action_order</literal></entry>
4850 <entry><type>cardinal_number</type></entry>
4851 <entry>Not yet implemented</entry>
4852 </row>
4854 <row>
4855 <entry><literal>action_condition</literal></entry>
4856 <entry><type>character_data</type></entry>
4857 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4858 </row>
4860 <row>
4861 <entry><literal>action_statement</literal></entry>
4862 <entry><type>character_data</type></entry>
4863 <entry>
4864 Statement that is executed by the trigger (currently always
4865 <literal>EXECUTE PROCEDURE
4866 <replaceable>function</replaceable>(...)</literal>)
4867 </entry>
4868 </row>
4870 <row>
4871 <entry><literal>action_orientation</literal></entry>
4872 <entry><type>character_data</type></entry>
4873 <entry>
4874 Identifies whether the trigger fires once for each processed
4875 row or once for each statement (<literal>ROW</literal> or
4876 <literal>STATEMENT</literal>)
4877 </entry>
4878 </row>
4880 <row>
4881 <entry><literal>condition_timing</literal></entry>
4882 <entry><type>character_data</type></entry>
4883 <entry>
4884 Time at which the trigger fires (<literal>BEFORE</literal> or
4885 <literal>AFTER</literal>)
4886 </entry>
4887 </row>
4889 <row>
4890 <entry><literal>condition_reference_old_table</literal></entry>
4891 <entry><type>sql_identifier</type></entry>
4892 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4893 </row>
4895 <row>
4896 <entry><literal>condition_reference_new_table</literal></entry>
4897 <entry><type>sql_identifier</type></entry>
4898 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4899 </row>
4901 <row>
4902 <entry><literal>condition_reference_old_row</literal></entry>
4903 <entry><type>sql_identifier</type></entry>
4904 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4905 </row>
4907 <row>
4908 <entry><literal>condition_reference_new_row</literal></entry>
4909 <entry><type>sql_identifier</type></entry>
4910 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4911 </row>
4913 <row>
4914 <entry><literal>created</literal></entry>
4915 <entry><type>time_stamp</type></entry>
4916 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4917 </row>
4918 </tbody>
4919 </tgroup>
4920 </table>
4922 <para>
4923 Triggers in <productname>PostgreSQL</productname> have two
4924 incompatibilities with the SQL standard that affect the
4925 representation in the information schema. First, trigger names are
4926 local to the table in <productname>PostgreSQL</productname>, rather
4927 than being independent schema objects. Therefore there can be duplicate
4928 trigger names defined in one schema, as long as they belong to
4929 different tables. (<literal>trigger_catalog</literal> and
4930 <literal>trigger_schema</literal> are really the values pertaining
4931 to the table that the trigger is defined on.) Second, triggers can
4932 be defined to fire on multiple events in
4933 <productname>PostgreSQL</productname> (e.g., <literal>ON INSERT OR
4934 UPDATE</literal>), whereas the SQL standard only allows one. If a
4935 trigger is defined to fire on multiple events, it is represented as
4936 multiple rows in the information schema, one for each type of
4937 event. As a consequence of these two issues, the primary key of
4938 the view <literal>triggers</literal> is really
4939 <literal>(trigger_catalog, trigger_schema, trigger_name,
4940 event_object_table, event_manipulation)</literal> instead of
4941 <literal>(trigger_catalog, trigger_schema, trigger_name)</literal>,
4942 which is what the SQL standard specifies. Nonetheless, if you
4943 define your triggers in a manner that conforms with the SQL
4944 standard (trigger names unique in the schema and only one event
4945 type per trigger), this will not affect you.
4946 </para>
4947 </sect1>
4949 <sect1 id="infoschema-usage-privileges">
4950 <title><literal>usage_privileges</literal></title>
4952 <para>
4953 The view <literal>usage_privileges</literal> identifies
4954 <literal>USAGE</literal> privileges granted on various kinds of
4955 objects to a currently enabled role or by a currently enabled role.
4956 In <productname>PostgreSQL</productname>, this currently applies to
4957 domains, foreign-data wrappers, and foreign servers. There is one
4958 row for each combination of object, grantor, and grantee.
4959 </para>
4961 <para>
4962 Since domains do not have real privileges
4963 in <productname>PostgreSQL</productname>, this view shows implicit
4964 non-grantable <literal>USAGE</literal> privileges granted by the
4965 owner to <literal>PUBLIC</literal> for all domains. The other
4966 object types, however, show real privileges.
4967 </para>
4969 <table>
4970 <title><literal>usage_privileges</literal> Columns</title>
4972 <tgroup cols="3">
4973 <thead>
4974 <row>
4975 <entry>Name</entry>
4976 <entry>Data Type</entry>
4977 <entry>Description</entry>
4978 </row>
4979 </thead>
4981 <tbody>
4982 <row>
4983 <entry><literal>grantor</literal></entry>
4984 <entry><type>sql_identifier</type></entry>
4985 <entry>Name of the role that granted the privilege</entry>
4986 </row>
4988 <row>
4989 <entry><literal>grantee</literal></entry>
4990 <entry><type>sql_identifier</type></entry>
4991 <entry>Name of the role that the privilege was granted to</entry>
4992 </row>
4994 <row>
4995 <entry><literal>object_catalog</literal></entry>
4996 <entry><type>sql_identifier</type></entry>
4997 <entry>Name of the database containing the object (always the current database)</entry>
4998 </row>
5000 <row>
5001 <entry><literal>object_schema</literal></entry>
5002 <entry><type>sql_identifier</type></entry>
5003 <entry>Name of the schema containing the object, if applicable,
5004 else an empty string</entry>
5005 </row>
5007 <row>
5008 <entry><literal>object_name</literal></entry>
5009 <entry><type>sql_identifier</type></entry>
5010 <entry>Name of the object</entry>
5011 </row>
5013 <row>
5014 <entry><literal>object_type</literal></entry>
5015 <entry><type>character_data</type></entry>
5016 <entry><literal>DOMAIN</literal> or <literal>FOREIGN DATA WRAPPER</literal> or <literal>FOREIGN SERVER</literal></entry>
5017 </row>
5019 <row>
5020 <entry><literal>privilege_type</literal></entry>
5021 <entry><type>character_data</type></entry>
5022 <entry>Always <literal>USAGE</literal></entry>
5023 </row>
5025 <row>
5026 <entry><literal>is_grantable</literal></entry>
5027 <entry><type>character_data</type></entry>
5028 <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
5029 </row>
5030 </tbody>
5031 </tgroup>
5032 </table>
5033 </sect1>
5035 <sect1 id="infoschema-user-mapping-options">
5036 <title><literal>user_mapping_options</literal></title>
5038 <para>
5039 The view <literal>user_mapping_options</literal> contains all the
5040 options defined for user mappings in the current database. Only
5041 those user mappings are shown where the current user has access to
5042 the corresponding foreign server (by way of being the owner or
5043 having some privilege).
5044 </para>
5046 <table>
5047 <title><literal>user_mapping_options</literal> Columns</title>
5049 <tgroup cols="3">
5050 <thead>
5051 <row>
5052 <entry>Name</entry>
5053 <entry>Data Type</entry>
5054 <entry>Description</entry>
5055 </row>
5056 </thead>
5058 <tbody>
5059 <row>
5060 <entry><literal>authorization_identifier</literal></entry>
5061 <entry><type>sql_identifier</type></entry>
5062 <entry>Name of the user being mapped,
5063 or <literal>PUBLIC</literal> if the mapping is public</entry>
5064 </row>
5066 <row>
5067 <entry><literal>foreign_server_catalog</literal></entry>
5068 <entry><type>sql_identifier</type></entry>
5069 <entry>Name of the database that the foreign server used by this
5070 mapping is defined in (always the current database)</entry>
5071 </row>
5073 <row>
5074 <entry><literal>foreign_server_name</literal></entry>
5075 <entry><type>sql_identifier</type></entry>
5076 <entry>Name of the foreign server used by this mapping</entry>
5077 </row>
5079 <row>
5080 <entry><literal>option_name</literal></entry>
5081 <entry><type>sql_identifier</type></entry>
5082 <entry>Name of an option</entry>
5083 </row>
5085 <row>
5086 <entry><literal>option_value</literal></entry>
5087 <entry><type>character_data</type></entry>
5088 <entry>Value of the option. This column will show as null
5089 unless the current user is the user being mapped, or the mapping
5090 is for <literal>PUBLIC</literal> and the current user is the
5091 server owner, or the current user is a superuser. The intent is
5092 to protect password information stored as user mapping
5093 option.</entry>
5094 </row>
5095 </tbody>
5096 </tgroup>
5097 </table>
5098 </sect1>
5100 <sect1 id="infoschema-user-mappings">
5101 <title><literal>user_mappings</literal></title>
5103 <para>
5104 The view <literal>user_mappings</literal> contains all user
5105 mappings defined in the current database. Only those user mappings
5106 are shown where the current user has access to the corresponding
5107 foreign server (by way of being the owner or having some
5108 privilege).
5109 </para>
5111 <table>
5112 <title><literal>user_mappings</literal> Columns</title>
5114 <tgroup cols="3">
5115 <thead>
5116 <row>
5117 <entry>Name</entry>
5118 <entry>Data Type</entry>
5119 <entry>Description</entry>
5120 </row>
5121 </thead>
5123 <tbody>
5124 <row>
5125 <entry><literal>authorization_identifier</literal></entry>
5126 <entry><type>sql_identifier</type></entry>
5127 <entry>Name of the user being mapped,
5128 or <literal>PUBLIC</literal> if the mapping is public</entry>
5129 </row>
5131 <row>
5132 <entry><literal>foreign_server_catalog</literal></entry>
5133 <entry><type>sql_identifier</type></entry>
5134 <entry>Name of the database that the foreign server used by this
5135 mapping is defined in (always the current database)</entry>
5136 </row>
5138 <row>
5139 <entry><literal>foreign_server_name</literal></entry>
5140 <entry><type>sql_identifier</type></entry>
5141 <entry>Name of the foreign server used by this mapping</entry>
5142 </row>
5143 </tbody>
5144 </tgroup>
5145 </table>
5146 </sect1>
5148 <sect1 id="infoschema-view-column-usage">
5149 <title><literal>view_column_usage</literal></title>
5151 <para>
5152 The view <literal>view_column_usage</literal> identifies all
5153 columns that are used in the query expression of a view (the
5154 <command>SELECT</command> statement that defines the view). A
5155 column is only included if the table that contains the column is
5156 owned by a currently enabled role.
5157 </para>
5159 <note>
5160 <para>
5161 Columns of system tables are not included. This should be fixed
5162 sometime.
5163 </para>
5164 </note>
5166 <table>
5167 <title><literal>view_column_usage</literal> Columns</title>
5169 <tgroup cols="3">
5170 <thead>
5171 <row>
5172 <entry>Name</entry>
5173 <entry>Data Type</entry>
5174 <entry>Description</entry>
5175 </row>
5176 </thead>
5178 <tbody>
5179 <row>
5180 <entry><literal>view_catalog</literal></entry>
5181 <entry><type>sql_identifier</type></entry>
5182 <entry>Name of the database that contains the view (always the current database)</entry>
5183 </row>
5185 <row>
5186 <entry><literal>view_schema</literal></entry>
5187 <entry><type>sql_identifier</type></entry>
5188 <entry>Name of the schema that contains the view</entry>
5189 </row>
5191 <row>
5192 <entry><literal>view_name</literal></entry>
5193 <entry><type>sql_identifier</type></entry>
5194 <entry>Name of the view</entry>
5195 </row>
5197 <row>
5198 <entry><literal>table_catalog</literal></entry>
5199 <entry><type>sql_identifier</type></entry>
5200 <entry>
5201 Name of the database that contains the table that contains the
5202 column that is used by the view (always the current database)
5203 </entry>
5204 </row>
5206 <row>
5207 <entry><literal>table_schema</literal></entry>
5208 <entry><type>sql_identifier</type></entry>
5209 <entry>
5210 Name of the schema that contains the table that contains the
5211 column that is used by the view
5212 </entry>
5213 </row>
5215 <row>
5216 <entry><literal>table_name</literal></entry>
5217 <entry><type>sql_identifier</type></entry>
5218 <entry>
5219 Name of the table that contains the column that is used by the
5220 view
5221 </entry>
5222 </row>
5224 <row>
5225 <entry><literal>column_name</literal></entry>
5226 <entry><type>sql_identifier</type></entry>
5227 <entry>Name of the column that is used by the view</entry>
5228 </row>
5229 </tbody>
5230 </tgroup>
5231 </table>
5232 </sect1>
5234 <sect1 id="infoschema-view-routine-usage">
5235 <title><literal>view_routine_usage</literal></title>
5237 <para>
5238 The view <literal>view_routine_usage</literal> identifies all
5239 routines (functions and procedures) that are used in the query
5240 expression of a view (the <command>SELECT</command> statement that
5241 defines the view). A routine is only included if that routine is
5242 owned by a currently enabled role.
5243 </para>
5245 <table>
5246 <title><literal>view_routine_usage</literal> Columns</title>
5248 <tgroup cols="3">
5249 <thead>
5250 <row>
5251 <entry>Name</entry>
5252 <entry>Data Type</entry>
5253 <entry>Description</entry>
5254 </row>
5255 </thead>
5257 <tbody>
5258 <row>
5259 <entry><literal>table_catalog</literal></entry>
5260 <entry><literal>sql_identifier</literal></entry>
5261 <entry>Name of the database containing the view (always the current database)</entry>
5262 </row>
5264 <row>
5265 <entry><literal>table_schema</literal></entry>
5266 <entry><literal>sql_identifier</literal></entry>
5267 <entry>Name of the schema containing the view</entry>
5268 </row>
5270 <row>
5271 <entry><literal>table_name</literal></entry>
5272 <entry><literal>sql_identifier</literal></entry>
5273 <entry>Name of the view</entry>
5274 </row>
5276 <row>
5277 <entry><literal>specific_catalog</literal></entry>
5278 <entry><literal>sql_identifier</literal></entry>
5279 <entry>Name of the database containing the function (always the current database)</entry>
5280 </row>
5282 <row>
5283 <entry><literal>specific_schema</literal></entry>
5284 <entry><literal>sql_identifier</literal></entry>
5285 <entry>Name of the schema containing the function</entry>
5286 </row>
5288 <row>
5289 <entry><literal>specific_name</literal></entry>
5290 <entry><literal>sql_identifier</literal></entry>
5291 <entry>
5292 The <quote>specific name</quote> of the function. See <xref
5293 linkend="infoschema-routines"> for more information.
5294 </entry>
5295 </row>
5296 </tbody>
5297 </tgroup>
5298 </table>
5299 </sect1>
5301 <sect1 id="infoschema-view-table-usage">
5302 <title><literal>view_table_usage</literal></title>
5304 <para>
5305 The view <literal>view_table_usage</literal> identifies all tables
5306 that are used in the query expression of a view (the
5307 <command>SELECT</command> statement that defines the view). A
5308 table is only included if that table is owned by a currently
5309 enabled role.
5310 </para>
5312 <note>
5313 <para>
5314 System tables are not included. This should be fixed sometime.
5315 </para>
5316 </note>
5318 <table>
5319 <title><literal>view_table_usage</literal> Columns</title>
5321 <tgroup cols="3">
5322 <thead>
5323 <row>
5324 <entry>Name</entry>
5325 <entry>Data Type</entry>
5326 <entry>Description</entry>
5327 </row>
5328 </thead>
5330 <tbody>
5331 <row>
5332 <entry><literal>view_catalog</literal></entry>
5333 <entry><type>sql_identifier</type></entry>
5334 <entry>Name of the database that contains the view (always the current database)</entry>
5335 </row>
5337 <row>
5338 <entry><literal>view_schema</literal></entry>
5339 <entry><type>sql_identifier</type></entry>
5340 <entry>Name of the schema that contains the view</entry>
5341 </row>
5343 <row>
5344 <entry><literal>view_name</literal></entry>
5345 <entry><type>sql_identifier</type></entry>
5346 <entry>Name of the view</entry>
5347 </row>
5349 <row>
5350 <entry><literal>table_catalog</literal></entry>
5351 <entry><type>sql_identifier</type></entry>
5352 <entry>
5353 Name of the database that contains the table that is
5354 used by the view (always the current database)
5355 </entry>
5356 </row>
5358 <row>
5359 <entry><literal>table_schema</literal></entry>
5360 <entry><type>sql_identifier</type></entry>
5361 <entry>
5362 Name of the schema that contains the table that is used by the
5363 view
5364 </entry>
5365 </row>
5367 <row>
5368 <entry><literal>table_name</literal></entry>
5369 <entry><type>sql_identifier</type></entry>
5370 <entry>
5371 Name of the table that is used by the view
5372 </entry>
5373 </row>
5374 </tbody>
5375 </tgroup>
5376 </table>
5377 </sect1>
5379 <sect1 id="infoschema-views">
5380 <title><literal>views</literal></title>
5382 <para>
5383 The view <literal>views</literal> contains all views defined in the
5384 current database. Only those views are shown that the current user
5385 has access to (by way of being the owner or having some privilege).
5386 </para>
5388 <table>
5389 <title><literal>views</literal> Columns</title>
5391 <tgroup cols="3">
5392 <thead>
5393 <row>
5394 <entry>Name</entry>
5395 <entry>Data Type</entry>
5396 <entry>Description</entry>
5397 </row>
5398 </thead>
5400 <tbody>
5401 <row>
5402 <entry><literal>table_catalog</literal></entry>
5403 <entry><type>sql_identifier</type></entry>
5404 <entry>Name of the database that contains the view (always the current database)</entry>
5405 </row>
5407 <row>
5408 <entry><literal>table_schema</literal></entry>
5409 <entry><type>sql_identifier</type></entry>
5410 <entry>Name of the schema that contains the view</entry>
5411 </row>
5413 <row>
5414 <entry><literal>table_name</literal></entry>
5415 <entry><type>sql_identifier</type></entry>
5416 <entry>Name of the view</entry>
5417 </row>
5419 <row>
5420 <entry><literal>view_definition</literal></entry>
5421 <entry><type>character_data</type></entry>
5422 <entry>
5423 Query expression defining the view (null if the view is not
5424 owned by a currently enabled role)
5425 </entry>
5426 </row>
5428 <row>
5429 <entry><literal>check_option</literal></entry>
5430 <entry><type>character_data</type></entry>
5431 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5432 </row>
5434 <row>
5435 <entry><literal>is_updatable</literal></entry>
5436 <entry><type>character_data</type></entry>
5437 <entry>
5438 <literal>YES</literal> if the view is updatable (allows
5439 <command>UPDATE</command> and <command>DELETE</command>),
5440 <literal>NO</literal> if not
5441 </entry>
5442 </row>
5444 <row>
5445 <entry><literal>is_insertable_into</literal></entry>
5446 <entry><type>character_data</type></entry>
5447 <entry>
5448 <literal>YES</literal> if the view is insertable into (allows
5449 <command>INSERT</command>), <literal>NO</literal> if not
5450 </entry>
5451 </row>
5452 </tbody>
5453 </tgroup>
5454 </table>
5455 </sect1>
5457 </chapter>