1 <!-- doc/src/sgml/information_schema.sgml -->
3 <chapter id=
"information-schema">
4 <title>The Information Schema
</title>
6 <indexterm zone=
"information-schema">
7 <primary>information schema
</primary>
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
— unlike the system
15 catalogs, which are specific to
16 <productname>PostgreSQL
</productname> and are modeled after
17 implementation concerns. The information schema views do not,
18 however, contain information about
19 <productname>PostgreSQL
</productname>-specific features; to inquire
20 about those you need to query the system catalogs or other
21 <productname>PostgreSQL
</productname>-specific views.
26 When querying the database for constraint information, it is possible
27 for a standard-compliant query that expects to return one row to
28 return several. This is because the SQL standard requires constraint
29 names to be unique within a schema, but
30 <productname>PostgreSQL
</productname> does not enforce this
31 restriction.
<productname>PostgreSQL
</productname>
32 automatically-generated constraint names avoid duplicates in the
33 same schema, but users can specify such duplicate names.
37 This problem can appear when querying information schema views such
38 as
<literal>check_constraint_routine_usage
</literal>,
39 <literal>check_constraints
</literal>,
<literal>domain_constraints
</literal>, and
40 <literal>referential_constraints
</literal>. Some other views have similar
41 issues but contain the table name to help distinguish duplicate
42 rows, e.g.,
<literal>constraint_column_usage
</literal>,
43 <literal>constraint_table_usage
</literal>,
<literal>table_constraints
</literal>.
48 <sect1 id=
"infoschema-schema">
49 <title>The Schema
</title>
52 The information schema itself is a schema named
53 <literal>information_schema
</literal>. This schema automatically
54 exists in all databases. The owner of this schema is the initial
55 database user in the cluster, and that user naturally has all the
56 privileges on this schema, including the ability to drop it (but
57 the space savings achieved by that are minuscule).
61 By default, the information schema is not in the schema search
62 path, so you need to access all objects in it through qualified
63 names. Since the names of some of the objects in the information
64 schema are generic names that might occur in user applications, you
65 should be careful if you want to put the information schema in the
70 <sect1 id=
"infoschema-datatypes">
71 <title>Data Types
</title>
74 The columns of the information schema views use special data types
75 that are defined in the information schema. These are defined as
76 simple domains over ordinary built-in types. You should not use
77 these types for work outside the information schema, but your
78 applications must be prepared for them if they select from the
87 <term><type>cardinal_number
</type></term>
90 A nonnegative integer.
96 <term><type>character_data
</type></term>
99 A character string (without specific maximum length).
105 <term><type>sql_identifier
</type></term>
108 A character string. This type is used for SQL identifiers, the
109 type
<type>character_data
</type> is used for any other kind of
116 <term><type>time_stamp
</type></term>
119 A domain over the type
<type>timestamp with time zone
</type>
125 <term><type>yes_or_no
</type></term>
128 A character string domain that contains
129 either
<literal>YES
</literal> or
<literal>NO
</literal>. This
130 is used to represent Boolean (true/false) data in the
131 information schema. (The information schema was invented
132 before the type
<type>boolean
</type> was added to the SQL
133 standard, so this convention is necessary to keep the
134 information schema backward compatible.)
140 Every column in the information schema has one of these five types.
144 <sect1 id=
"infoschema-information-schema-catalog-name">
145 <title><literal>information_schema_catalog_name
</literal></title>
148 <literal>information_schema_catalog_name
</literal> is a table that
149 always contains one row and one column containing the name of the
150 current database (current catalog, in SQL terminology).
154 <title><structname>information_schema_catalog_name
</structname> Columns
</title>
158 <entry role=
"catalog_table_entry"><para role=
"column_definition">
169 <entry role=
"catalog_table_entry"><para role=
"column_definition">
170 <structfield>catalog_name
</structfield> <type>sql_identifier
</type>
173 Name of the database that contains this information schema
181 <sect1 id=
"infoschema-administrable-role-authorizations">
182 <title><literal>administrable_role_
&zwsp;authorizations
</literal></title>
185 The view
<literal>administrable_role_authorizations
</literal>
186 identifies all roles that the current user has the admin option
191 <title><structname>administrable_role_authorizations
</structname> Columns
</title>
195 <entry role=
"catalog_table_entry"><para role=
"column_definition">
206 <entry role=
"catalog_table_entry"><para role=
"column_definition">
207 <structfield>grantee
</structfield> <type>sql_identifier
</type>
210 Name of the role to which this role membership was granted (can
211 be the current user, or a different role in case of nested role
217 <entry role=
"catalog_table_entry"><para role=
"column_definition">
218 <structfield>role_name
</structfield> <type>sql_identifier
</type>
226 <entry role=
"catalog_table_entry"><para role=
"column_definition">
227 <structfield>is_grantable
</structfield> <type>yes_or_no
</type>
230 Always
<literal>YES
</literal>
238 <sect1 id=
"infoschema-applicable-roles">
239 <title><literal>applicable_roles
</literal></title>
242 The view
<literal>applicable_roles
</literal> identifies all roles
243 whose privileges the current user can use. This means there is
244 some chain of role grants from the current user to the role in
245 question. The current user itself is also an applicable role. The
246 set of applicable roles is generally used for permission checking.
247 <indexterm><primary>applicable role
</primary></indexterm>
248 <indexterm><primary>role
</primary><secondary>applicable
</secondary></indexterm>
252 <title><structname>applicable_roles
</structname> Columns
</title>
256 <entry role=
"catalog_table_entry"><para role=
"column_definition">
267 <entry role=
"catalog_table_entry"><para role=
"column_definition">
268 <structfield>grantee
</structfield> <type>sql_identifier
</type>
271 Name of the role to which this role membership was granted (can
272 be the current user, or a different role in case of nested role
278 <entry role=
"catalog_table_entry"><para role=
"column_definition">
279 <structfield>role_name
</structfield> <type>sql_identifier
</type>
287 <entry role=
"catalog_table_entry"><para role=
"column_definition">
288 <structfield>is_grantable
</structfield> <type>yes_or_no
</type>
291 <literal>YES
</literal> if the grantee has the admin option on
292 the role,
<literal>NO
</literal> if not
300 <sect1 id=
"infoschema-attributes">
301 <title><literal>attributes
</literal></title>
304 The view
<literal>attributes
</literal> contains information about
305 the attributes of composite data types defined in the database.
306 (Note that the view does not give information about table columns,
307 which are sometimes called attributes in PostgreSQL contexts.)
308 Only those attributes are shown that the current user has access to (by way
309 of being the owner of or having some privilege on the type).
313 <title><structname>attributes
</structname> Columns
</title>
317 <entry role=
"catalog_table_entry"><para role=
"column_definition">
328 <entry role=
"catalog_table_entry"><para role=
"column_definition">
329 <structfield>udt_catalog
</structfield> <type>sql_identifier
</type>
332 Name of the database containing the data type (always the current database)
337 <entry role=
"catalog_table_entry"><para role=
"column_definition">
338 <structfield>udt_schema
</structfield> <type>sql_identifier
</type>
341 Name of the schema containing the data type
346 <entry role=
"catalog_table_entry"><para role=
"column_definition">
347 <structfield>udt_name
</structfield> <type>sql_identifier
</type>
350 Name of the data type
355 <entry role=
"catalog_table_entry"><para role=
"column_definition">
356 <structfield>attribute_name
</structfield> <type>sql_identifier
</type>
359 Name of the attribute
364 <entry role=
"catalog_table_entry"><para role=
"column_definition">
365 <structfield>ordinal_position
</structfield> <type>cardinal_number
</type>
368 Ordinal position of the attribute within the data type (count starts at
1)
373 <entry role=
"catalog_table_entry"><para role=
"column_definition">
374 <structfield>attribute_default
</structfield> <type>character_data
</type>
377 Default expression of the attribute
382 <entry role=
"catalog_table_entry"><para role=
"column_definition">
383 <structfield>is_nullable
</structfield> <type>yes_or_no
</type>
386 <literal>YES
</literal> if the attribute is possibly nullable,
387 <literal>NO
</literal> if it is known not nullable.
392 <entry role=
"catalog_table_entry"><para role=
"column_definition">
393 <structfield>data_type
</structfield> <type>character_data
</type>
396 Data type of the attribute, if it is a built-in type, or
397 <literal>ARRAY
</literal> if it is some array (in that case, see
398 the view
<literal>element_types
</literal>), else
399 <literal>USER-DEFINED
</literal> (in that case, the type is
400 identified in
<literal>attribute_udt_name
</literal> and
406 <entry role=
"catalog_table_entry"><para role=
"column_definition">
407 <structfield>character_maximum_length
</structfield> <type>cardinal_number
</type>
410 If
<literal>data_type
</literal> identifies a character or bit
411 string type, the declared maximum length; null for all other
412 data types or if no maximum length was declared.
417 <entry role=
"catalog_table_entry"><para role=
"column_definition">
418 <structfield>character_octet_length
</structfield> <type>cardinal_number
</type>
421 If
<literal>data_type
</literal> identifies a character type,
422 the maximum possible length in octets (bytes) of a datum; null
423 for all other data types. The maximum octet length depends on
424 the declared character maximum length (see above) and the
430 <entry role=
"catalog_table_entry"><para role=
"column_definition">
431 <structfield>character_set_catalog
</structfield> <type>sql_identifier
</type>
434 Applies to a feature not available in
<productname>PostgreSQL
</productname>
439 <entry role=
"catalog_table_entry"><para role=
"column_definition">
440 <structfield>character_set_schema
</structfield> <type>sql_identifier
</type>
443 Applies to a feature not available in
<productname>PostgreSQL
</productname>
448 <entry role=
"catalog_table_entry"><para role=
"column_definition">
449 <structfield>character_set_name
</structfield> <type>sql_identifier
</type>
452 Applies to a feature not available in
<productname>PostgreSQL
</productname>
457 <entry role=
"catalog_table_entry"><para role=
"column_definition">
458 <structfield>collation_catalog
</structfield> <type>sql_identifier
</type>
461 Name of the database containing the collation of the attribute
462 (always the current database), null if default or the data type
463 of the attribute is not collatable
468 <entry role=
"catalog_table_entry"><para role=
"column_definition">
469 <structfield>collation_schema
</structfield> <type>sql_identifier
</type>
472 Name of the schema containing the collation of the attribute,
473 null if default or the data type of the attribute is not
479 <entry role=
"catalog_table_entry"><para role=
"column_definition">
480 <structfield>collation_name
</structfield> <type>sql_identifier
</type>
483 Name of the collation of the attribute, null if default or the
484 data type of the attribute is not collatable
489 <entry role=
"catalog_table_entry"><para role=
"column_definition">
490 <structfield>numeric_precision
</structfield> <type>cardinal_number
</type>
493 If
<literal>data_type
</literal> identifies a numeric type, this
494 column contains the (declared or implicit) precision of the
495 type for this attribute. The precision indicates the number of
496 significant digits. It can be expressed in decimal (base
10)
497 or binary (base
2) terms, as specified in the column
498 <literal>numeric_precision_radix
</literal>. For all other data
499 types, this column is null.
504 <entry role=
"catalog_table_entry"><para role=
"column_definition">
505 <structfield>numeric_precision_radix
</structfield> <type>cardinal_number
</type>
508 If
<literal>data_type
</literal> identifies a numeric type, this
509 column indicates in which base the values in the columns
510 <literal>numeric_precision
</literal> and
511 <literal>numeric_scale
</literal> are expressed. The value is
512 either
2 or
10. For all other data types, this column is null.
517 <entry role=
"catalog_table_entry"><para role=
"column_definition">
518 <structfield>numeric_scale
</structfield> <type>cardinal_number
</type>
521 If
<literal>data_type
</literal> identifies an exact numeric
522 type, this column contains the (declared or implicit) scale of
523 the type for this attribute. The scale indicates the number of
524 significant digits to the right of the decimal point. It can
525 be expressed in decimal (base
10) or binary (base
2) terms, as
526 specified in the column
527 <literal>numeric_precision_radix
</literal>. For all other data
528 types, this column is null.
533 <entry role=
"catalog_table_entry"><para role=
"column_definition">
534 <structfield>datetime_precision
</structfield> <type>cardinal_number
</type>
537 If
<literal>data_type
</literal> identifies a date, time,
538 timestamp, or interval type, this column contains the (declared
539 or implicit) fractional seconds precision of the type for this
540 attribute, that is, the number of decimal digits maintained
541 following the decimal point in the seconds value. For all
542 other data types, this column is null.
547 <entry role=
"catalog_table_entry"><para role=
"column_definition">
548 <structfield>interval_type
</structfield> <type>character_data
</type>
551 If
<literal>data_type
</literal> identifies an interval type,
552 this column contains the specification which fields the
553 intervals include for this attribute, e.g.,
<literal>YEAR TO
554 MONTH
</literal>,
<literal>DAY TO SECOND
</literal>, etc. If no
555 field restrictions were specified (that is, the interval
556 accepts all fields), and for all other data types, this field
562 <entry role=
"catalog_table_entry"><para role=
"column_definition">
563 <structfield>interval_precision
</structfield> <type>cardinal_number
</type>
566 Applies to a feature not available
567 in
<productname>PostgreSQL
</productname>
568 (see
<literal>datetime_precision
</literal> for the fractional
569 seconds precision of interval type attributes)
574 <entry role=
"catalog_table_entry"><para role=
"column_definition">
575 <structfield>attribute_udt_catalog
</structfield> <type>sql_identifier
</type>
578 Name of the database that the attribute data type is defined in
579 (always the current database)
584 <entry role=
"catalog_table_entry"><para role=
"column_definition">
585 <structfield>attribute_udt_schema
</structfield> <type>sql_identifier
</type>
588 Name of the schema that the attribute data type is defined in
593 <entry role=
"catalog_table_entry"><para role=
"column_definition">
594 <structfield>attribute_udt_name
</structfield> <type>sql_identifier
</type>
597 Name of the attribute data type
602 <entry role=
"catalog_table_entry"><para role=
"column_definition">
603 <structfield>scope_catalog
</structfield> <type>sql_identifier
</type>
606 Applies to a feature not available in
<productname>PostgreSQL
</productname>
611 <entry role=
"catalog_table_entry"><para role=
"column_definition">
612 <structfield>scope_schema
</structfield> <type>sql_identifier
</type>
615 Applies to a feature not available in
<productname>PostgreSQL
</productname>
620 <entry role=
"catalog_table_entry"><para role=
"column_definition">
621 <structfield>scope_name
</structfield> <type>sql_identifier
</type>
624 Applies to a feature not available in
<productname>PostgreSQL
</productname>
629 <entry role=
"catalog_table_entry"><para role=
"column_definition">
630 <structfield>maximum_cardinality
</structfield> <type>cardinal_number
</type>
633 Always null, because arrays always have unlimited maximum cardinality in
<productname>PostgreSQL
</productname>
638 <entry role=
"catalog_table_entry"><para role=
"column_definition">
639 <structfield>dtd_identifier
</structfield> <type>sql_identifier
</type>
642 An identifier of the data type descriptor of the attribute, unique
643 among the data type descriptors pertaining to the composite type. This
644 is mainly useful for joining with other instances of such
645 identifiers. (The specific format of the identifier is not
646 defined and not guaranteed to remain the same in future
652 <entry role=
"catalog_table_entry"><para role=
"column_definition">
653 <structfield>is_derived_reference_attribute
</structfield> <type>yes_or_no
</type>
656 Applies to a feature not available in
<productname>PostgreSQL
</productname>
664 See also under
<xref linkend=
"infoschema-columns"/>, a similarly
665 structured view, for further information on some of the columns.
669 <sect1 id=
"infoschema-character-sets">
670 <title><literal>character_sets
</literal></title>
673 The view
<literal>character_sets
</literal> identifies the character
674 sets available in the current database. Since PostgreSQL does not
675 support multiple character sets within one database, this view only
676 shows one, which is the database encoding.
680 Take note of how the following terms are used in the SQL standard:
683 <term>character repertoire
</term>
686 An abstract collection of characters, for
687 example
<literal>UNICODE
</literal>,
<literal>UCS
</literal>, or
688 <literal>LATIN1
</literal>. Not exposed as an SQL object, but
689 visible in this view.
695 <term>character encoding form
</term>
698 An encoding of some character repertoire. Most older character
699 repertoires only use one encoding form, and so there are no
700 separate names for them (e.g.,
<literal>LATIN2
</literal> is an
701 encoding form applicable to the
<literal>LATIN2
</literal>
702 repertoire). But for example Unicode has the encoding forms
703 <literal>UTF8
</literal>,
<literal>UTF16
</literal>, etc. (not
704 all supported by PostgreSQL). Encoding forms are not exposed
705 as an SQL object, but are visible in this view.
711 <term>character set
</term>
714 A named SQL object that identifies a character repertoire, a
715 character encoding, and a default collation. A predefined
716 character set would typically have the same name as an encoding
717 form, but users could define other names. For example, the
718 character set
<literal>UTF8
</literal> would typically identify
719 the character repertoire
<literal>UCS
</literal>, encoding
720 form
<literal>UTF8
</literal>, and some default collation.
726 You can think of an
<quote>encoding
</quote> in PostgreSQL either as
727 a character set or a character encoding form. They will have the
728 same name, and there can only be one in one database.
732 <title><structname>character_sets
</structname> Columns
</title>
736 <entry role=
"catalog_table_entry"><para role=
"column_definition">
747 <entry role=
"catalog_table_entry"><para role=
"column_definition">
748 <structfield>character_set_catalog
</structfield> <type>sql_identifier
</type>
751 Character sets are currently not implemented as schema objects, so this column is null.
756 <entry role=
"catalog_table_entry"><para role=
"column_definition">
757 <structfield>character_set_schema
</structfield> <type>sql_identifier
</type>
760 Character sets are currently not implemented as schema objects, so this column is null.
765 <entry role=
"catalog_table_entry"><para role=
"column_definition">
766 <structfield>character_set_name
</structfield> <type>sql_identifier
</type>
769 Name of the character set, currently implemented as showing the name of the database encoding
774 <entry role=
"catalog_table_entry"><para role=
"column_definition">
775 <structfield>character_repertoire
</structfield> <type>sql_identifier
</type>
778 Character repertoire, showing
<literal>UCS
</literal> if the encoding is
<literal>UTF8
</literal>, else just the encoding name
783 <entry role=
"catalog_table_entry"><para role=
"column_definition">
784 <structfield>form_of_use
</structfield> <type>sql_identifier
</type>
787 Character encoding form, same as the database encoding
792 <entry role=
"catalog_table_entry"><para role=
"column_definition">
793 <structfield>default_collate_catalog
</structfield> <type>sql_identifier
</type>
796 Name of the database containing the default collation (always the current database, if any collation is identified)
801 <entry role=
"catalog_table_entry"><para role=
"column_definition">
802 <structfield>default_collate_schema
</structfield> <type>sql_identifier
</type>
805 Name of the schema containing the default collation
810 <entry role=
"catalog_table_entry"><para role=
"column_definition">
811 <structfield>default_collate_name
</structfield> <type>sql_identifier
</type>
814 Name of the default collation. The default collation is
815 identified as the collation that matches
816 the
<literal>COLLATE
</literal> and
<literal>CTYPE
</literal>
817 settings of the current database. If there is no such
818 collation, then this column and the associated schema and
819 catalog columns are null.
827 <sect1 id=
"infoschema-check-constraint-routine-usage">
828 <title><literal>check_constraint_routine_usage
</literal></title>
831 The view
<literal>check_constraint_routine_usage
</literal>
832 identifies routines (functions and procedures) that are used by a
833 check constraint. Only those routines are shown that are owned by
834 a currently enabled role.
838 <title><structname>check_constraint_routine_usage
</structname> Columns
</title>
842 <entry role=
"catalog_table_entry"><para role=
"column_definition">
853 <entry role=
"catalog_table_entry"><para role=
"column_definition">
854 <structfield>constraint_catalog
</structfield> <type>sql_identifier
</type>
857 Name of the database containing the constraint (always the current database)
862 <entry role=
"catalog_table_entry"><para role=
"column_definition">
863 <structfield>constraint_schema
</structfield> <type>sql_identifier
</type>
866 Name of the schema containing the constraint
871 <entry role=
"catalog_table_entry"><para role=
"column_definition">
872 <structfield>constraint_name
</structfield> <type>sql_identifier
</type>
875 Name of the constraint
880 <entry role=
"catalog_table_entry"><para role=
"column_definition">
881 <structfield>specific_catalog
</structfield> <type>sql_identifier
</type>
884 Name of the database containing the function (always the current database)
889 <entry role=
"catalog_table_entry"><para role=
"column_definition">
890 <structfield>specific_schema
</structfield> <type>sql_identifier
</type>
893 Name of the schema containing the function
898 <entry role=
"catalog_table_entry"><para role=
"column_definition">
899 <structfield>specific_name
</structfield> <type>sql_identifier
</type>
902 The
<quote>specific name
</quote> of the function. See
<xref linkend=
"infoschema-routines"/> for more information.
910 <sect1 id=
"infoschema-check-constraints">
911 <title><literal>check_constraints
</literal></title>
914 The view
<literal>check_constraints
</literal> contains all check
915 constraints, either defined on a table or on a domain, that are
916 owned by a currently enabled role. (The owner of the table or
917 domain is the owner of the constraint.)
921 The SQL standard considers not-null constraints to be check constraints
922 with a
<literal>CHECK (
<replaceable>column_name
</replaceable> IS NOT
923 NULL)
</literal> expression. So not-null constraints are also included here
924 and don't have a separate view.
928 <title><structname>check_constraints
</structname> Columns
</title>
932 <entry role=
"catalog_table_entry"><para role=
"column_definition">
943 <entry role=
"catalog_table_entry"><para role=
"column_definition">
944 <structfield>constraint_catalog
</structfield> <type>sql_identifier
</type>
947 Name of the database containing the constraint (always the current database)
952 <entry role=
"catalog_table_entry"><para role=
"column_definition">
953 <structfield>constraint_schema
</structfield> <type>sql_identifier
</type>
956 Name of the schema containing the constraint
961 <entry role=
"catalog_table_entry"><para role=
"column_definition">
962 <structfield>constraint_name
</structfield> <type>sql_identifier
</type>
965 Name of the constraint
970 <entry role=
"catalog_table_entry"><para role=
"column_definition">
971 <structfield>check_clause
</structfield> <type>character_data
</type>
974 The check expression of the check constraint
982 <sect1 id=
"infoschema-collations">
983 <title><literal>collations
</literal></title>
986 The view
<literal>collations
</literal> contains the collations
987 available in the current database.
991 <title><structname>collations
</structname> Columns
</title>
995 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1006 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1007 <structfield>collation_catalog
</structfield> <type>sql_identifier
</type>
1010 Name of the database containing the collation (always the current database)
1015 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1016 <structfield>collation_schema
</structfield> <type>sql_identifier
</type>
1019 Name of the schema containing the collation
1024 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1025 <structfield>collation_name
</structfield> <type>sql_identifier
</type>
1028 Name of the default collation
1033 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1034 <structfield>pad_attribute
</structfield> <type>character_data
</type>
1037 Always
<literal>NO PAD
</literal> (The alternative
<literal>PAD
1038 SPACE
</literal> is not supported by PostgreSQL.)
1046 <sect1 id=
"infoschema-collation-character-set-applicab"> <!-- max 44 characters -->
1047 <title><literal>collation_character_set_
&zwsp;applicability
</literal></title>
1050 The view
<literal>collation_character_set_applicability
</literal>
1051 identifies which character set the available collations are
1052 applicable to. In PostgreSQL, there is only one character set per
1053 database (see explanation
1054 in
<xref linkend=
"infoschema-character-sets"/>), so this view does
1055 not provide much useful information.
1059 <title><structname>collation_character_set_applicability
</structname> Columns
</title>
1063 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1074 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1075 <structfield>collation_catalog
</structfield> <type>sql_identifier
</type>
1078 Name of the database containing the collation (always the current database)
1083 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1084 <structfield>collation_schema
</structfield> <type>sql_identifier
</type>
1087 Name of the schema containing the collation
1092 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1093 <structfield>collation_name
</structfield> <type>sql_identifier
</type>
1096 Name of the default collation
1101 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1102 <structfield>character_set_catalog
</structfield> <type>sql_identifier
</type>
1105 Character sets are currently not implemented as schema objects, so this column is null
1110 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1111 <structfield>character_set_schema
</structfield> <type>sql_identifier
</type>
1114 Character sets are currently not implemented as schema objects, so this column is null
1119 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1120 <structfield>character_set_name
</structfield> <type>sql_identifier
</type>
1123 Name of the character set
1131 <sect1 id=
"infoschema-column-column-usage">
1132 <title><literal>column_column_usage
</literal></title>
1135 The view
<literal>column_column_usage
</literal> identifies all generated
1136 columns that depend on another base column in the same table. Only tables
1137 owned by a currently enabled role are included.
1141 <title><structname>column_column_usage
</structname> Columns
</title>
1145 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1156 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1157 <structfield>table_catalog
</structfield> <type>sql_identifier
</type>
1160 Name of the database containing the table (always the current database)
1165 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1166 <structfield>table_schema
</structfield> <type>sql_identifier
</type>
1169 Name of the schema containing the table
1174 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1175 <structfield>table_name
</structfield> <type>sql_identifier
</type>
1183 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1184 <structfield>column_name
</structfield> <type>sql_identifier
</type>
1187 Name of the base column that a generated column depends on
1192 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1193 <structfield>dependent_column
</structfield> <type>sql_identifier
</type>
1196 Name of the generated column
1204 <sect1 id=
"infoschema-column-domain-usage">
1205 <title><literal>column_domain_usage
</literal></title>
1208 The view
<literal>column_domain_usage
</literal> identifies all
1209 columns (of a table or a view) that make use of some domain defined
1210 in the current database and owned by a currently enabled role.
1214 <title><structname>column_domain_usage
</structname> Columns
</title>
1218 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1229 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1230 <structfield>domain_catalog
</structfield> <type>sql_identifier
</type>
1233 Name of the database containing the domain (always the current database)
1238 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1239 <structfield>domain_schema
</structfield> <type>sql_identifier
</type>
1242 Name of the schema containing the domain
1247 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1248 <structfield>domain_name
</structfield> <type>sql_identifier
</type>
1256 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1257 <structfield>table_catalog
</structfield> <type>sql_identifier
</type>
1260 Name of the database containing the table (always the current database)
1265 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1266 <structfield>table_schema
</structfield> <type>sql_identifier
</type>
1269 Name of the schema containing the table
1274 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1275 <structfield>table_name
</structfield> <type>sql_identifier
</type>
1283 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1284 <structfield>column_name
</structfield> <type>sql_identifier
</type>
1295 <sect1 id=
"infoschema-column-options">
1296 <title><literal>column_options
</literal></title>
1299 The view
<literal>column_options
</literal> contains all the
1300 options defined for foreign table columns in the current database. Only
1301 those foreign table columns are shown that the current user has access to
1302 (by way of being the owner or having some privilege).
1306 <title><structname>column_options
</structname> Columns
</title>
1310 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1321 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1322 <structfield>table_catalog
</structfield> <type>sql_identifier
</type>
1325 Name of the database that contains the foreign table (always the current database)
1330 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1331 <structfield>table_schema
</structfield> <type>sql_identifier
</type>
1334 Name of the schema that contains the foreign table
1339 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1340 <structfield>table_name
</structfield> <type>sql_identifier
</type>
1343 Name of the foreign table
1348 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1349 <structfield>column_name
</structfield> <type>sql_identifier
</type>
1357 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1358 <structfield>option_name
</structfield> <type>sql_identifier
</type>
1366 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1367 <structfield>option_value
</structfield> <type>character_data
</type>
1378 <sect1 id=
"infoschema-column-privileges">
1379 <title><literal>column_privileges
</literal></title>
1382 The view
<literal>column_privileges
</literal> identifies all
1383 privileges granted on columns to a currently enabled role or by a
1384 currently enabled role. There is one row for each combination of
1385 column, grantor, and grantee.
1389 If a privilege has been granted on an entire table, it will show up in
1390 this view as a grant for each column, but only for the
1391 privilege types where column granularity is possible:
1392 <literal>SELECT
</literal>,
<literal>INSERT
</literal>,
1393 <literal>UPDATE
</literal>,
<literal>REFERENCES
</literal>.
1397 <title><structname>column_privileges
</structname> Columns
</title>
1401 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1412 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1413 <structfield>grantor
</structfield> <type>sql_identifier
</type>
1416 Name of the role that granted the privilege
1421 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1422 <structfield>grantee
</structfield> <type>sql_identifier
</type>
1425 Name of the role that the privilege was granted to
1430 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1431 <structfield>table_catalog
</structfield> <type>sql_identifier
</type>
1434 Name of the database that contains the table that contains the column (always the current database)
1439 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1440 <structfield>table_schema
</structfield> <type>sql_identifier
</type>
1443 Name of the schema that contains the table that contains the column
1448 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1449 <structfield>table_name
</structfield> <type>sql_identifier
</type>
1452 Name of the table that contains the column
1457 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1458 <structfield>column_name
</structfield> <type>sql_identifier
</type>
1466 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1467 <structfield>privilege_type
</structfield> <type>character_data
</type>
1470 Type of the privilege:
<literal>SELECT
</literal>,
1471 <literal>INSERT
</literal>,
<literal>UPDATE
</literal>, or
1472 <literal>REFERENCES
</literal>
1477 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1478 <structfield>is_grantable
</structfield> <type>yes_or_no
</type>
1481 <literal>YES
</literal> if the privilege is grantable,
<literal>NO
</literal> if not
1489 <sect1 id=
"infoschema-column-udt-usage">
1490 <title><literal>column_udt_usage
</literal></title>
1493 The view
<literal>column_udt_usage
</literal> identifies all columns
1494 that use data types owned by a currently enabled role. Note that in
1495 <productname>PostgreSQL
</productname>, built-in data types behave
1496 like user-defined types, so they are included here as well. See
1497 also
<xref linkend=
"infoschema-columns"/> for details.
1501 <title><structname>column_udt_usage
</structname> Columns
</title>
1505 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1516 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1517 <structfield>udt_catalog
</structfield> <type>sql_identifier
</type>
1520 Name of the database that the column data type (the underlying
1521 type of the domain, if applicable) is defined in (always the
1527 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1528 <structfield>udt_schema
</structfield> <type>sql_identifier
</type>
1531 Name of the schema that the column data type (the underlying
1532 type of the domain, if applicable) is defined in
1537 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1538 <structfield>udt_name
</structfield> <type>sql_identifier
</type>
1541 Name of the column data type (the underlying type of the
1542 domain, if applicable)
1547 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1548 <structfield>table_catalog
</structfield> <type>sql_identifier
</type>
1551 Name of the database containing the table (always the current database)
1556 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1557 <structfield>table_schema
</structfield> <type>sql_identifier
</type>
1560 Name of the schema containing the table
1565 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1566 <structfield>table_name
</structfield> <type>sql_identifier
</type>
1574 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1575 <structfield>column_name
</structfield> <type>sql_identifier
</type>
1586 <sect1 id=
"infoschema-columns">
1587 <title><literal>columns
</literal></title>
1590 The view
<literal>columns
</literal> contains information about all
1591 table columns (or view columns) in the database. System columns
1592 (
<literal>ctid
</literal>, etc.) are not included. Only those columns are
1593 shown that the current user has access to (by way of being the
1594 owner or having some privilege).
1598 <title><structname>columns
</structname> Columns
</title>
1602 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1613 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1614 <structfield>table_catalog
</structfield> <type>sql_identifier
</type>
1617 Name of the database containing the table (always the current database)
1622 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1623 <structfield>table_schema
</structfield> <type>sql_identifier
</type>
1626 Name of the schema containing the table
1631 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1632 <structfield>table_name
</structfield> <type>sql_identifier
</type>
1640 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1641 <structfield>column_name
</structfield> <type>sql_identifier
</type>
1649 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1650 <structfield>ordinal_position
</structfield> <type>cardinal_number
</type>
1653 Ordinal position of the column within the table (count starts at
1)
1658 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1659 <structfield>column_default
</structfield> <type>character_data
</type>
1662 Default expression of the column
1667 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1668 <structfield>is_nullable
</structfield> <type>yes_or_no
</type>
1671 <literal>YES
</literal> if the column is possibly nullable,
1672 <literal>NO
</literal> if it is known not nullable. A not-null
1673 constraint is one way a column can be known not nullable, but
1674 there can be others.
1679 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1680 <structfield>data_type
</structfield> <type>character_data
</type>
1683 Data type of the column, if it is a built-in type, or
1684 <literal>ARRAY
</literal> if it is some array (in that case, see
1685 the view
<literal>element_types
</literal>), else
1686 <literal>USER-DEFINED
</literal> (in that case, the type is
1687 identified in
<literal>udt_name
</literal> and associated
1688 columns). If the column is based on a domain, this column
1689 refers to the type underlying the domain (and the domain is
1690 identified in
<literal>domain_name
</literal> and associated
1696 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1697 <structfield>character_maximum_length
</structfield> <type>cardinal_number
</type>
1700 If
<literal>data_type
</literal> identifies a character or bit
1701 string type, the declared maximum length; null for all other
1702 data types or if no maximum length was declared.
1707 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1708 <structfield>character_octet_length
</structfield> <type>cardinal_number
</type>
1711 If
<literal>data_type
</literal> identifies a character type,
1712 the maximum possible length in octets (bytes) of a datum; null
1713 for all other data types. The maximum octet length depends on
1714 the declared character maximum length (see above) and the
1720 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1721 <structfield>numeric_precision
</structfield> <type>cardinal_number
</type>
1724 If
<literal>data_type
</literal> identifies a numeric type, this
1725 column contains the (declared or implicit) precision of the
1726 type for this column. The precision indicates the number of
1727 significant digits. It can be expressed in decimal (base
10)
1728 or binary (base
2) terms, as specified in the column
1729 <literal>numeric_precision_radix
</literal>. For all other data
1730 types, this column is null.
1735 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1736 <structfield>numeric_precision_radix
</structfield> <type>cardinal_number
</type>
1739 If
<literal>data_type
</literal> identifies a numeric type, this
1740 column indicates in which base the values in the columns
1741 <literal>numeric_precision
</literal> and
1742 <literal>numeric_scale
</literal> are expressed. The value is
1743 either
2 or
10. For all other data types, this column is null.
1748 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1749 <structfield>numeric_scale
</structfield> <type>cardinal_number
</type>
1752 If
<literal>data_type
</literal> identifies an exact numeric
1753 type, this column contains the (declared or implicit) scale of
1754 the type for this column. The scale indicates the number of
1755 significant digits to the right of the decimal point. It can
1756 be expressed in decimal (base
10) or binary (base
2) terms, as
1757 specified in the column
1758 <literal>numeric_precision_radix
</literal>. For all other data
1759 types, this column is null.
1764 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1765 <structfield>datetime_precision
</structfield> <type>cardinal_number
</type>
1768 If
<literal>data_type
</literal> identifies a date, time,
1769 timestamp, or interval type, this column contains the (declared
1770 or implicit) fractional seconds precision of the type for this
1771 column, that is, the number of decimal digits maintained
1772 following the decimal point in the seconds value. For all
1773 other data types, this column is null.
1778 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1779 <structfield>interval_type
</structfield> <type>character_data
</type>
1782 If
<literal>data_type
</literal> identifies an interval type,
1783 this column contains the specification which fields the
1784 intervals include for this column, e.g.,
<literal>YEAR TO
1785 MONTH
</literal>,
<literal>DAY TO SECOND
</literal>, etc. If no
1786 field restrictions were specified (that is, the interval
1787 accepts all fields), and for all other data types, this field
1793 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1794 <structfield>interval_precision
</structfield> <type>cardinal_number
</type>
1797 Applies to a feature not available
1798 in
<productname>PostgreSQL
</productname>
1799 (see
<literal>datetime_precision
</literal> for the fractional
1800 seconds precision of interval type columns)
1805 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1806 <structfield>character_set_catalog
</structfield> <type>sql_identifier
</type>
1809 Applies to a feature not available in
<productname>PostgreSQL
</productname>
1814 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1815 <structfield>character_set_schema
</structfield> <type>sql_identifier
</type>
1818 Applies to a feature not available in
<productname>PostgreSQL
</productname>
1823 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1824 <structfield>character_set_name
</structfield> <type>sql_identifier
</type>
1827 Applies to a feature not available in
<productname>PostgreSQL
</productname>
1832 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1833 <structfield>collation_catalog
</structfield> <type>sql_identifier
</type>
1836 Name of the database containing the collation of the column
1837 (always the current database), null if default or the data type
1838 of the column is not collatable
1843 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1844 <structfield>collation_schema
</structfield> <type>sql_identifier
</type>
1847 Name of the schema containing the collation of the column, null
1848 if default or the data type of the column is not collatable
1853 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1854 <structfield>collation_name
</structfield> <type>sql_identifier
</type>
1857 Name of the collation of the column, null if default or the
1858 data type of the column is not collatable
1863 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1864 <structfield>domain_catalog
</structfield> <type>sql_identifier
</type>
1867 If the column has a domain type, the name of the database that
1868 the domain is defined in (always the current database), else
1874 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1875 <structfield>domain_schema
</structfield> <type>sql_identifier
</type>
1878 If the column has a domain type, the name of the schema that
1879 the domain is defined in, else null.
1884 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1885 <structfield>domain_name
</structfield> <type>sql_identifier
</type>
1888 If the column has a domain type, the name of the domain, else null.
1893 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1894 <structfield>udt_catalog
</structfield> <type>sql_identifier
</type>
1897 Name of the database that the column data type (the underlying
1898 type of the domain, if applicable) is defined in (always the
1904 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1905 <structfield>udt_schema
</structfield> <type>sql_identifier
</type>
1908 Name of the schema that the column data type (the underlying
1909 type of the domain, if applicable) is defined in
1914 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1915 <structfield>udt_name
</structfield> <type>sql_identifier
</type>
1918 Name of the column data type (the underlying type of the
1919 domain, if applicable)
1924 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1925 <structfield>scope_catalog
</structfield> <type>sql_identifier
</type>
1928 Applies to a feature not available in
<productname>PostgreSQL
</productname>
1933 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1934 <structfield>scope_schema
</structfield> <type>sql_identifier
</type>
1937 Applies to a feature not available in
<productname>PostgreSQL
</productname>
1942 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1943 <structfield>scope_name
</structfield> <type>sql_identifier
</type>
1946 Applies to a feature not available in
<productname>PostgreSQL
</productname>
1951 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1952 <structfield>maximum_cardinality
</structfield> <type>cardinal_number
</type>
1955 Always null, because arrays always have unlimited maximum cardinality in
<productname>PostgreSQL
</productname>
1960 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1961 <structfield>dtd_identifier
</structfield> <type>sql_identifier
</type>
1964 An identifier of the data type descriptor of the column, unique
1965 among the data type descriptors pertaining to the table. This
1966 is mainly useful for joining with other instances of such
1967 identifiers. (The specific format of the identifier is not
1968 defined and not guaranteed to remain the same in future
1974 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1975 <structfield>is_self_referencing
</structfield> <type>yes_or_no
</type>
1978 Applies to a feature not available in
<productname>PostgreSQL
</productname>
1983 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1984 <structfield>is_identity
</structfield> <type>yes_or_no
</type>
1987 If the column is an identity column, then
<literal>YES
</literal>,
1988 else
<literal>NO
</literal>.
1993 <entry role=
"catalog_table_entry"><para role=
"column_definition">
1994 <structfield>identity_generation
</structfield> <type>character_data
</type>
1997 If the column is an identity column, then
<literal>ALWAYS
</literal>
1998 or
<literal>BY DEFAULT
</literal>, reflecting the definition of the
2004 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2005 <structfield>identity_start
</structfield> <type>character_data
</type>
2008 If the column is an identity column, then the start value of the
2009 internal sequence, else null.
2014 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2015 <structfield>identity_increment
</structfield> <type>character_data
</type>
2018 If the column is an identity column, then the increment of the internal
2019 sequence, else null.
2024 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2025 <structfield>identity_maximum
</structfield> <type>character_data
</type>
2028 If the column is an identity column, then the maximum value of the
2029 internal sequence, else null.
2034 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2035 <structfield>identity_minimum
</structfield> <type>character_data
</type>
2038 If the column is an identity column, then the minimum value of the
2039 internal sequence, else null.
2044 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2045 <structfield>identity_cycle
</structfield> <type>yes_or_no
</type>
2048 If the column is an identity column, then
<literal>YES
</literal> if the
2049 internal sequence cycles or
<literal>NO
</literal> if it does not;
2055 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2056 <structfield>is_generated
</structfield> <type>character_data
</type>
2059 If the column is a generated column, then
<literal>ALWAYS
</literal>,
2060 else
<literal>NEVER
</literal>.
2065 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2066 <structfield>generation_expression
</structfield> <type>character_data
</type>
2069 If the column is a generated column, then the generation expression,
2075 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2076 <structfield>is_updatable
</structfield> <type>yes_or_no
</type>
2079 <literal>YES
</literal> if the column is updatable,
2080 <literal>NO
</literal> if not (Columns in base tables are always
2081 updatable, columns in views not necessarily)
2089 Since data types can be defined in a variety of ways in SQL, and
2090 <productname>PostgreSQL
</productname> contains additional ways to
2091 define data types, their representation in the information schema
2092 can be somewhat difficult. The column
<literal>data_type
</literal>
2093 is supposed to identify the underlying built-in type of the column.
2094 In
<productname>PostgreSQL
</productname>, this means that the type
2095 is defined in the system catalog schema
2096 <literal>pg_catalog
</literal>. This column might be useful if the
2097 application can handle the well-known built-in types specially (for
2098 example, format the numeric types differently or use the data in
2099 the precision columns). The columns
<literal>udt_name
</literal>,
2100 <literal>udt_schema
</literal>, and
<literal>udt_catalog
</literal>
2101 always identify the underlying data type of the column, even if the
2102 column is based on a domain. (Since
2103 <productname>PostgreSQL
</productname> treats built-in types like
2104 user-defined types, built-in types appear here as well. This is an
2105 extension of the SQL standard.) These columns should be used if an
2106 application wants to process data differently according to the
2107 type, because in that case it wouldn't matter if the column is
2108 really based on a domain. If the column is based on a domain, the
2109 identity of the domain is stored in the columns
2110 <literal>domain_name
</literal>,
<literal>domain_schema
</literal>,
2111 and
<literal>domain_catalog
</literal>. If you want to pair up
2112 columns with their associated data types and treat domains as
2113 separate types, you could write
<literal>coalesce(domain_name,
2114 udt_name)
</literal>, etc.
2118 <sect1 id=
"infoschema-constraint-column-usage">
2119 <title><literal>constraint_column_usage
</literal></title>
2122 The view
<literal>constraint_column_usage
</literal> identifies all
2123 columns in the current database that are used by some constraint.
2124 Only those columns are shown that are contained in a table owned by
2125 a currently enabled role. For a check constraint, this view
2126 identifies the columns that are used in the check expression. For a
2127 not-null constraint, this view identifies the column that the constraint is
2129 a foreign key constraint, this view identifies the columns that the
2130 foreign key references. For a unique or primary key constraint,
2131 this view identifies the constrained columns.
2135 <title><structname>constraint_column_usage
</structname> Columns
</title>
2139 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2150 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2151 <structfield>table_catalog
</structfield> <type>sql_identifier
</type>
2154 Name of the database that contains the table that contains the
2155 column that is used by some constraint (always the current
2161 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2162 <structfield>table_schema
</structfield> <type>sql_identifier
</type>
2165 Name of the schema that contains the table that contains the
2166 column that is used by some constraint
2171 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2172 <structfield>table_name
</structfield> <type>sql_identifier
</type>
2175 Name of the table that contains the column that is used by some
2181 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2182 <structfield>column_name
</structfield> <type>sql_identifier
</type>
2185 Name of the column that is used by some constraint
2190 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2191 <structfield>constraint_catalog
</structfield> <type>sql_identifier
</type>
2194 Name of the database that contains the constraint (always the current database)
2199 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2200 <structfield>constraint_schema
</structfield> <type>sql_identifier
</type>
2203 Name of the schema that contains the constraint
2208 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2209 <structfield>constraint_name
</structfield> <type>sql_identifier
</type>
2212 Name of the constraint
2220 <sect1 id=
"infoschema-constraint-table-usage">
2221 <title><literal>constraint_table_usage
</literal></title>
2224 The view
<literal>constraint_table_usage
</literal> identifies all
2225 tables in the current database that are used by some constraint and
2226 are owned by a currently enabled role. (This is different from the
2227 view
<literal>table_constraints
</literal>, which identifies all
2228 table constraints along with the table they are defined on.) For a
2229 foreign key constraint, this view identifies the table that the
2230 foreign key references. For a unique or primary key constraint,
2231 this view simply identifies the table the constraint belongs to.
2232 Check constraints and not-null constraints are not included in this
2237 <title><structname>constraint_table_usage
</structname> Columns
</title>
2241 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2252 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2253 <structfield>table_catalog
</structfield> <type>sql_identifier
</type>
2256 Name of the database that contains the table that is used by
2257 some constraint (always the current database)
2262 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2263 <structfield>table_schema
</structfield> <type>sql_identifier
</type>
2266 Name of the schema that contains the table that is used by some
2272 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2273 <structfield>table_name
</structfield> <type>sql_identifier
</type>
2276 Name of the table that is used by some constraint
2281 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2282 <structfield>constraint_catalog
</structfield> <type>sql_identifier
</type>
2285 Name of the database that contains the constraint (always the current database)
2290 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2291 <structfield>constraint_schema
</structfield> <type>sql_identifier
</type>
2294 Name of the schema that contains the constraint
2299 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2300 <structfield>constraint_name
</structfield> <type>sql_identifier
</type>
2303 Name of the constraint
2311 <sect1 id=
"infoschema-data-type-privileges">
2312 <title><literal>data_type_privileges
</literal></title>
2315 The view
<literal>data_type_privileges
</literal> identifies all
2316 data type descriptors that the current user has access to, by way
2317 of being the owner of the described object or having some privilege
2318 for it. A data type descriptor is generated whenever a data type
2319 is used in the definition of a table column, a domain, or a
2320 function (as parameter or return type) and stores some information
2321 about how the data type is used in that instance (for example, the
2322 declared maximum length, if applicable). Each data type
2323 descriptor is assigned an arbitrary identifier that is unique
2324 among the data type descriptor identifiers assigned for one object
2325 (table, domain, function). This view is probably not useful for
2326 applications, but it is used to define some other views in the
2331 <title><structname>data_type_privileges
</structname> Columns
</title>
2335 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2346 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2347 <structfield>object_catalog
</structfield> <type>sql_identifier
</type>
2350 Name of the database that contains the described object (always the current database)
2355 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2356 <structfield>object_schema
</structfield> <type>sql_identifier
</type>
2359 Name of the schema that contains the described object
2364 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2365 <structfield>object_name
</structfield> <type>sql_identifier
</type>
2368 Name of the described object
2373 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2374 <structfield>object_type
</structfield> <type>character_data
</type>
2377 The type of the described object: one of
2378 <literal>TABLE
</literal> (the data type descriptor pertains to
2379 a column of that table),
<literal>DOMAIN
</literal> (the data
2380 type descriptors pertains to that domain),
2381 <literal>ROUTINE
</literal> (the data type descriptor pertains
2382 to a parameter or the return data type of that function).
2387 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2388 <structfield>dtd_identifier
</structfield> <type>sql_identifier
</type>
2391 The identifier of the data type descriptor, which is unique
2392 among the data type descriptors for that same object.
2400 <sect1 id=
"infoschema-domain-constraints">
2401 <title><literal>domain_constraints
</literal></title>
2404 The view
<literal>domain_constraints
</literal> contains all constraints
2405 belonging to domains defined in the current database. Only those domains
2406 are shown that the current user has access to (by way of being the owner or
2407 having some privilege).
2411 <title><structname>domain_constraints
</structname> Columns
</title>
2415 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2426 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2427 <structfield>constraint_catalog
</structfield> <type>sql_identifier
</type>
2430 Name of the database that contains the constraint (always the current database)
2435 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2436 <structfield>constraint_schema
</structfield> <type>sql_identifier
</type>
2439 Name of the schema that contains the constraint
2444 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2445 <structfield>constraint_name
</structfield> <type>sql_identifier
</type>
2448 Name of the constraint
2453 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2454 <structfield>domain_catalog
</structfield> <type>sql_identifier
</type>
2457 Name of the database that contains the domain (always the current database)
2462 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2463 <structfield>domain_schema
</structfield> <type>sql_identifier
</type>
2466 Name of the schema that contains the domain
2471 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2472 <structfield>domain_name
</structfield> <type>sql_identifier
</type>
2480 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2481 <structfield>is_deferrable
</structfield> <type>yes_or_no
</type>
2484 <literal>YES
</literal> if the constraint is deferrable,
<literal>NO
</literal> if not
2489 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2490 <structfield>initially_deferred
</structfield> <type>yes_or_no
</type>
2493 <literal>YES
</literal> if the constraint is deferrable and initially deferred,
<literal>NO
</literal> if not
2501 <sect1 id=
"infoschema-domain-udt-usage">
2502 <title><literal>domain_udt_usage
</literal></title>
2505 The view
<literal>domain_udt_usage
</literal> identifies all domains
2506 that are based on data types owned by a currently enabled role.
2507 Note that in
<productname>PostgreSQL
</productname>, built-in data
2508 types behave like user-defined types, so they are included here as
2513 <title><structname>domain_udt_usage
</structname> Columns
</title>
2517 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2528 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2529 <structfield>udt_catalog
</structfield> <type>sql_identifier
</type>
2532 Name of the database that the domain data type is defined in (always the current database)
2537 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2538 <structfield>udt_schema
</structfield> <type>sql_identifier
</type>
2541 Name of the schema that the domain data type is defined in
2546 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2547 <structfield>udt_name
</structfield> <type>sql_identifier
</type>
2550 Name of the domain data type
2555 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2556 <structfield>domain_catalog
</structfield> <type>sql_identifier
</type>
2559 Name of the database that contains the domain (always the current database)
2564 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2565 <structfield>domain_schema
</structfield> <type>sql_identifier
</type>
2568 Name of the schema that contains the domain
2573 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2574 <structfield>domain_name
</structfield> <type>sql_identifier
</type>
2585 <sect1 id=
"infoschema-domains">
2586 <title><literal>domains
</literal></title>
2589 The view
<literal>domains
</literal> contains all
2590 <glossterm linkend=
"glossary-domain">domains
</glossterm> defined in the
2591 current database. Only those domains are shown that the current user has
2592 access to (by way of being the owner or having some privilege).
2596 <title><structname>domains
</structname> Columns
</title>
2600 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2611 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2612 <structfield>domain_catalog
</structfield> <type>sql_identifier
</type>
2615 Name of the database that contains the domain (always the current database)
2620 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2621 <structfield>domain_schema
</structfield> <type>sql_identifier
</type>
2624 Name of the schema that contains the domain
2629 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2630 <structfield>domain_name
</structfield> <type>sql_identifier
</type>
2638 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2639 <structfield>data_type
</structfield> <type>character_data
</type>
2642 Data type of the domain, if it is a built-in type, or
2643 <literal>ARRAY
</literal> if it is some array (in that case, see
2644 the view
<literal>element_types
</literal>), else
2645 <literal>USER-DEFINED
</literal> (in that case, the type is
2646 identified in
<literal>udt_name
</literal> and associated
2652 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2653 <structfield>character_maximum_length
</structfield> <type>cardinal_number
</type>
2656 If the domain has a character or bit string type, the declared
2657 maximum length; null for all other data types or if no maximum
2658 length was declared.
2663 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2664 <structfield>character_octet_length
</structfield> <type>cardinal_number
</type>
2667 If the domain has a character type, the maximum possible length
2668 in octets (bytes) of a datum; null for all other data types.
2669 The maximum octet length depends on the declared character
2670 maximum length (see above) and the server encoding.
2675 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2676 <structfield>character_set_catalog
</structfield> <type>sql_identifier
</type>
2679 Applies to a feature not available in
<productname>PostgreSQL
</productname>
2684 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2685 <structfield>character_set_schema
</structfield> <type>sql_identifier
</type>
2688 Applies to a feature not available in
<productname>PostgreSQL
</productname>
2693 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2694 <structfield>character_set_name
</structfield> <type>sql_identifier
</type>
2697 Applies to a feature not available in
<productname>PostgreSQL
</productname>
2702 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2703 <structfield>collation_catalog
</structfield> <type>sql_identifier
</type>
2706 Name of the database containing the collation of the domain
2707 (always the current database), null if default or the data type
2708 of the domain is not collatable
2713 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2714 <structfield>collation_schema
</structfield> <type>sql_identifier
</type>
2717 Name of the schema containing the collation of the domain, null
2718 if default or the data type of the domain is not collatable
2723 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2724 <structfield>collation_name
</structfield> <type>sql_identifier
</type>
2727 Name of the collation of the domain, null if default or the
2728 data type of the domain is not collatable
2733 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2734 <structfield>numeric_precision
</structfield> <type>cardinal_number
</type>
2737 If the domain has a numeric type, this column contains the
2738 (declared or implicit) precision of the type for this domain.
2739 The precision indicates the number of significant digits. It
2740 can be expressed in decimal (base
10) or binary (base
2) terms,
2741 as specified in the column
2742 <literal>numeric_precision_radix
</literal>. For all other data
2743 types, this column is null.
2748 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2749 <structfield>numeric_precision_radix
</structfield> <type>cardinal_number
</type>
2752 If the domain has a numeric type, this column indicates in
2753 which base the values in the columns
2754 <literal>numeric_precision
</literal> and
2755 <literal>numeric_scale
</literal> are expressed. The value is
2756 either
2 or
10. For all other data types, this column is null.
2761 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2762 <structfield>numeric_scale
</structfield> <type>cardinal_number
</type>
2765 If the domain has an exact numeric type, this column contains
2766 the (declared or implicit) scale of the type for this domain.
2767 The scale indicates the number of significant digits to the
2768 right of the decimal point. It can be expressed in decimal
2769 (base
10) or binary (base
2) terms, as specified in the column
2770 <literal>numeric_precision_radix
</literal>. For all other data
2771 types, this column is null.
2776 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2777 <structfield>datetime_precision
</structfield> <type>cardinal_number
</type>
2780 If
<literal>data_type
</literal> identifies a date, time,
2781 timestamp, or interval type, this column contains the (declared
2782 or implicit) fractional seconds precision of the type for this
2783 domain, that is, the number of decimal digits maintained
2784 following the decimal point in the seconds value. For all
2785 other data types, this column is null.
2790 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2791 <structfield>interval_type
</structfield> <type>character_data
</type>
2794 If
<literal>data_type
</literal> identifies an interval type,
2795 this column contains the specification which fields the
2796 intervals include for this domain, e.g.,
<literal>YEAR TO
2797 MONTH
</literal>,
<literal>DAY TO SECOND
</literal>, etc. If no
2798 field restrictions were specified (that is, the interval
2799 accepts all fields), and for all other data types, this field
2805 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2806 <structfield>interval_precision
</structfield> <type>cardinal_number
</type>
2809 Applies to a feature not available
2810 in
<productname>PostgreSQL
</productname>
2811 (see
<literal>datetime_precision
</literal> for the fractional
2812 seconds precision of interval type domains)
2817 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2818 <structfield>domain_default
</structfield> <type>character_data
</type>
2821 Default expression of the domain
2826 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2827 <structfield>udt_catalog
</structfield> <type>sql_identifier
</type>
2830 Name of the database that the domain data type is defined in (always the current database)
2835 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2836 <structfield>udt_schema
</structfield> <type>sql_identifier
</type>
2839 Name of the schema that the domain data type is defined in
2844 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2845 <structfield>udt_name
</structfield> <type>sql_identifier
</type>
2848 Name of the domain data type
2853 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2854 <structfield>scope_catalog
</structfield> <type>sql_identifier
</type>
2857 Applies to a feature not available in
<productname>PostgreSQL
</productname>
2862 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2863 <structfield>scope_schema
</structfield> <type>sql_identifier
</type>
2866 Applies to a feature not available in
<productname>PostgreSQL
</productname>
2871 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2872 <structfield>scope_name
</structfield> <type>sql_identifier
</type>
2875 Applies to a feature not available in
<productname>PostgreSQL
</productname>
2880 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2881 <structfield>maximum_cardinality
</structfield> <type>cardinal_number
</type>
2884 Always null, because arrays always have unlimited maximum cardinality in
<productname>PostgreSQL
</productname>
2889 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2890 <structfield>dtd_identifier
</structfield> <type>sql_identifier
</type>
2893 An identifier of the data type descriptor of the domain, unique
2894 among the data type descriptors pertaining to the domain (which
2895 is trivial, because a domain only contains one data type
2896 descriptor). This is mainly useful for joining with other
2897 instances of such identifiers. (The specific format of the
2898 identifier is not defined and not guaranteed to remain the same
2899 in future versions.)
2907 <sect1 id=
"infoschema-element-types">
2908 <title><literal>element_types
</literal></title>
2911 The view
<literal>element_types
</literal> contains the data type
2912 descriptors of the elements of arrays. When a table column, composite-type attribute,
2913 domain, function parameter, or function return value is defined to
2914 be of an array type, the respective information schema view only
2915 contains
<literal>ARRAY
</literal> in the column
2916 <literal>data_type
</literal>. To obtain information on the element
2917 type of the array, you can join the respective view with this view.
2918 For example, to show the columns of a table with data types and
2919 array element types, if applicable, you could do:
2921 SELECT c.column_name, c.data_type, e.data_type AS element_type
2922 FROM information_schema.columns c LEFT JOIN information_schema.element_types e
2923 ON ((c.table_catalog, c.table_schema, c.table_name, 'TABLE', c.dtd_identifier)
2924 = (e.object_catalog, e.object_schema, e.object_name, e.object_type, e.collection_type_identifier))
2925 WHERE c.table_schema = '...' AND c.table_name = '...'
2926 ORDER BY c.ordinal_position;
2928 This view only includes objects that the current user has access
2929 to, by way of being the owner or having some privilege.
2933 <title><structname>element_types
</structname> Columns
</title>
2937 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2948 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2949 <structfield>object_catalog
</structfield> <type>sql_identifier
</type>
2952 Name of the database that contains the object that uses the
2953 array being described (always the current database)
2958 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2959 <structfield>object_schema
</structfield> <type>sql_identifier
</type>
2962 Name of the schema that contains the object that uses the array
2968 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2969 <structfield>object_name
</structfield> <type>sql_identifier
</type>
2972 Name of the object that uses the array being described
2977 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2978 <structfield>object_type
</structfield> <type>character_data
</type>
2981 The type of the object that uses the array being described: one
2982 of
<literal>TABLE
</literal> (the array is used by a column of
2983 that table),
<literal>USER-DEFINED TYPE
</literal> (the array is
2984 used by an attribute of that composite type),
2985 <literal>DOMAIN
</literal> (the array is used by that domain),
2986 <literal>ROUTINE
</literal> (the array is used by a parameter or
2987 the return data type of that function).
2992 <entry role=
"catalog_table_entry"><para role=
"column_definition">
2993 <structfield>collection_type_identifier
</structfield> <type>sql_identifier
</type>
2996 The identifier of the data type descriptor of the array being
2997 described. Use this to join with the
2998 <literal>dtd_identifier
</literal> columns of other information
3004 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3005 <structfield>data_type
</structfield> <type>character_data
</type>
3008 Data type of the array elements, if it is a built-in type, else
3009 <literal>USER-DEFINED
</literal> (in that case, the type is
3010 identified in
<literal>udt_name
</literal> and associated
3016 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3017 <structfield>character_maximum_length
</structfield> <type>cardinal_number
</type>
3020 Always null, since this information is not applied to array element data types in
<productname>PostgreSQL
</productname>
3025 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3026 <structfield>character_octet_length
</structfield> <type>cardinal_number
</type>
3029 Always null, since this information is not applied to array element data types in
<productname>PostgreSQL
</productname>
3034 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3035 <structfield>character_set_catalog
</structfield> <type>sql_identifier
</type>
3038 Applies to a feature not available in
<productname>PostgreSQL
</productname>
3043 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3044 <structfield>character_set_schema
</structfield> <type>sql_identifier
</type>
3047 Applies to a feature not available in
<productname>PostgreSQL
</productname>
3052 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3053 <structfield>character_set_name
</structfield> <type>sql_identifier
</type>
3056 Applies to a feature not available in
<productname>PostgreSQL
</productname>
3061 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3062 <structfield>collation_catalog
</structfield> <type>sql_identifier
</type>
3065 Name of the database containing the collation of the element
3066 type (always the current database), null if default or the data
3067 type of the element is not collatable
3072 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3073 <structfield>collation_schema
</structfield> <type>sql_identifier
</type>
3076 Name of the schema containing the collation of the element
3077 type, null if default or the data type of the element is not
3083 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3084 <structfield>collation_name
</structfield> <type>sql_identifier
</type>
3087 Name of the collation of the element type, null if default or
3088 the data type of the element is not collatable
3093 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3094 <structfield>numeric_precision
</structfield> <type>cardinal_number
</type>
3097 Always null, since this information is not applied to array element data types in
<productname>PostgreSQL
</productname>
3102 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3103 <structfield>numeric_precision_radix
</structfield> <type>cardinal_number
</type>
3106 Always null, since this information is not applied to array element data types in
<productname>PostgreSQL
</productname>
3111 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3112 <structfield>numeric_scale
</structfield> <type>cardinal_number
</type>
3115 Always null, since this information is not applied to array element data types in
<productname>PostgreSQL
</productname>
3120 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3121 <structfield>datetime_precision
</structfield> <type>cardinal_number
</type>
3124 Always null, since this information is not applied to array element data types in
<productname>PostgreSQL
</productname>
3129 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3130 <structfield>interval_type
</structfield> <type>character_data
</type>
3133 Always null, since this information is not applied to array element data types in
<productname>PostgreSQL
</productname>
3138 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3139 <structfield>interval_precision
</structfield> <type>cardinal_number
</type>
3142 Always null, since this information is not applied to array element data types in
<productname>PostgreSQL
</productname>
3147 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3148 <structfield>udt_catalog
</structfield> <type>sql_identifier
</type>
3151 Name of the database that the data type of the elements is
3152 defined in (always the current database)
3157 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3158 <structfield>udt_schema
</structfield> <type>sql_identifier
</type>
3161 Name of the schema that the data type of the elements is
3167 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3168 <structfield>udt_name
</structfield> <type>sql_identifier
</type>
3171 Name of the data type of the elements
3176 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3177 <structfield>scope_catalog
</structfield> <type>sql_identifier
</type>
3180 Applies to a feature not available in
<productname>PostgreSQL
</productname>
3185 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3186 <structfield>scope_schema
</structfield> <type>sql_identifier
</type>
3189 Applies to a feature not available in
<productname>PostgreSQL
</productname>
3194 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3195 <structfield>scope_name
</structfield> <type>sql_identifier
</type>
3198 Applies to a feature not available in
<productname>PostgreSQL
</productname>
3203 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3204 <structfield>maximum_cardinality
</structfield> <type>cardinal_number
</type>
3207 Always null, because arrays always have unlimited maximum cardinality in
<productname>PostgreSQL
</productname>
3212 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3213 <structfield>dtd_identifier
</structfield> <type>sql_identifier
</type>
3216 An identifier of the data type descriptor of the element. This
3217 is currently not useful.
3225 <sect1 id=
"infoschema-enabled-roles">
3226 <title><literal>enabled_roles
</literal></title>
3229 The view
<literal>enabled_roles
</literal> identifies the currently
3230 <quote>enabled roles
</quote>. The enabled roles are recursively
3231 defined as the current user together with all roles that have been
3232 granted to the enabled roles with automatic inheritance. In other
3233 words, these are all roles that the current user has direct or
3234 indirect, automatically inheriting membership in.
3235 <indexterm><primary>enabled role
</primary></indexterm>
3236 <indexterm><primary>role
</primary><secondary>enabled
</secondary></indexterm>
3240 For permission checking, the set of
<quote>applicable roles
</quote>
3241 is applied, which can be broader than the set of enabled roles. So
3242 generally, it is better to use the view
3243 <literal>applicable_roles
</literal> instead of this one; See
3244 <xref linkend=
"infoschema-applicable-roles"/> for details on
3245 <literal>applicable_roles
</literal> view.
3249 <title><structname>enabled_roles
</structname> Columns
</title>
3253 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3264 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3265 <structfield>role_name
</structfield> <type>sql_identifier
</type>
3276 <sect1 id=
"infoschema-foreign-data-wrapper-options">
3277 <title><literal>foreign_data_wrapper_options
</literal></title>
3280 The view
<literal>foreign_data_wrapper_options
</literal> contains
3281 all the options defined for foreign-data wrappers in the current
3282 database. Only those foreign-data wrappers are shown that the
3283 current user has access to (by way of being the owner or having
3288 <title><structname>foreign_data_wrapper_options
</structname> Columns
</title>
3292 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3303 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3304 <structfield>foreign_data_wrapper_catalog
</structfield> <type>sql_identifier
</type>
3307 Name of the database that the foreign-data wrapper is defined in (always the current database)
3312 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3313 <structfield>foreign_data_wrapper_name
</structfield> <type>sql_identifier
</type>
3316 Name of the foreign-data wrapper
3321 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3322 <structfield>option_name
</structfield> <type>sql_identifier
</type>
3330 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3331 <structfield>option_value
</structfield> <type>character_data
</type>
3342 <sect1 id=
"infoschema-foreign-data-wrappers">
3343 <title><literal>foreign_data_wrappers
</literal></title>
3346 The view
<literal>foreign_data_wrappers
</literal> contains all
3347 foreign-data wrappers defined in the current database. Only those
3348 foreign-data wrappers are shown that the current user has access to
3349 (by way of being the owner or having some privilege).
3353 <title><structname>foreign_data_wrappers
</structname> Columns
</title>
3357 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3368 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3369 <structfield>foreign_data_wrapper_catalog
</structfield> <type>sql_identifier
</type>
3372 Name of the database that contains the foreign-data
3373 wrapper (always the current database)
3378 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3379 <structfield>foreign_data_wrapper_name
</structfield> <type>sql_identifier
</type>
3382 Name of the foreign-data wrapper
3387 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3388 <structfield>authorization_identifier
</structfield> <type>sql_identifier
</type>
3391 Name of the owner of the foreign server
3396 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3397 <structfield>library_name
</structfield> <type>character_data
</type>
3400 File name of the library that implementing this foreign-data wrapper
3405 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3406 <structfield>foreign_data_wrapper_language
</structfield> <type>character_data
</type>
3409 Language used to implement this foreign-data wrapper
3417 <sect1 id=
"infoschema-foreign-server-options">
3418 <title><literal>foreign_server_options
</literal></title>
3421 The view
<literal>foreign_server_options
</literal> contains all the
3422 options defined for foreign servers in the current database. Only
3423 those foreign servers are shown that the current user has access to
3424 (by way of being the owner or having some privilege).
3428 <title><structname>foreign_server_options
</structname> Columns
</title>
3432 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3443 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3444 <structfield>foreign_server_catalog
</structfield> <type>sql_identifier
</type>
3447 Name of the database that the foreign server is defined in (always the current database)
3452 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3453 <structfield>foreign_server_name
</structfield> <type>sql_identifier
</type>
3456 Name of the foreign server
3461 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3462 <structfield>option_name
</structfield> <type>sql_identifier
</type>
3470 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3471 <structfield>option_value
</structfield> <type>character_data
</type>
3482 <sect1 id=
"infoschema-foreign-servers">
3483 <title><literal>foreign_servers
</literal></title>
3486 The view
<literal>foreign_servers
</literal> contains all foreign
3487 servers defined in the current database. Only those foreign
3488 servers are shown that the current user has access to (by way of
3489 being the owner or having some privilege).
3493 <title><structname>foreign_servers
</structname> Columns
</title>
3497 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3508 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3509 <structfield>foreign_server_catalog
</structfield> <type>sql_identifier
</type>
3512 Name of the database that the foreign server is defined in (always the current database)
3517 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3518 <structfield>foreign_server_name
</structfield> <type>sql_identifier
</type>
3521 Name of the foreign server
3526 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3527 <structfield>foreign_data_wrapper_catalog
</structfield> <type>sql_identifier
</type>
3530 Name of the database that contains the foreign-data
3531 wrapper used by the foreign server (always the current database)
3536 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3537 <structfield>foreign_data_wrapper_name
</structfield> <type>sql_identifier
</type>
3540 Name of the foreign-data wrapper used by the foreign server
3545 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3546 <structfield>foreign_server_type
</structfield> <type>character_data
</type>
3549 Foreign server type information, if specified upon creation
3554 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3555 <structfield>foreign_server_version
</structfield> <type>character_data
</type>
3558 Foreign server version information, if specified upon creation
3563 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3564 <structfield>authorization_identifier
</structfield> <type>sql_identifier
</type>
3567 Name of the owner of the foreign server
3575 <sect1 id=
"infoschema-foreign-table-options">
3576 <title><literal>foreign_table_options
</literal></title>
3579 The view
<literal>foreign_table_options
</literal> contains all the
3580 options defined for foreign tables in the current database. Only
3581 those foreign tables are shown that the current user has access to
3582 (by way of being the owner or having some privilege).
3586 <title><structname>foreign_table_options
</structname> Columns
</title>
3590 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3601 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3602 <structfield>foreign_table_catalog
</structfield> <type>sql_identifier
</type>
3605 Name of the database that contains the foreign table (always the current database)
3610 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3611 <structfield>foreign_table_schema
</structfield> <type>sql_identifier
</type>
3614 Name of the schema that contains the foreign table
3619 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3620 <structfield>foreign_table_name
</structfield> <type>sql_identifier
</type>
3623 Name of the foreign table
3628 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3629 <structfield>option_name
</structfield> <type>sql_identifier
</type>
3637 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3638 <structfield>option_value
</structfield> <type>character_data
</type>
3649 <sect1 id=
"infoschema-foreign-tables">
3650 <title><literal>foreign_tables
</literal></title>
3653 The view
<literal>foreign_tables
</literal> contains all foreign
3654 tables defined in the current database. Only those foreign
3655 tables are shown that the current user has access to (by way of
3656 being the owner or having some privilege).
3660 <title><structname>foreign_tables
</structname> Columns
</title>
3664 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3675 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3676 <structfield>foreign_table_catalog
</structfield> <type>sql_identifier
</type>
3679 Name of the database that the foreign table is defined in (always the current database)
3684 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3685 <structfield>foreign_table_schema
</structfield> <type>sql_identifier
</type>
3688 Name of the schema that contains the foreign table
3693 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3694 <structfield>foreign_table_name
</structfield> <type>sql_identifier
</type>
3697 Name of the foreign table
3702 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3703 <structfield>foreign_server_catalog
</structfield> <type>sql_identifier
</type>
3706 Name of the database that the foreign server is defined in (always the current database)
3711 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3712 <structfield>foreign_server_name
</structfield> <type>sql_identifier
</type>
3715 Name of the foreign server
3723 <sect1 id=
"infoschema-key-column-usage">
3724 <title><literal>key_column_usage
</literal></title>
3727 The view
<literal>key_column_usage
</literal> identifies all columns
3728 in the current database that are restricted by some unique, primary
3729 key, or foreign key constraint. Check constraints are not included
3730 in this view. Only those columns are shown that the current user
3731 has access to, by way of being the owner or having some privilege.
3735 <title><structname>key_column_usage
</structname> Columns
</title>
3739 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3750 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3751 <structfield>constraint_catalog
</structfield> <type>sql_identifier
</type>
3754 Name of the database that contains the constraint (always the current database)
3759 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3760 <structfield>constraint_schema
</structfield> <type>sql_identifier
</type>
3763 Name of the schema that contains the constraint
3768 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3769 <structfield>constraint_name
</structfield> <type>sql_identifier
</type>
3772 Name of the constraint
3777 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3778 <structfield>table_catalog
</structfield> <type>sql_identifier
</type>
3781 Name of the database that contains the table that contains the
3782 column that is restricted by this constraint (always the
3788 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3789 <structfield>table_schema
</structfield> <type>sql_identifier
</type>
3792 Name of the schema that contains the table that contains the
3793 column that is restricted by this constraint
3798 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3799 <structfield>table_name
</structfield> <type>sql_identifier
</type>
3802 Name of the table that contains the column that is restricted
3808 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3809 <structfield>column_name
</structfield> <type>sql_identifier
</type>
3812 Name of the column that is restricted by this constraint
3817 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3818 <structfield>ordinal_position
</structfield> <type>cardinal_number
</type>
3821 Ordinal position of the column within the constraint key (count
3827 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3828 <structfield>position_in_unique_constraint
</structfield> <type>cardinal_number
</type>
3831 For a foreign-key constraint, ordinal position of the referenced
3832 column within its unique constraint (count starts at
1);
3841 <sect1 id=
"infoschema-parameters">
3842 <title><literal>parameters
</literal></title>
3845 The view
<literal>parameters
</literal> contains information about
3846 the parameters (arguments) of all functions in the current database.
3847 Only those functions are shown that the current user has access to
3848 (by way of being the owner or having some privilege).
3852 <title><structname>parameters
</structname> Columns
</title>
3856 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3867 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3868 <structfield>specific_catalog
</structfield> <type>sql_identifier
</type>
3871 Name of the database containing the function (always the current database)
3876 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3877 <structfield>specific_schema
</structfield> <type>sql_identifier
</type>
3880 Name of the schema containing the function
3885 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3886 <structfield>specific_name
</structfield> <type>sql_identifier
</type>
3889 The
<quote>specific name
</quote> of the function. See
<xref linkend=
"infoschema-routines"/> for more information.
3894 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3895 <structfield>ordinal_position
</structfield> <type>cardinal_number
</type>
3898 Ordinal position of the parameter in the argument list of the
3899 function (count starts at
1)
3904 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3905 <structfield>parameter_mode
</structfield> <type>character_data
</type>
3908 <literal>IN
</literal> for input parameter,
3909 <literal>OUT
</literal> for output parameter,
3910 and
<literal>INOUT
</literal> for input/output parameter.
3915 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3916 <structfield>is_result
</structfield> <type>yes_or_no
</type>
3919 Applies to a feature not available in
<productname>PostgreSQL
</productname>
3924 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3925 <structfield>as_locator
</structfield> <type>yes_or_no
</type>
3928 Applies to a feature not available in
<productname>PostgreSQL
</productname>
3933 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3934 <structfield>parameter_name
</structfield> <type>sql_identifier
</type>
3937 Name of the parameter, or null if the parameter has no name
3942 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3943 <structfield>data_type
</structfield> <type>character_data
</type>
3946 Data type of the parameter, if it is a built-in type, or
3947 <literal>ARRAY
</literal> if it is some array (in that case, see
3948 the view
<literal>element_types
</literal>), else
3949 <literal>USER-DEFINED
</literal> (in that case, the type is
3950 identified in
<literal>udt_name
</literal> and associated
3956 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3957 <structfield>character_maximum_length
</structfield> <type>cardinal_number
</type>
3960 Always null, since this information is not applied to parameter data types in
<productname>PostgreSQL
</productname>
3965 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3966 <structfield>character_octet_length
</structfield> <type>cardinal_number
</type>
3969 Always null, since this information is not applied to parameter data types in
<productname>PostgreSQL
</productname>
3974 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3975 <structfield>character_set_catalog
</structfield> <type>sql_identifier
</type>
3978 Applies to a feature not available in
<productname>PostgreSQL
</productname>
3983 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3984 <structfield>character_set_schema
</structfield> <type>sql_identifier
</type>
3987 Applies to a feature not available in
<productname>PostgreSQL
</productname>
3992 <entry role=
"catalog_table_entry"><para role=
"column_definition">
3993 <structfield>character_set_name
</structfield> <type>sql_identifier
</type>
3996 Applies to a feature not available in
<productname>PostgreSQL
</productname>
4001 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4002 <structfield>collation_catalog
</structfield> <type>sql_identifier
</type>
4005 Always null, since this information is not applied to parameter data types in
<productname>PostgreSQL
</productname>
4010 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4011 <structfield>collation_schema
</structfield> <type>sql_identifier
</type>
4014 Always null, since this information is not applied to parameter data types in
<productname>PostgreSQL
</productname>
4019 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4020 <structfield>collation_name
</structfield> <type>sql_identifier
</type>
4023 Always null, since this information is not applied to parameter data types in
<productname>PostgreSQL
</productname>
4028 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4029 <structfield>numeric_precision
</structfield> <type>cardinal_number
</type>
4032 Always null, since this information is not applied to parameter data types in
<productname>PostgreSQL
</productname>
4037 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4038 <structfield>numeric_precision_radix
</structfield> <type>cardinal_number
</type>
4041 Always null, since this information is not applied to parameter data types in
<productname>PostgreSQL
</productname>
4046 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4047 <structfield>numeric_scale
</structfield> <type>cardinal_number
</type>
4050 Always null, since this information is not applied to parameter data types in
<productname>PostgreSQL
</productname>
4055 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4056 <structfield>datetime_precision
</structfield> <type>cardinal_number
</type>
4059 Always null, since this information is not applied to parameter data types in
<productname>PostgreSQL
</productname>
4064 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4065 <structfield>interval_type
</structfield> <type>character_data
</type>
4068 Always null, since this information is not applied to parameter data types in
<productname>PostgreSQL
</productname>
4073 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4074 <structfield>interval_precision
</structfield> <type>cardinal_number
</type>
4077 Always null, since this information is not applied to parameter data types in
<productname>PostgreSQL
</productname>
4082 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4083 <structfield>udt_catalog
</structfield> <type>sql_identifier
</type>
4086 Name of the database that the data type of the parameter is
4087 defined in (always the current database)
4092 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4093 <structfield>udt_schema
</structfield> <type>sql_identifier
</type>
4096 Name of the schema that the data type of the parameter is
4102 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4103 <structfield>udt_name
</structfield> <type>sql_identifier
</type>
4106 Name of the data type of the parameter
4111 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4112 <structfield>scope_catalog
</structfield> <type>sql_identifier
</type>
4115 Applies to a feature not available in
<productname>PostgreSQL
</productname>
4120 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4121 <structfield>scope_schema
</structfield> <type>sql_identifier
</type>
4124 Applies to a feature not available in
<productname>PostgreSQL
</productname>
4129 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4130 <structfield>scope_name
</structfield> <type>sql_identifier
</type>
4133 Applies to a feature not available in
<productname>PostgreSQL
</productname>
4138 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4139 <structfield>maximum_cardinality
</structfield> <type>cardinal_number
</type>
4142 Always null, because arrays always have unlimited maximum cardinality in
<productname>PostgreSQL
</productname>
4147 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4148 <structfield>dtd_identifier
</structfield> <type>sql_identifier
</type>
4151 An identifier of the data type descriptor of the parameter,
4152 unique among the data type descriptors pertaining to the
4153 function. This is mainly useful for joining with other
4154 instances of such identifiers. (The specific format of the
4155 identifier is not defined and not guaranteed to remain the same
4156 in future versions.)
4161 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4162 <structfield>parameter_default
</structfield> <type>character_data
</type>
4165 The default expression of the parameter, or null if none or if the
4166 function is not owned by a currently enabled role.
4174 <sect1 id=
"infoschema-referential-constraints">
4175 <title><literal>referential_constraints
</literal></title>
4178 The view
<literal>referential_constraints
</literal> contains all
4179 referential (foreign key) constraints in the current database.
4180 Only those constraints are shown for which the current user has
4181 write access to the referencing table (by way of being the
4182 owner or having some privilege other than
<literal>SELECT
</literal>).
4186 <title><structname>referential_constraints
</structname> Columns
</title>
4190 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4201 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4202 <structfield>constraint_catalog
</structfield> <type>sql_identifier
</type>
4205 Name of the database containing the constraint (always the current database)
4210 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4211 <structfield>constraint_schema
</structfield> <type>sql_identifier
</type>
4214 Name of the schema containing the constraint
4219 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4220 <structfield>constraint_name
</structfield> <type>sql_identifier
</type>
4223 Name of the constraint
4228 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4229 <structfield>unique_constraint_catalog
</structfield> <type>sql_identifier
</type>
4232 Name of the database that contains the unique or primary key
4233 constraint that the foreign key constraint references (always
4234 the current database)
4239 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4240 <structfield>unique_constraint_schema
</structfield> <type>sql_identifier
</type>
4243 Name of the schema that contains the unique or primary key
4244 constraint that the foreign key constraint references
4249 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4250 <structfield>unique_constraint_name
</structfield> <type>sql_identifier
</type>
4253 Name of the unique or primary key constraint that the foreign
4254 key constraint references
4259 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4260 <structfield>match_option
</structfield> <type>character_data
</type>
4263 Match option of the foreign key constraint:
4264 <literal>FULL
</literal>,
<literal>PARTIAL
</literal>, or
4265 <literal>NONE
</literal>.
4270 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4271 <structfield>update_rule
</structfield> <type>character_data
</type>
4274 Update rule of the foreign key constraint:
4275 <literal>CASCADE
</literal>,
<literal>SET NULL
</literal>,
4276 <literal>SET DEFAULT
</literal>,
<literal>RESTRICT
</literal>, or
4277 <literal>NO ACTION
</literal>.
4282 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4283 <structfield>delete_rule
</structfield> <type>character_data
</type>
4286 Delete rule of the foreign key constraint:
4287 <literal>CASCADE
</literal>,
<literal>SET NULL
</literal>,
4288 <literal>SET DEFAULT
</literal>,
<literal>RESTRICT
</literal>, or
4289 <literal>NO ACTION
</literal>.
4298 <sect1 id=
"infoschema-role-column-grants">
4299 <title><literal>role_column_grants
</literal></title>
4302 The view
<literal>role_column_grants
</literal> identifies all
4303 privileges granted on columns where the grantor or grantee is a
4304 currently enabled role. Further information can be found under
4305 <literal>column_privileges
</literal>. The only effective
4306 difference between this view
4307 and
<literal>column_privileges
</literal> is that this view omits
4308 columns that have been made accessible to the current user by way
4309 of a grant to
<literal>PUBLIC
</literal>.
4313 <title><structname>role_column_grants
</structname> Columns
</title>
4317 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4328 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4329 <structfield>grantor
</structfield> <type>sql_identifier
</type>
4332 Name of the role that granted the privilege
4337 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4338 <structfield>grantee
</structfield> <type>sql_identifier
</type>
4341 Name of the role that the privilege was granted to
4346 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4347 <structfield>table_catalog
</structfield> <type>sql_identifier
</type>
4350 Name of the database that contains the table that contains the column (always the current database)
4355 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4356 <structfield>table_schema
</structfield> <type>sql_identifier
</type>
4359 Name of the schema that contains the table that contains the column
4364 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4365 <structfield>table_name
</structfield> <type>sql_identifier
</type>
4368 Name of the table that contains the column
4373 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4374 <structfield>column_name
</structfield> <type>sql_identifier
</type>
4382 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4383 <structfield>privilege_type
</structfield> <type>character_data
</type>
4386 Type of the privilege:
<literal>SELECT
</literal>,
4387 <literal>INSERT
</literal>,
<literal>UPDATE
</literal>, or
4388 <literal>REFERENCES
</literal>
4393 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4394 <structfield>is_grantable
</structfield> <type>yes_or_no
</type>
4397 <literal>YES
</literal> if the privilege is grantable,
<literal>NO
</literal> if not
4405 <sect1 id=
"infoschema-role-routine-grants">
4406 <title><literal>role_routine_grants
</literal></title>
4409 The view
<literal>role_routine_grants
</literal> identifies all
4410 privileges granted on functions where the grantor or grantee is a
4411 currently enabled role. Further information can be found under
4412 <literal>routine_privileges
</literal>. The only effective
4413 difference between this view
4414 and
<literal>routine_privileges
</literal> is that this view omits
4415 functions that have been made accessible to the current user by way
4416 of a grant to
<literal>PUBLIC
</literal>.
4420 <title><structname>role_routine_grants
</structname> Columns
</title>
4424 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4435 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4436 <structfield>grantor
</structfield> <type>sql_identifier
</type>
4439 Name of the role that granted the privilege
4444 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4445 <structfield>grantee
</structfield> <type>sql_identifier
</type>
4448 Name of the role that the privilege was granted to
4453 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4454 <structfield>specific_catalog
</structfield> <type>sql_identifier
</type>
4457 Name of the database containing the function (always the current database)
4462 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4463 <structfield>specific_schema
</structfield> <type>sql_identifier
</type>
4466 Name of the schema containing the function
4471 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4472 <structfield>specific_name
</structfield> <type>sql_identifier
</type>
4475 The
<quote>specific name
</quote> of the function. See
<xref linkend=
"infoschema-routines"/> for more information.
4480 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4481 <structfield>routine_catalog
</structfield> <type>sql_identifier
</type>
4484 Name of the database containing the function (always the current database)
4489 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4490 <structfield>routine_schema
</structfield> <type>sql_identifier
</type>
4493 Name of the schema containing the function
4498 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4499 <structfield>routine_name
</structfield> <type>sql_identifier
</type>
4502 Name of the function (might be duplicated in case of overloading)
4507 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4508 <structfield>privilege_type
</structfield> <type>character_data
</type>
4511 Always
<literal>EXECUTE
</literal> (the only privilege type for functions)
4516 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4517 <structfield>is_grantable
</structfield> <type>yes_or_no
</type>
4520 <literal>YES
</literal> if the privilege is grantable,
<literal>NO
</literal> if not
4528 <sect1 id=
"infoschema-role-table-grants">
4529 <title><literal>role_table_grants
</literal></title>
4532 The view
<literal>role_table_grants
</literal> identifies all
4533 privileges granted on tables or views where the grantor or grantee
4534 is a currently enabled role. Further information can be found
4535 under
<literal>table_privileges
</literal>. The only effective
4536 difference between this view
4537 and
<literal>table_privileges
</literal> is that this view omits
4538 tables that have been made accessible to the current user by way of
4539 a grant to
<literal>PUBLIC
</literal>.
4543 <title><structname>role_table_grants
</structname> Columns
</title>
4547 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4558 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4559 <structfield>grantor
</structfield> <type>sql_identifier
</type>
4562 Name of the role that granted the privilege
4567 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4568 <structfield>grantee
</structfield> <type>sql_identifier
</type>
4571 Name of the role that the privilege was granted to
4576 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4577 <structfield>table_catalog
</structfield> <type>sql_identifier
</type>
4580 Name of the database that contains the table (always the current database)
4585 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4586 <structfield>table_schema
</structfield> <type>sql_identifier
</type>
4589 Name of the schema that contains the table
4594 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4595 <structfield>table_name
</structfield> <type>sql_identifier
</type>
4603 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4604 <structfield>privilege_type
</structfield> <type>character_data
</type>
4607 Type of the privilege:
<literal>SELECT
</literal>,
4608 <literal>INSERT
</literal>,
<literal>UPDATE
</literal>,
4609 <literal>DELETE
</literal>,
<literal>TRUNCATE
</literal>,
4610 <literal>REFERENCES
</literal>, or
<literal>TRIGGER
</literal>
4615 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4616 <structfield>is_grantable
</structfield> <type>yes_or_no
</type>
4619 <literal>YES
</literal> if the privilege is grantable,
<literal>NO
</literal> if not
4624 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4625 <structfield>with_hierarchy
</structfield> <type>yes_or_no
</type>
4628 In the SQL standard,
<literal>WITH HIERARCHY OPTION
</literal>
4629 is a separate (sub-)privilege allowing certain operations on
4630 table inheritance hierarchies. In PostgreSQL, this is included
4631 in the
<literal>SELECT
</literal> privilege, so this column
4632 shows
<literal>YES
</literal> if the privilege
4633 is
<literal>SELECT
</literal>, else
<literal>NO
</literal>.
4641 <sect1 id=
"infoschema-role-udt-grants">
4642 <title><literal>role_udt_grants
</literal></title>
4645 The view
<literal>role_udt_grants
</literal> is intended to identify
4646 <literal>USAGE
</literal> privileges granted on user-defined types
4647 where the grantor or grantee is a currently enabled role. Further
4648 information can be found under
4649 <literal>udt_privileges
</literal>. The only effective difference
4650 between this view and
<literal>udt_privileges
</literal> is that
4651 this view omits objects that have been made accessible to the
4652 current user by way of a grant to
<literal>PUBLIC
</literal>. Since
4653 data types do not have real privileges in PostgreSQL, but only an
4654 implicit grant to
<literal>PUBLIC
</literal>, this view is empty.
4658 <title><structname>role_udt_grants
</structname> Columns
</title>
4662 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4673 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4674 <structfield>grantor
</structfield> <type>sql_identifier
</type>
4677 The name of the role that granted the privilege
4682 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4683 <structfield>grantee
</structfield> <type>sql_identifier
</type>
4686 The name of the role that the privilege was granted to
4691 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4692 <structfield>udt_catalog
</structfield> <type>sql_identifier
</type>
4695 Name of the database containing the type (always the current database)
4700 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4701 <structfield>udt_schema
</structfield> <type>sql_identifier
</type>
4704 Name of the schema containing the type
4709 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4710 <structfield>udt_name
</structfield> <type>sql_identifier
</type>
4718 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4719 <structfield>privilege_type
</structfield> <type>character_data
</type>
4722 Always
<literal>TYPE USAGE
</literal>
4727 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4728 <structfield>is_grantable
</structfield> <type>yes_or_no
</type>
4731 <literal>YES
</literal> if the privilege is grantable,
<literal>NO
</literal> if not
4739 <sect1 id=
"infoschema-role-usage-grants">
4740 <title><literal>role_usage_grants
</literal></title>
4743 The view
<literal>role_usage_grants
</literal> identifies
4744 <literal>USAGE
</literal> privileges granted on various kinds of
4745 objects where the grantor or grantee is a currently enabled role.
4746 Further information can be found under
4747 <literal>usage_privileges
</literal>. The only effective difference
4748 between this view and
<literal>usage_privileges
</literal> is that
4749 this view omits objects that have been made accessible to the
4750 current user by way of a grant to
<literal>PUBLIC
</literal>.
4754 <title><structname>role_usage_grants
</structname> Columns
</title>
4758 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4769 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4770 <structfield>grantor
</structfield> <type>sql_identifier
</type>
4773 The name of the role that granted the privilege
4778 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4779 <structfield>grantee
</structfield> <type>sql_identifier
</type>
4782 The name of the role that the privilege was granted to
4787 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4788 <structfield>object_catalog
</structfield> <type>sql_identifier
</type>
4791 Name of the database containing the object (always the current database)
4796 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4797 <structfield>object_schema
</structfield> <type>sql_identifier
</type>
4800 Name of the schema containing the object, if applicable,
4801 else an empty string
4806 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4807 <structfield>object_name
</structfield> <type>sql_identifier
</type>
4815 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4816 <structfield>object_type
</structfield> <type>character_data
</type>
4819 <literal>COLLATION
</literal> or
<literal>DOMAIN
</literal> or
<literal>FOREIGN DATA WRAPPER
</literal> or
<literal>FOREIGN SERVER
</literal> or
<literal>SEQUENCE
</literal>
4824 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4825 <structfield>privilege_type
</structfield> <type>character_data
</type>
4828 Always
<literal>USAGE
</literal>
4833 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4834 <structfield>is_grantable
</structfield> <type>yes_or_no
</type>
4837 <literal>YES
</literal> if the privilege is grantable,
<literal>NO
</literal> if not
4845 <sect1 id=
"infoschema-routine-column-usage">
4846 <title><literal>routine_column_usage
</literal></title>
4849 The view
<literal>routine_column_usage
</literal> identifies all columns
4850 that are used by a function or procedure, either in the SQL body or in
4851 parameter default expressions. (This only works for unquoted SQL bodies,
4852 not quoted bodies or functions in other languages.) A column is only
4853 included if its table is owned by a currently enabled role.
4857 <title><literal>routine_column_usage
</literal> Columns
</title>
4862 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4873 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4874 <structfield>specific_catalog
</structfield> <type>sql_identifier
</type>
4877 Name of the database containing the function (always the current database)
4882 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4883 <structfield>specific_schema
</structfield> <type>sql_identifier
</type>
4886 Name of the schema containing the function
4891 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4892 <structfield>specific_name
</structfield> <type>sql_identifier
</type>
4895 The
<quote>specific name
</quote> of the function. See
<xref linkend=
"infoschema-routines"/> for more information.
4900 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4901 <structfield>routine_catalog
</structfield> <type>sql_identifier
</type>
4904 Name of the database containing the function (always the current database)
4909 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4910 <structfield>routine_schema
</structfield> <type>sql_identifier
</type>
4913 Name of the schema containing the function
4918 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4919 <structfield>routine_name
</structfield> <type>sql_identifier
</type>
4922 Name of the function (might be duplicated in case of overloading)
4927 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4928 <structfield>table_catalog
</structfield> <type>sql_identifier
</type>
4931 Name of the database that contains the table that is used by the
4932 function (always the current database)
4937 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4938 <structfield>table_schema
</structfield> <type>sql_identifier
</type>
4941 Name of the schema that contains the table that is used by the function
4946 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4947 <structfield>table_name
</structfield> <type>sql_identifier
</type>
4950 Name of the table that is used by the function
4955 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4956 <structfield>column_name
</structfield> <type>sql_identifier
</type>
4959 Name of the column that is used by the function
4967 <sect1 id=
"infoschema-routine-privileges">
4968 <title><literal>routine_privileges
</literal></title>
4971 The view
<literal>routine_privileges
</literal> identifies all
4972 privileges granted on functions to a currently enabled role or by a
4973 currently enabled role. There is one row for each combination of function,
4974 grantor, and grantee.
4978 <title><structname>routine_privileges
</structname> Columns
</title>
4982 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4993 <entry role=
"catalog_table_entry"><para role=
"column_definition">
4994 <structfield>grantor
</structfield> <type>sql_identifier
</type>
4997 Name of the role that granted the privilege
5002 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5003 <structfield>grantee
</structfield> <type>sql_identifier
</type>
5006 Name of the role that the privilege was granted to
5011 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5012 <structfield>specific_catalog
</structfield> <type>sql_identifier
</type>
5015 Name of the database containing the function (always the current database)
5020 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5021 <structfield>specific_schema
</structfield> <type>sql_identifier
</type>
5024 Name of the schema containing the function
5029 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5030 <structfield>specific_name
</structfield> <type>sql_identifier
</type>
5033 The
<quote>specific name
</quote> of the function. See
<xref linkend=
"infoschema-routines"/> for more information.
5038 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5039 <structfield>routine_catalog
</structfield> <type>sql_identifier
</type>
5042 Name of the database containing the function (always the current database)
5047 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5048 <structfield>routine_schema
</structfield> <type>sql_identifier
</type>
5051 Name of the schema containing the function
5056 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5057 <structfield>routine_name
</structfield> <type>sql_identifier
</type>
5060 Name of the function (might be duplicated in case of overloading)
5065 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5066 <structfield>privilege_type
</structfield> <type>character_data
</type>
5069 Always
<literal>EXECUTE
</literal> (the only privilege type for functions)
5074 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5075 <structfield>is_grantable
</structfield> <type>yes_or_no
</type>
5078 <literal>YES
</literal> if the privilege is grantable,
<literal>NO
</literal> if not
5086 <sect1 id=
"infoschema-routine-routine-usage">
5087 <title><literal>routine_routine_usage
</literal></title>
5090 The view
<literal>routine_routine_usage
</literal> identifies all functions
5091 or procedures that are used by another (or the same) function or procedure,
5092 either in the SQL body or in parameter default expressions. (This only
5093 works for unquoted SQL bodies, not quoted bodies or functions in other
5094 languages.) An entry is included here only if the used function is owned
5095 by a currently enabled role. (There is no such restriction on the using
5100 Note that the entries for both functions in the view refer to the
5101 <quote>specific
</quote> name of the routine, even though the column names
5102 are used in a way that is inconsistent with other information schema views
5103 about routines. This is per SQL standard, although it is arguably a
5104 misdesign. See
<xref linkend=
"infoschema-routines"/> for more information
5105 about specific names.
5109 <title><literal>routine_routine_usage
</literal> Columns
</title>
5114 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5125 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5126 <structfield>specific_catalog
</structfield> <type>sql_identifier
</type>
5129 Name of the database containing the using function (always the current database)
5134 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5135 <structfield>specific_schema
</structfield> <type>sql_identifier
</type>
5138 Name of the schema containing the using function
5143 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5144 <structfield>specific_name
</structfield> <type>sql_identifier
</type>
5147 The
<quote>specific name
</quote> of the using function.
5152 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5153 <structfield>routine_catalog
</structfield> <type>sql_identifier
</type>
5156 Name of the database that contains the function that is used by the
5157 first function (always the current database)
5162 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5163 <structfield>routine_schema
</structfield> <type>sql_identifier
</type>
5166 Name of the schema that contains the function that is used by the first
5172 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5173 <structfield>routine_name
</structfield> <type>sql_identifier
</type>
5176 The
<quote>specific name
</quote> of the function that is used by the
5185 <sect1 id=
"infoschema-routine-sequence-usage">
5186 <title><literal>routine_sequence_usage
</literal></title>
5189 The view
<literal>routine_sequence_usage
</literal> identifies all sequences
5190 that are used by a function or procedure, either in the SQL body or in
5191 parameter default expressions. (This only works for unquoted SQL bodies,
5192 not quoted bodies or functions in other languages.) A sequence is only
5193 included if that sequence is owned by a currently enabled role.
5197 <title><literal>routine_sequence_usage
</literal> Columns
</title>
5202 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5213 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5214 <structfield>specific_catalog
</structfield> <type>sql_identifier
</type>
5217 Name of the database containing the function (always the current database)
5222 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5223 <structfield>specific_schema
</structfield> <type>sql_identifier
</type>
5226 Name of the schema containing the function
5231 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5232 <structfield>specific_name
</structfield> <type>sql_identifier
</type>
5235 The
<quote>specific name
</quote> of the function. See
<xref linkend=
"infoschema-routines"/> for more information.
5240 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5241 <structfield>routine_catalog
</structfield> <type>sql_identifier
</type>
5244 Name of the database containing the function (always the current database)
5249 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5250 <structfield>routine_schema
</structfield> <type>sql_identifier
</type>
5253 Name of the schema containing the function
5258 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5259 <structfield>routine_name
</structfield> <type>sql_identifier
</type>
5262 Name of the function (might be duplicated in case of overloading)
5267 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5268 <structfield>schema_catalog
</structfield> <type>sql_identifier
</type>
5271 Name of the database that contains the sequence that is used by the
5272 function (always the current database)
5277 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5278 <structfield>sequence_schema
</structfield> <type>sql_identifier
</type>
5281 Name of the schema that contains the sequence that is used by the function
5286 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5287 <structfield>sequence_name
</structfield> <type>sql_identifier
</type>
5290 Name of the sequence that is used by the function
5298 <sect1 id=
"infoschema-routine-table-usage">
5299 <title><literal>routine_table_usage
</literal></title>
5302 The view
<literal>routine_table_usage
</literal> is meant to identify all
5303 tables that are used by a function or procedure. This information is
5304 currently not tracked by
<productname>PostgreSQL
</productname>.
5308 <title><literal>routine_table_usage
</literal> Columns
</title>
5313 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5324 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5325 <structfield>specific_catalog
</structfield> <type>sql_identifier
</type>
5328 Name of the database containing the function (always the current database)
5333 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5334 <structfield>specific_schema
</structfield> <type>sql_identifier
</type>
5337 Name of the schema containing the function
5342 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5343 <structfield>specific_name
</structfield> <type>sql_identifier
</type>
5346 The
<quote>specific name
</quote> of the function. See
<xref linkend=
"infoschema-routines"/> for more information.
5351 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5352 <structfield>routine_catalog
</structfield> <type>sql_identifier
</type>
5355 Name of the database containing the function (always the current database)
5360 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5361 <structfield>routine_schema
</structfield> <type>sql_identifier
</type>
5364 Name of the schema containing the function
5369 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5370 <structfield>routine_name
</structfield> <type>sql_identifier
</type>
5373 Name of the function (might be duplicated in case of overloading)
5378 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5379 <structfield>table_catalog
</structfield> <type>sql_identifier
</type>
5382 Name of the database that contains the table that is used by the
5383 function (always the current database)
5388 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5389 <structfield>table_schema
</structfield> <type>sql_identifier
</type>
5392 Name of the schema that contains the table that is used by the function
5397 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5398 <structfield>table_name
</structfield> <type>sql_identifier
</type>
5401 Name of the table that is used by the function
5409 <sect1 id=
"infoschema-routines">
5410 <title><literal>routines
</literal></title>
5413 The view
<literal>routines
</literal> contains all functions and procedures in the
5414 current database. Only those functions and procedures are shown that the current
5415 user has access to (by way of being the owner or having some
5420 <title><structname>routines
</structname> Columns
</title>
5424 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5435 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5436 <structfield>specific_catalog
</structfield> <type>sql_identifier
</type>
5439 Name of the database containing the function (always the current database)
5444 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5445 <structfield>specific_schema
</structfield> <type>sql_identifier
</type>
5448 Name of the schema containing the function
5453 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5454 <structfield>specific_name
</structfield> <type>sql_identifier
</type>
5457 The
<quote>specific name
</quote> of the function. This is a
5458 name that uniquely identifies the function in the schema, even
5459 if the real name of the function is overloaded. The format of
5460 the specific name is not defined, it should only be used to
5461 compare it to other instances of specific routine names.
5466 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5467 <structfield>routine_catalog
</structfield> <type>sql_identifier
</type>
5470 Name of the database containing the function (always the current database)
5475 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5476 <structfield>routine_schema
</structfield> <type>sql_identifier
</type>
5479 Name of the schema containing the function
5484 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5485 <structfield>routine_name
</structfield> <type>sql_identifier
</type>
5488 Name of the function (might be duplicated in case of overloading)
5493 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5494 <structfield>routine_type
</structfield> <type>character_data
</type>
5497 <literal>FUNCTION
</literal> for a
5498 function,
<literal>PROCEDURE
</literal> for a procedure
5503 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5504 <structfield>module_catalog
</structfield> <type>sql_identifier
</type>
5507 Applies to a feature not available in
<productname>PostgreSQL
</productname>
5512 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5513 <structfield>module_schema
</structfield> <type>sql_identifier
</type>
5516 Applies to a feature not available in
<productname>PostgreSQL
</productname>
5521 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5522 <structfield>module_name
</structfield> <type>sql_identifier
</type>
5525 Applies to a feature not available in
<productname>PostgreSQL
</productname>
5530 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5531 <structfield>udt_catalog
</structfield> <type>sql_identifier
</type>
5534 Applies to a feature not available in
<productname>PostgreSQL
</productname>
5539 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5540 <structfield>udt_schema
</structfield> <type>sql_identifier
</type>
5543 Applies to a feature not available in
<productname>PostgreSQL
</productname>
5548 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5549 <structfield>udt_name
</structfield> <type>sql_identifier
</type>
5552 Applies to a feature not available in
<productname>PostgreSQL
</productname>
5557 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5558 <structfield>data_type
</structfield> <type>character_data
</type>
5561 Return data type of the function, if it is a built-in type, or
5562 <literal>ARRAY
</literal> if it is some array (in that case, see
5563 the view
<literal>element_types
</literal>), else
5564 <literal>USER-DEFINED
</literal> (in that case, the type is
5565 identified in
<literal>type_udt_name
</literal> and associated
5566 columns). Null for a procedure.
5571 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5572 <structfield>character_maximum_length
</structfield> <type>cardinal_number
</type>
5575 Always null, since this information is not applied to return data types in
<productname>PostgreSQL
</productname>
5580 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5581 <structfield>character_octet_length
</structfield> <type>cardinal_number
</type>
5584 Always null, since this information is not applied to return data types in
<productname>PostgreSQL
</productname>
5589 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5590 <structfield>character_set_catalog
</structfield> <type>sql_identifier
</type>
5593 Applies to a feature not available in
<productname>PostgreSQL
</productname>
5598 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5599 <structfield>character_set_schema
</structfield> <type>sql_identifier
</type>
5602 Applies to a feature not available in
<productname>PostgreSQL
</productname>
5607 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5608 <structfield>character_set_name
</structfield> <type>sql_identifier
</type>
5611 Applies to a feature not available in
<productname>PostgreSQL
</productname>
5616 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5617 <structfield>collation_catalog
</structfield> <type>sql_identifier
</type>
5620 Always null, since this information is not applied to return data types in
<productname>PostgreSQL
</productname>
5625 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5626 <structfield>collation_schema
</structfield> <type>sql_identifier
</type>
5629 Always null, since this information is not applied to return data types in
<productname>PostgreSQL
</productname>
5634 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5635 <structfield>collation_name
</structfield> <type>sql_identifier
</type>
5638 Always null, since this information is not applied to return data types in
<productname>PostgreSQL
</productname>
5643 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5644 <structfield>numeric_precision
</structfield> <type>cardinal_number
</type>
5647 Always null, since this information is not applied to return data types in
<productname>PostgreSQL
</productname>
5652 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5653 <structfield>numeric_precision_radix
</structfield> <type>cardinal_number
</type>
5656 Always null, since this information is not applied to return data types in
<productname>PostgreSQL
</productname>
5661 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5662 <structfield>numeric_scale
</structfield> <type>cardinal_number
</type>
5665 Always null, since this information is not applied to return data types in
<productname>PostgreSQL
</productname>
5670 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5671 <structfield>datetime_precision
</structfield> <type>cardinal_number
</type>
5674 Always null, since this information is not applied to return data types in
<productname>PostgreSQL
</productname>
5679 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5680 <structfield>interval_type
</structfield> <type>character_data
</type>
5683 Always null, since this information is not applied to return data types in
<productname>PostgreSQL
</productname>
5688 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5689 <structfield>interval_precision
</structfield> <type>cardinal_number
</type>
5692 Always null, since this information is not applied to return data types in
<productname>PostgreSQL
</productname>
5697 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5698 <structfield>type_udt_catalog
</structfield> <type>sql_identifier
</type>
5701 Name of the database that the return data type of the function
5702 is defined in (always the current database). Null for a procedure.
5707 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5708 <structfield>type_udt_schema
</structfield> <type>sql_identifier
</type>
5711 Name of the schema that the return data type of the function is
5712 defined in. Null for a procedure.
5717 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5718 <structfield>type_udt_name
</structfield> <type>sql_identifier
</type>
5721 Name of the return data type of the function. Null for a procedure.
5726 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5727 <structfield>scope_catalog
</structfield> <type>sql_identifier
</type>
5730 Applies to a feature not available in
<productname>PostgreSQL
</productname>
5735 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5736 <structfield>scope_schema
</structfield> <type>sql_identifier
</type>
5739 Applies to a feature not available in
<productname>PostgreSQL
</productname>
5744 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5745 <structfield>scope_name
</structfield> <type>sql_identifier
</type>
5748 Applies to a feature not available in
<productname>PostgreSQL
</productname>
5753 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5754 <structfield>maximum_cardinality
</structfield> <type>cardinal_number
</type>
5757 Always null, because arrays always have unlimited maximum cardinality in
<productname>PostgreSQL
</productname>
5762 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5763 <structfield>dtd_identifier
</structfield> <type>sql_identifier
</type>
5766 An identifier of the data type descriptor of the return data
5767 type of this function, unique among the data type descriptors
5768 pertaining to the function. This is mainly useful for joining
5769 with other instances of such identifiers. (The specific format
5770 of the identifier is not defined and not guaranteed to remain
5771 the same in future versions.)
5776 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5777 <structfield>routine_body
</structfield> <type>character_data
</type>
5780 If the function is an SQL function, then
5781 <literal>SQL
</literal>, else
<literal>EXTERNAL
</literal>.
5786 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5787 <structfield>routine_definition
</structfield> <type>character_data
</type>
5790 The source text of the function (null if the function is not
5791 owned by a currently enabled role). (According to the SQL
5792 standard, this column is only applicable if
5793 <literal>routine_body
</literal> is
<literal>SQL
</literal>, but
5794 in
<productname>PostgreSQL
</productname> it will contain
5795 whatever source text was specified when the function was
5801 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5802 <structfield>external_name
</structfield> <type>character_data
</type>
5805 If this function is a C function, then the external name (link
5806 symbol) of the function; else null. (This works out to be the
5807 same value that is shown in
5808 <literal>routine_definition
</literal>.)
5813 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5814 <structfield>external_language
</structfield> <type>character_data
</type>
5817 The language the function is written in
5822 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5823 <structfield>parameter_style
</structfield> <type>character_data
</type>
5826 Always
<literal>GENERAL
</literal> (The SQL standard defines
5827 other parameter styles, which are not available in
<productname>PostgreSQL
</productname>.)
5832 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5833 <structfield>is_deterministic
</structfield> <type>yes_or_no
</type>
5836 If the function is declared immutable (called deterministic in
5837 the SQL standard), then
<literal>YES
</literal>, else
5838 <literal>NO
</literal>. (You cannot query the other volatility
5839 levels available in
<productname>PostgreSQL
</productname> through the information schema.)
5844 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5845 <structfield>sql_data_access
</structfield> <type>character_data
</type>
5848 Always
<literal>MODIFIES
</literal>, meaning that the function
5849 possibly modifies SQL data. This information is not useful for
5850 <productname>PostgreSQL
</productname>.
5855 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5856 <structfield>is_null_call
</structfield> <type>yes_or_no
</type>
5859 If the function automatically returns null if any of its
5860 arguments are null, then
<literal>YES
</literal>, else
5861 <literal>NO
</literal>. Null for a procedure.
5866 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5867 <structfield>sql_path
</structfield> <type>character_data
</type>
5870 Applies to a feature not available in
<productname>PostgreSQL
</productname>
5875 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5876 <structfield>schema_level_routine
</structfield> <type>yes_or_no
</type>
5879 Always
<literal>YES
</literal> (The opposite would be a method
5880 of a user-defined type, which is a feature not available in
5881 <productname>PostgreSQL
</productname>.)
5886 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5887 <structfield>max_dynamic_result_sets
</structfield> <type>cardinal_number
</type>
5890 Applies to a feature not available in
<productname>PostgreSQL
</productname>
5895 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5896 <structfield>is_user_defined_cast
</structfield> <type>yes_or_no
</type>
5899 Applies to a feature not available in
<productname>PostgreSQL
</productname>
5904 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5905 <structfield>is_implicitly_invocable
</structfield> <type>yes_or_no
</type>
5908 Applies to a feature not available in
<productname>PostgreSQL
</productname>
5913 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5914 <structfield>security_type
</structfield> <type>character_data
</type>
5917 If the function runs with the privileges of the current user,
5918 then
<literal>INVOKER
</literal>, if the function runs with the
5919 privileges of the user who defined it, then
5920 <literal>DEFINER
</literal>.
5925 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5926 <structfield>to_sql_specific_catalog
</structfield> <type>sql_identifier
</type>
5929 Applies to a feature not available in
<productname>PostgreSQL
</productname>
5934 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5935 <structfield>to_sql_specific_schema
</structfield> <type>sql_identifier
</type>
5938 Applies to a feature not available in
<productname>PostgreSQL
</productname>
5943 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5944 <structfield>to_sql_specific_name
</structfield> <type>sql_identifier
</type>
5947 Applies to a feature not available in
<productname>PostgreSQL
</productname>
5952 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5953 <structfield>as_locator
</structfield> <type>yes_or_no
</type>
5956 Applies to a feature not available in
<productname>PostgreSQL
</productname>
5961 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5962 <structfield>created
</structfield> <type>time_stamp
</type>
5965 Applies to a feature not available in
<productname>PostgreSQL
</productname>
5970 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5971 <structfield>last_altered
</structfield> <type>time_stamp
</type>
5974 Applies to a feature not available in
<productname>PostgreSQL
</productname>
5979 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5980 <structfield>new_savepoint_level
</structfield> <type>yes_or_no
</type>
5983 Applies to a feature not available in
<productname>PostgreSQL
</productname>
5988 <entry role=
"catalog_table_entry"><para role=
"column_definition">
5989 <structfield>is_udt_dependent
</structfield> <type>yes_or_no
</type>
5992 Currently always
<literal>NO
</literal>. The alternative
5993 <literal>YES
</literal> applies to a feature not available in
5994 <productname>PostgreSQL
</productname>.
5999 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6000 <structfield>result_cast_from_data_type
</structfield> <type>character_data
</type>
6003 Applies to a feature not available in
<productname>PostgreSQL
</productname>
6008 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6009 <structfield>result_cast_as_locator
</structfield> <type>yes_or_no
</type>
6012 Applies to a feature not available in
<productname>PostgreSQL
</productname>
6017 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6018 <structfield>result_cast_char_max_length
</structfield> <type>cardinal_number
</type>
6021 Applies to a feature not available in
<productname>PostgreSQL
</productname>
6026 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6027 <structfield>result_cast_char_octet_length
</structfield> <type>cardinal_number
</type>
6030 Applies to a feature not available in
<productname>PostgreSQL
</productname>
6035 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6036 <structfield>result_cast_char_set_catalog
</structfield> <type>sql_identifier
</type>
6039 Applies to a feature not available in
<productname>PostgreSQL
</productname>
6044 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6045 <structfield>result_cast_char_set_schema
</structfield> <type>sql_identifier
</type>
6048 Applies to a feature not available in
<productname>PostgreSQL
</productname>
6053 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6054 <structfield>result_cast_char_set_name
</structfield> <type>sql_identifier
</type>
6057 Applies to a feature not available in
<productname>PostgreSQL
</productname>
6062 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6063 <structfield>result_cast_collation_catalog
</structfield> <type>sql_identifier
</type>
6066 Applies to a feature not available in
<productname>PostgreSQL
</productname>
6071 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6072 <structfield>result_cast_collation_schema
</structfield> <type>sql_identifier
</type>
6075 Applies to a feature not available in
<productname>PostgreSQL
</productname>
6080 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6081 <structfield>result_cast_collation_name
</structfield> <type>sql_identifier
</type>
6084 Applies to a feature not available in
<productname>PostgreSQL
</productname>
6089 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6090 <structfield>result_cast_numeric_precision
</structfield> <type>cardinal_number
</type>
6093 Applies to a feature not available in
<productname>PostgreSQL
</productname>
6098 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6099 <structfield>result_cast_numeric_precision_radix
</structfield> <type>cardinal_number
</type>
6102 Applies to a feature not available in
<productname>PostgreSQL
</productname>
6107 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6108 <structfield>result_cast_numeric_scale
</structfield> <type>cardinal_number
</type>
6111 Applies to a feature not available in
<productname>PostgreSQL
</productname>
6116 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6117 <structfield>result_cast_datetime_precision
</structfield> <type>cardinal_number
</type>
6120 Applies to a feature not available in
<productname>PostgreSQL
</productname>
6125 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6126 <structfield>result_cast_interval_type
</structfield> <type>character_data
</type>
6129 Applies to a feature not available in
<productname>PostgreSQL
</productname>
6134 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6135 <structfield>result_cast_interval_precision
</structfield> <type>cardinal_number
</type>
6138 Applies to a feature not available in
<productname>PostgreSQL
</productname>
6143 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6144 <structfield>result_cast_type_udt_catalog
</structfield> <type>sql_identifier
</type>
6147 Applies to a feature not available in
<productname>PostgreSQL
</productname>
6152 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6153 <structfield>result_cast_type_udt_schema
</structfield> <type>sql_identifier
</type>
6156 Applies to a feature not available in
<productname>PostgreSQL
</productname>
6161 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6162 <structfield>result_cast_type_udt_name
</structfield> <type>sql_identifier
</type>
6165 Applies to a feature not available in
<productname>PostgreSQL
</productname>
6170 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6171 <structfield>result_cast_scope_catalog
</structfield> <type>sql_identifier
</type>
6174 Applies to a feature not available in
<productname>PostgreSQL
</productname>
6179 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6180 <structfield>result_cast_scope_schema
</structfield> <type>sql_identifier
</type>
6183 Applies to a feature not available in
<productname>PostgreSQL
</productname>
6188 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6189 <structfield>result_cast_scope_name
</structfield> <type>sql_identifier
</type>
6192 Applies to a feature not available in
<productname>PostgreSQL
</productname>
6197 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6198 <structfield>result_cast_maximum_cardinality
</structfield> <type>cardinal_number
</type>
6201 Applies to a feature not available in
<productname>PostgreSQL
</productname>
6206 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6207 <structfield>result_cast_dtd_identifier
</structfield> <type>sql_identifier
</type>
6210 Applies to a feature not available in
<productname>PostgreSQL
</productname>
6218 <sect1 id=
"infoschema-schemata">
6219 <title><literal>schemata
</literal></title>
6222 The view
<literal>schemata
</literal> contains all schemas in the current
6223 database that the current user has access to (by way of being the owner or
6224 having some privilege).
6228 <title><structname>schemata
</structname> Columns
</title>
6232 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6243 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6244 <structfield>catalog_name
</structfield> <type>sql_identifier
</type>
6247 Name of the database that the schema is contained in (always the current database)
6252 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6253 <structfield>schema_name
</structfield> <type>sql_identifier
</type>
6261 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6262 <structfield>schema_owner
</structfield> <type>sql_identifier
</type>
6265 Name of the owner of the schema
6270 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6271 <structfield>default_character_set_catalog
</structfield> <type>sql_identifier
</type>
6274 Applies to a feature not available in
<productname>PostgreSQL
</productname>
6279 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6280 <structfield>default_character_set_schema
</structfield> <type>sql_identifier
</type>
6283 Applies to a feature not available in
<productname>PostgreSQL
</productname>
6288 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6289 <structfield>default_character_set_name
</structfield> <type>sql_identifier
</type>
6292 Applies to a feature not available in
<productname>PostgreSQL
</productname>
6297 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6298 <structfield>sql_path
</structfield> <type>character_data
</type>
6301 Applies to a feature not available in
<productname>PostgreSQL
</productname>
6309 <sect1 id=
"infoschema-sequences">
6310 <title><literal>sequences
</literal></title>
6313 The view
<literal>sequences
</literal> contains all sequences
6314 defined in the current database. Only those sequences are shown
6315 that the current user has access to (by way of being the owner or
6316 having some privilege).
6320 <title><structname>sequences
</structname> Columns
</title>
6324 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6335 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6336 <structfield>sequence_catalog
</structfield> <type>sql_identifier
</type>
6339 Name of the database that contains the sequence (always the current database)
6344 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6345 <structfield>sequence_schema
</structfield> <type>sql_identifier
</type>
6348 Name of the schema that contains the sequence
6353 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6354 <structfield>sequence_name
</structfield> <type>sql_identifier
</type>
6357 Name of the sequence
6362 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6363 <structfield>data_type
</structfield> <type>character_data
</type>
6366 The data type of the sequence.
6371 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6372 <structfield>numeric_precision
</structfield> <type>cardinal_number
</type>
6375 This column contains the (declared or implicit) precision of
6376 the sequence data type (see above). The precision indicates
6377 the number of significant digits. It can be expressed in
6378 decimal (base
10) or binary (base
2) terms, as specified in the
6379 column
<literal>numeric_precision_radix
</literal>.
6384 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6385 <structfield>numeric_precision_radix
</structfield> <type>cardinal_number
</type>
6388 This column indicates in which base the values in the columns
6389 <literal>numeric_precision
</literal> and
6390 <literal>numeric_scale
</literal> are expressed. The value is
6396 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6397 <structfield>numeric_scale
</structfield> <type>cardinal_number
</type>
6400 This column contains the (declared or implicit) scale of the
6401 sequence data type (see above). The scale indicates the number
6402 of significant digits to the right of the decimal point. It
6403 can be expressed in decimal (base
10) or binary (base
2) terms,
6404 as specified in the column
6405 <literal>numeric_precision_radix
</literal>.
6410 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6411 <structfield>start_value
</structfield> <type>character_data
</type>
6414 The start value of the sequence
6419 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6420 <structfield>minimum_value
</structfield> <type>character_data
</type>
6423 The minimum value of the sequence
6428 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6429 <structfield>maximum_value
</structfield> <type>character_data
</type>
6432 The maximum value of the sequence
6437 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6438 <structfield>increment
</structfield> <type>character_data
</type>
6441 The increment of the sequence
6446 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6447 <structfield>cycle_option
</structfield> <type>yes_or_no
</type>
6450 <literal>YES
</literal> if the sequence cycles, else
<literal>NO
</literal>
6458 Note that in accordance with the SQL standard, the start, minimum,
6459 maximum, and increment values are returned as character strings.
6463 <sect1 id=
"infoschema-sql-features">
6464 <title><literal>sql_features
</literal></title>
6467 The table
<literal>sql_features
</literal> contains information
6468 about which formal features defined in the SQL standard are
6469 supported by
<productname>PostgreSQL
</productname>. This is the
6470 same information that is presented in
<xref linkend=
"features"/>.
6471 There you can also find some additional background information.
6475 <title><structname>sql_features
</structname> Columns
</title>
6479 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6490 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6491 <structfield>feature_id
</structfield> <type>character_data
</type>
6494 Identifier string of the feature
6499 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6500 <structfield>feature_name
</structfield> <type>character_data
</type>
6503 Descriptive name of the feature
6508 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6509 <structfield>sub_feature_id
</structfield> <type>character_data
</type>
6512 Identifier string of the subfeature, or a zero-length string if not a subfeature
6517 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6518 <structfield>sub_feature_name
</structfield> <type>character_data
</type>
6521 Descriptive name of the subfeature, or a zero-length string if not a subfeature
6526 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6527 <structfield>is_supported
</structfield> <type>yes_or_no
</type>
6530 <literal>YES
</literal> if the feature is fully supported by the
6531 current version of
<productname>PostgreSQL
</productname>,
<literal>NO
</literal> if not
6536 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6537 <structfield>is_verified_by
</structfield> <type>character_data
</type>
6540 Always null, since the
<productname>PostgreSQL
</productname> development group does not
6541 perform formal testing of feature conformance
6546 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6547 <structfield>comments
</structfield> <type>character_data
</type>
6550 Possibly a comment about the supported status of the feature
6558 <sect1 id=
"infoschema-sql-implementation-info">
6559 <title><literal>sql_implementation_info
</literal></title>
6562 The table
<literal>sql_implementation_info
</literal> contains
6563 information about various aspects that are left
6564 implementation-defined by the SQL standard. This information is
6565 primarily intended for use in the context of the ODBC interface;
6566 users of other interfaces will probably find this information to be
6567 of little use. For this reason, the individual implementation
6568 information items are not described here; you will find them in the
6569 description of the ODBC interface.
6573 <title><structname>sql_implementation_info
</structname> Columns
</title>
6577 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6588 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6589 <structfield>implementation_info_id
</structfield> <type>character_data
</type>
6592 Identifier string of the implementation information item
6597 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6598 <structfield>implementation_info_name
</structfield> <type>character_data
</type>
6601 Descriptive name of the implementation information item
6606 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6607 <structfield>integer_value
</structfield> <type>cardinal_number
</type>
6610 Value of the implementation information item, or null if the
6611 value is contained in the column
6612 <literal>character_value
</literal>
6617 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6618 <structfield>character_value
</structfield> <type>character_data
</type>
6621 Value of the implementation information item, or null if the
6622 value is contained in the column
6623 <literal>integer_value
</literal>
6628 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6629 <structfield>comments
</structfield> <type>character_data
</type>
6632 Possibly a comment pertaining to the implementation information item
6640 <sect1 id=
"infoschema-sql-parts">
6641 <title><literal>sql_parts
</literal></title>
6644 The table
<literal>sql_parts
</literal> contains information about
6645 which of the several parts of the SQL standard are supported by
6646 <productname>PostgreSQL
</productname>.
6650 <title><structname>sql_parts
</structname> Columns
</title>
6654 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6665 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6666 <structfield>feature_id
</structfield> <type>character_data
</type>
6669 An identifier string containing the number of the part
6674 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6675 <structfield>feature_name
</structfield> <type>character_data
</type>
6678 Descriptive name of the part
6683 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6684 <structfield>is_supported
</structfield> <type>yes_or_no
</type>
6687 <literal>YES
</literal> if the part is fully supported by the
6688 current version of
<productname>PostgreSQL
</productname>,
6689 <literal>NO
</literal> if not
6694 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6695 <structfield>is_verified_by
</structfield> <type>character_data
</type>
6698 Always null, since the
<productname>PostgreSQL
</productname> development group does not
6699 perform formal testing of feature conformance
6704 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6705 <structfield>comments
</structfield> <type>character_data
</type>
6708 Possibly a comment about the supported status of the part
6716 <sect1 id=
"infoschema-sql-sizing">
6717 <title><literal>sql_sizing
</literal></title>
6720 The table
<literal>sql_sizing
</literal> contains information about
6721 various size limits and maximum values in
6722 <productname>PostgreSQL
</productname>. This information is
6723 primarily intended for use in the context of the ODBC interface;
6724 users of other interfaces will probably find this information to be
6725 of little use. For this reason, the individual sizing items are
6726 not described here; you will find them in the description of the
6731 <title><structname>sql_sizing
</structname> Columns
</title>
6735 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6746 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6747 <structfield>sizing_id
</structfield> <type>cardinal_number
</type>
6750 Identifier of the sizing item
6755 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6756 <structfield>sizing_name
</structfield> <type>character_data
</type>
6759 Descriptive name of the sizing item
6764 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6765 <structfield>supported_value
</structfield> <type>cardinal_number
</type>
6768 Value of the sizing item, or
0 if the size is unlimited or
6769 cannot be determined, or null if the features for which the
6770 sizing item is applicable are not supported
6775 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6776 <structfield>comments
</structfield> <type>character_data
</type>
6779 Possibly a comment pertaining to the sizing item
6787 <sect1 id=
"infoschema-table-constraints">
6788 <title><literal>table_constraints
</literal></title>
6791 The view
<literal>table_constraints
</literal> contains all
6792 constraints belonging to tables that the current user owns or has
6793 some privilege other than
<literal>SELECT
</literal> on.
6797 <title><structname>table_constraints
</structname> Columns
</title>
6801 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6812 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6813 <structfield>constraint_catalog
</structfield> <type>sql_identifier
</type>
6816 Name of the database that contains the constraint (always the current database)
6821 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6822 <structfield>constraint_schema
</structfield> <type>sql_identifier
</type>
6825 Name of the schema that contains the constraint
6830 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6831 <structfield>constraint_name
</structfield> <type>sql_identifier
</type>
6834 Name of the constraint
6839 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6840 <structfield>table_catalog
</structfield> <type>sql_identifier
</type>
6843 Name of the database that contains the table (always the current database)
6848 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6849 <structfield>table_schema
</structfield> <type>sql_identifier
</type>
6852 Name of the schema that contains the table
6857 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6858 <structfield>table_name
</structfield> <type>sql_identifier
</type>
6866 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6867 <structfield>constraint_type
</structfield> <type>character_data
</type>
6870 Type of the constraint:
<literal>CHECK
</literal> (includes not-null constraints),
6871 <literal>FOREIGN KEY
</literal>,
<literal>PRIMARY KEY
</literal>,
6872 or
<literal>UNIQUE
</literal>
6877 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6878 <structfield>is_deferrable
</structfield> <type>yes_or_no
</type>
6881 <literal>YES
</literal> if the constraint is deferrable,
<literal>NO
</literal> if not
6886 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6887 <structfield>initially_deferred
</structfield> <type>yes_or_no
</type>
6890 <literal>YES
</literal> if the constraint is deferrable and initially deferred,
<literal>NO
</literal> if not
6895 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6896 <structfield>enforced
</structfield> <type>yes_or_no
</type>
6899 <literal>YES
</literal> if the constraint is enforced,
<literal>NO
</literal> if not
6904 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6905 <structfield>nulls_distinct
</structfield> <type>yes_or_no
</type>
6908 If the constraint is a unique constraint, then
<literal>YES
</literal>
6909 if the constraint treats nulls as distinct or
<literal>NO
</literal> if
6910 it treats nulls as not distinct, otherwise null for other types of
6919 <sect1 id=
"infoschema-table-privileges">
6920 <title><literal>table_privileges
</literal></title>
6923 The view
<literal>table_privileges
</literal> identifies all
6924 privileges granted on tables or views to a currently enabled role
6925 or by a currently enabled role. There is one row for each
6926 combination of table, grantor, and grantee.
6930 <title><structname>table_privileges
</structname> Columns
</title>
6934 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6945 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6946 <structfield>grantor
</structfield> <type>sql_identifier
</type>
6949 Name of the role that granted the privilege
6954 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6955 <structfield>grantee
</structfield> <type>sql_identifier
</type>
6958 Name of the role that the privilege was granted to
6963 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6964 <structfield>table_catalog
</structfield> <type>sql_identifier
</type>
6967 Name of the database that contains the table (always the current database)
6972 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6973 <structfield>table_schema
</structfield> <type>sql_identifier
</type>
6976 Name of the schema that contains the table
6981 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6982 <structfield>table_name
</structfield> <type>sql_identifier
</type>
6990 <entry role=
"catalog_table_entry"><para role=
"column_definition">
6991 <structfield>privilege_type
</structfield> <type>character_data
</type>
6994 Type of the privilege:
<literal>SELECT
</literal>,
6995 <literal>INSERT
</literal>,
<literal>UPDATE
</literal>,
6996 <literal>DELETE
</literal>,
<literal>TRUNCATE
</literal>,
6997 <literal>REFERENCES
</literal>, or
<literal>TRIGGER
</literal>
7002 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7003 <structfield>is_grantable
</structfield> <type>yes_or_no
</type>
7006 <literal>YES
</literal> if the privilege is grantable,
<literal>NO
</literal> if not
7011 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7012 <structfield>with_hierarchy
</structfield> <type>yes_or_no
</type>
7015 In the SQL standard,
<literal>WITH HIERARCHY OPTION
</literal>
7016 is a separate (sub-)privilege allowing certain operations on
7017 table inheritance hierarchies. In PostgreSQL, this is included
7018 in the
<literal>SELECT
</literal> privilege, so this column
7019 shows
<literal>YES
</literal> if the privilege
7020 is
<literal>SELECT
</literal>, else
<literal>NO
</literal>.
7028 <sect1 id=
"infoschema-tables">
7029 <title><literal>tables
</literal></title>
7032 The view
<literal>tables
</literal> contains all tables and views
7033 defined in the current database. Only those tables and views are
7034 shown that the current user has access to (by way of being the
7035 owner or having some privilege).
7039 <title><structname>tables
</structname> Columns
</title>
7043 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7054 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7055 <structfield>table_catalog
</structfield> <type>sql_identifier
</type>
7058 Name of the database that contains the table (always the current database)
7063 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7064 <structfield>table_schema
</structfield> <type>sql_identifier
</type>
7067 Name of the schema that contains the table
7072 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7073 <structfield>table_name
</structfield> <type>sql_identifier
</type>
7081 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7082 <structfield>table_type
</structfield> <type>character_data
</type>
7085 Type of the table:
<literal>BASE TABLE
</literal> for a
7086 persistent base table (the normal table type),
7087 <literal>VIEW
</literal> for a view,
<literal>FOREIGN
</literal>
7088 for a foreign table, or
7089 <literal>LOCAL TEMPORARY
</literal> for a temporary table
7094 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7095 <structfield>self_referencing_column_name
</structfield> <type>sql_identifier
</type>
7098 Applies to a feature not available in
<productname>PostgreSQL
</productname>
7103 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7104 <structfield>reference_generation
</structfield> <type>character_data
</type>
7107 Applies to a feature not available in
<productname>PostgreSQL
</productname>
7112 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7113 <structfield>user_defined_type_catalog
</structfield> <type>sql_identifier
</type>
7116 If the table is a typed table, the name of the database that
7117 contains the underlying data type (always the current
7118 database), else null.
7123 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7124 <structfield>user_defined_type_schema
</structfield> <type>sql_identifier
</type>
7127 If the table is a typed table, the name of the schema that
7128 contains the underlying data type, else null.
7133 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7134 <structfield>user_defined_type_name
</structfield> <type>sql_identifier
</type>
7137 If the table is a typed table, the name of the underlying data
7143 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7144 <structfield>is_insertable_into
</structfield> <type>yes_or_no
</type>
7147 <literal>YES
</literal> if the table is insertable into,
7148 <literal>NO
</literal> if not (Base tables are always insertable
7149 into, views not necessarily.)
7154 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7155 <structfield>is_typed
</structfield> <type>yes_or_no
</type>
7158 <literal>YES
</literal> if the table is a typed table,
<literal>NO
</literal> if not
7163 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7164 <structfield>commit_action
</structfield> <type>character_data
</type>
7175 <sect1 id=
"infoschema-transforms">
7176 <title><literal>transforms
</literal></title>
7179 The view
<literal>transforms
</literal> contains information about the
7180 transforms defined in the current database. More precisely, it contains a
7181 row for each function contained in a transform (the
<quote>from SQL
</quote>
7182 or
<quote>to SQL
</quote> function).
7186 <title><structname>transforms
</structname> Columns
</title>
7190 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7201 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7202 <structfield>udt_catalog
</structfield> <type>sql_identifier
</type>
7205 Name of the database that contains the type the transform is for (always the current database)
7210 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7211 <structfield>udt_schema
</structfield> <type>sql_identifier
</type>
7214 Name of the schema that contains the type the transform is for
7219 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7220 <structfield>udt_name
</structfield> <type>sql_identifier
</type>
7223 Name of the type the transform is for
7228 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7229 <structfield>specific_catalog
</structfield> <type>sql_identifier
</type>
7232 Name of the database containing the function (always the current database)
7237 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7238 <structfield>specific_schema
</structfield> <type>sql_identifier
</type>
7241 Name of the schema containing the function
7246 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7247 <structfield>specific_name
</structfield> <type>sql_identifier
</type>
7250 The
<quote>specific name
</quote> of the function. See
<xref linkend=
"infoschema-routines"/> for more information.
7255 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7256 <structfield>group_name
</structfield> <type>sql_identifier
</type>
7259 The SQL standard allows defining transforms in
<quote>groups
</quote>,
7260 and selecting a group at run time. PostgreSQL does not support this.
7261 Instead, transforms are specific to a language. As a compromise, this
7262 field contains the language the transform is for.
7267 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7268 <structfield>transform_type
</structfield> <type>character_data
</type>
7271 <literal>FROM SQL
</literal> or
<literal>TO SQL
</literal>
7279 <sect1 id=
"infoschema-triggered-update-columns">
7280 <title><literal>triggered_update_columns
</literal></title>
7283 For triggers in the current database that specify a column list
7284 (like
<literal>UPDATE OF column1, column2
</literal>), the
7285 view
<literal>triggered_update_columns
</literal> identifies these
7286 columns. Triggers that do not specify a column list are not
7287 included in this view. Only those columns are shown that the
7288 current user owns or has some privilege other than
7289 <literal>SELECT
</literal> on.
7293 <title><structname>triggered_update_columns
</structname> Columns
</title>
7297 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7308 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7309 <structfield>trigger_catalog
</structfield> <type>sql_identifier
</type>
7312 Name of the database that contains the trigger (always the current database)
7317 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7318 <structfield>trigger_schema
</structfield> <type>sql_identifier
</type>
7321 Name of the schema that contains the trigger
7326 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7327 <structfield>trigger_name
</structfield> <type>sql_identifier
</type>
7335 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7336 <structfield>event_object_catalog
</structfield> <type>sql_identifier
</type>
7339 Name of the database that contains the table that the trigger
7340 is defined on (always the current database)
7345 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7346 <structfield>event_object_schema
</structfield> <type>sql_identifier
</type>
7349 Name of the schema that contains the table that the trigger is defined on
7354 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7355 <structfield>event_object_table
</structfield> <type>sql_identifier
</type>
7358 Name of the table that the trigger is defined on
7363 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7364 <structfield>event_object_column
</structfield> <type>sql_identifier
</type>
7367 Name of the column that the trigger is defined on
7375 <sect1 id=
"infoschema-triggers">
7376 <title><literal>triggers
</literal></title>
7379 The view
<literal>triggers
</literal> contains all triggers defined
7380 in the current database on tables and views that the current user owns
7381 or has some privilege other than
<literal>SELECT
</literal> on.
7385 <title><structname>triggers
</structname> Columns
</title>
7389 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7400 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7401 <structfield>trigger_catalog
</structfield> <type>sql_identifier
</type>
7404 Name of the database that contains the trigger (always the current database)
7409 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7410 <structfield>trigger_schema
</structfield> <type>sql_identifier
</type>
7413 Name of the schema that contains the trigger
7418 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7419 <structfield>trigger_name
</structfield> <type>sql_identifier
</type>
7427 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7428 <structfield>event_manipulation
</structfield> <type>character_data
</type>
7431 Event that fires the trigger (
<literal>INSERT
</literal>,
7432 <literal>UPDATE
</literal>, or
<literal>DELETE
</literal>)
7437 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7438 <structfield>event_object_catalog
</structfield> <type>sql_identifier
</type>
7441 Name of the database that contains the table that the trigger
7442 is defined on (always the current database)
7447 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7448 <structfield>event_object_schema
</structfield> <type>sql_identifier
</type>
7451 Name of the schema that contains the table that the trigger is defined on
7456 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7457 <structfield>event_object_table
</structfield> <type>sql_identifier
</type>
7460 Name of the table that the trigger is defined on
7465 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7466 <structfield>action_order
</structfield> <type>cardinal_number
</type>
7469 Firing order among triggers on the same table having the same
7470 <literal>event_manipulation
</literal>,
7471 <literal>action_timing
</literal>, and
7472 <literal>action_orientation
</literal>. In
7473 <productname>PostgreSQL
</productname>, triggers are fired in name
7474 order, so this column reflects that.
7479 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7480 <structfield>action_condition
</structfield> <type>character_data
</type>
7483 <literal>WHEN
</literal> condition of the trigger, null if none
7484 (also null if the table is not owned by a currently enabled
7490 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7491 <structfield>action_statement
</structfield> <type>character_data
</type>
7494 Statement that is executed by the trigger (currently always
7495 <literal>EXECUTE FUNCTION
7496 <replaceable>function
</replaceable>(...)
</literal>)
7501 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7502 <structfield>action_orientation
</structfield> <type>character_data
</type>
7505 Identifies whether the trigger fires once for each processed
7506 row or once for each statement (
<literal>ROW
</literal> or
7507 <literal>STATEMENT
</literal>)
7512 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7513 <structfield>action_timing
</structfield> <type>character_data
</type>
7516 Time at which the trigger fires (
<literal>BEFORE
</literal>,
7517 <literal>AFTER
</literal>, or
<literal>INSTEAD OF
</literal>)
7522 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7523 <structfield>action_reference_old_table
</structfield> <type>sql_identifier
</type>
7526 Name of the
<quote>old
</quote> transition table, or null if none
7531 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7532 <structfield>action_reference_new_table
</structfield> <type>sql_identifier
</type>
7535 Name of the
<quote>new
</quote> transition table, or null if none
7540 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7541 <structfield>action_reference_old_row
</structfield> <type>sql_identifier
</type>
7544 Applies to a feature not available in
<productname>PostgreSQL
</productname>
7549 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7550 <structfield>action_reference_new_row
</structfield> <type>sql_identifier
</type>
7553 Applies to a feature not available in
<productname>PostgreSQL
</productname>
7558 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7559 <structfield>created
</structfield> <type>time_stamp
</type>
7562 Applies to a feature not available in
<productname>PostgreSQL
</productname>
7570 Triggers in
<productname>PostgreSQL
</productname> have two
7571 incompatibilities with the SQL standard that affect the
7572 representation in the information schema. First, trigger names are
7573 local to each table in
<productname>PostgreSQL
</productname>, rather
7574 than being independent schema objects. Therefore there can be duplicate
7575 trigger names defined in one schema, so long as they belong to
7576 different tables. (
<literal>trigger_catalog
</literal> and
7577 <literal>trigger_schema
</literal> are really the values pertaining
7578 to the table that the trigger is defined on.) Second, triggers can
7579 be defined to fire on multiple events in
7580 <productname>PostgreSQL
</productname> (e.g.,
<literal>ON INSERT OR
7581 UPDATE
</literal>), whereas the SQL standard only allows one. If a
7582 trigger is defined to fire on multiple events, it is represented as
7583 multiple rows in the information schema, one for each type of
7584 event. As a consequence of these two issues, the primary key of
7585 the view
<literal>triggers
</literal> is really
7586 <literal>(trigger_catalog, trigger_schema, event_object_table,
7587 trigger_name, event_manipulation)
</literal> instead of
7588 <literal>(trigger_catalog, trigger_schema, trigger_name)
</literal>,
7589 which is what the SQL standard specifies. Nonetheless, if you
7590 define your triggers in a manner that conforms with the SQL
7591 standard (trigger names unique in the schema and only one event
7592 type per trigger), this will not affect you.
7597 Prior to
<productname>PostgreSQL
</productname> 9.1, this view's columns
7598 <structfield>action_timing
</structfield>,
7599 <structfield>action_reference_old_table
</structfield>,
7600 <structfield>action_reference_new_table
</structfield>,
7601 <structfield>action_reference_old_row
</structfield>, and
7602 <structfield>action_reference_new_row
</structfield>
7604 <structfield>condition_timing
</structfield>,
7605 <structfield>condition_reference_old_table
</structfield>,
7606 <structfield>condition_reference_new_table
</structfield>,
7607 <structfield>condition_reference_old_row
</structfield>, and
7608 <structfield>condition_reference_new_row
</structfield>
7610 That was how they were named in the SQL:
1999 standard.
7611 The new naming conforms to SQL:
2003 and later.
7616 <sect1 id=
"infoschema-udt-privileges">
7617 <title><literal>udt_privileges
</literal></title>
7620 The view
<literal>udt_privileges
</literal> identifies
7621 <literal>USAGE
</literal> privileges granted on user-defined types to a
7622 currently enabled role or by a currently enabled role. There is one row for
7623 each combination of type, grantor, and grantee. This view shows only
7624 composite types (see under
<xref linkend=
"infoschema-user-defined-types"/>
7626 <xref linkend=
"infoschema-usage-privileges"/> for domain privileges.
7630 <title><structname>udt_privileges
</structname> Columns
</title>
7634 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7645 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7646 <structfield>grantor
</structfield> <type>sql_identifier
</type>
7649 Name of the role that granted the privilege
7654 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7655 <structfield>grantee
</structfield> <type>sql_identifier
</type>
7658 Name of the role that the privilege was granted to
7663 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7664 <structfield>udt_catalog
</structfield> <type>sql_identifier
</type>
7667 Name of the database containing the type (always the current database)
7672 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7673 <structfield>udt_schema
</structfield> <type>sql_identifier
</type>
7676 Name of the schema containing the type
7681 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7682 <structfield>udt_name
</structfield> <type>sql_identifier
</type>
7690 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7691 <structfield>privilege_type
</structfield> <type>character_data
</type>
7694 Always
<literal>TYPE USAGE
</literal>
7699 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7700 <structfield>is_grantable
</structfield> <type>yes_or_no
</type>
7703 <literal>YES
</literal> if the privilege is grantable,
<literal>NO
</literal> if not
7711 <sect1 id=
"infoschema-usage-privileges">
7712 <title><literal>usage_privileges
</literal></title>
7715 The view
<literal>usage_privileges
</literal> identifies
7716 <literal>USAGE
</literal> privileges granted on various kinds of
7717 objects to a currently enabled role or by a currently enabled role.
7718 In
<productname>PostgreSQL
</productname>, this currently applies to
7719 collations, domains, foreign-data wrappers, foreign servers, and sequences. There is one
7720 row for each combination of object, grantor, and grantee.
7724 Since collations do not have real privileges
7725 in
<productname>PostgreSQL
</productname>, this view shows implicit
7726 non-grantable
<literal>USAGE
</literal> privileges granted by the
7727 owner to
<literal>PUBLIC
</literal> for all collations. The other
7728 object types, however, show real privileges.
7732 In PostgreSQL, sequences also support
<literal>SELECT
</literal>
7733 and
<literal>UPDATE
</literal> privileges in addition to
7734 the
<literal>USAGE
</literal> privilege. These are nonstandard and therefore
7735 not visible in the information schema.
7739 <title><structname>usage_privileges
</structname> Columns
</title>
7743 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7754 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7755 <structfield>grantor
</structfield> <type>sql_identifier
</type>
7758 Name of the role that granted the privilege
7763 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7764 <structfield>grantee
</structfield> <type>sql_identifier
</type>
7767 Name of the role that the privilege was granted to
7772 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7773 <structfield>object_catalog
</structfield> <type>sql_identifier
</type>
7776 Name of the database containing the object (always the current database)
7781 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7782 <structfield>object_schema
</structfield> <type>sql_identifier
</type>
7785 Name of the schema containing the object, if applicable,
7786 else an empty string
7791 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7792 <structfield>object_name
</structfield> <type>sql_identifier
</type>
7800 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7801 <structfield>object_type
</structfield> <type>character_data
</type>
7804 <literal>COLLATION
</literal> or
<literal>DOMAIN
</literal> or
<literal>FOREIGN DATA WRAPPER
</literal> or
<literal>FOREIGN SERVER
</literal> or
<literal>SEQUENCE
</literal>
7809 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7810 <structfield>privilege_type
</structfield> <type>character_data
</type>
7813 Always
<literal>USAGE
</literal>
7818 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7819 <structfield>is_grantable
</structfield> <type>yes_or_no
</type>
7822 <literal>YES
</literal> if the privilege is grantable,
<literal>NO
</literal> if not
7830 <sect1 id=
"infoschema-user-defined-types">
7831 <title><literal>user_defined_types
</literal></title>
7834 The view
<literal>user_defined_types
</literal> currently contains
7835 all composite types defined in the current database.
7836 Only those types are shown that the current user has access to (by way
7837 of being the owner or having some privilege).
7841 SQL knows about two kinds of user-defined types: structured types
7842 (also known as composite types
7843 in
<productname>PostgreSQL
</productname>) and distinct types (not
7844 implemented in
<productname>PostgreSQL
</productname>). To be
7845 future-proof, use the
7846 column
<literal>user_defined_type_category
</literal> to
7847 differentiate between these. Other user-defined types such as base
7848 types and enums, which are
<productname>PostgreSQL
</productname>
7849 extensions, are not shown here. For domains,
7850 see
<xref linkend=
"infoschema-domains"/> instead.
7854 <title><structname>user_defined_types
</structname> Columns
</title>
7858 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7869 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7870 <structfield>user_defined_type_catalog
</structfield> <type>sql_identifier
</type>
7873 Name of the database that contains the type (always the current database)
7878 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7879 <structfield>user_defined_type_schema
</structfield> <type>sql_identifier
</type>
7882 Name of the schema that contains the type
7887 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7888 <structfield>user_defined_type_name
</structfield> <type>sql_identifier
</type>
7896 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7897 <structfield>user_defined_type_category
</structfield> <type>character_data
</type>
7900 Currently always
<literal>STRUCTURED
</literal>
7905 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7906 <structfield>is_instantiable
</structfield> <type>yes_or_no
</type>
7909 Applies to a feature not available in
<productname>PostgreSQL
</productname>
7914 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7915 <structfield>is_final
</structfield> <type>yes_or_no
</type>
7918 Applies to a feature not available in
<productname>PostgreSQL
</productname>
7923 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7924 <structfield>ordering_form
</structfield> <type>character_data
</type>
7927 Applies to a feature not available in
<productname>PostgreSQL
</productname>
7932 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7933 <structfield>ordering_category
</structfield> <type>character_data
</type>
7936 Applies to a feature not available in
<productname>PostgreSQL
</productname>
7941 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7942 <structfield>ordering_routine_catalog
</structfield> <type>sql_identifier
</type>
7945 Applies to a feature not available in
<productname>PostgreSQL
</productname>
7950 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7951 <structfield>ordering_routine_schema
</structfield> <type>sql_identifier
</type>
7954 Applies to a feature not available in
<productname>PostgreSQL
</productname>
7959 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7960 <structfield>ordering_routine_name
</structfield> <type>sql_identifier
</type>
7963 Applies to a feature not available in
<productname>PostgreSQL
</productname>
7968 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7969 <structfield>reference_type
</structfield> <type>character_data
</type>
7972 Applies to a feature not available in
<productname>PostgreSQL
</productname>
7977 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7978 <structfield>data_type
</structfield> <type>character_data
</type>
7981 Applies to a feature not available in
<productname>PostgreSQL
</productname>
7986 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7987 <structfield>character_maximum_length
</structfield> <type>cardinal_number
</type>
7990 Applies to a feature not available in
<productname>PostgreSQL
</productname>
7995 <entry role=
"catalog_table_entry"><para role=
"column_definition">
7996 <structfield>character_octet_length
</structfield> <type>cardinal_number
</type>
7999 Applies to a feature not available in
<productname>PostgreSQL
</productname>
8004 <entry role=
"catalog_table_entry"><para role=
"column_definition">
8005 <structfield>character_set_catalog
</structfield> <type>sql_identifier
</type>
8008 Applies to a feature not available in
<productname>PostgreSQL
</productname>
8013 <entry role=
"catalog_table_entry"><para role=
"column_definition">
8014 <structfield>character_set_schema
</structfield> <type>sql_identifier
</type>
8017 Applies to a feature not available in
<productname>PostgreSQL
</productname>
8022 <entry role=
"catalog_table_entry"><para role=
"column_definition">
8023 <structfield>character_set_name
</structfield> <type>sql_identifier
</type>
8026 Applies to a feature not available in
<productname>PostgreSQL
</productname>
8031 <entry role=
"catalog_table_entry"><para role=
"column_definition">
8032 <structfield>collation_catalog
</structfield> <type>sql_identifier
</type>
8035 Applies to a feature not available in
<productname>PostgreSQL
</productname>
8040 <entry role=
"catalog_table_entry"><para role=
"column_definition">
8041 <structfield>collation_schema
</structfield> <type>sql_identifier
</type>
8044 Applies to a feature not available in
<productname>PostgreSQL
</productname>
8049 <entry role=
"catalog_table_entry"><para role=
"column_definition">
8050 <structfield>collation_name
</structfield> <type>sql_identifier
</type>
8053 Applies to a feature not available in
<productname>PostgreSQL
</productname>
8058 <entry role=
"catalog_table_entry"><para role=
"column_definition">
8059 <structfield>numeric_precision
</structfield> <type>cardinal_number
</type>
8062 Applies to a feature not available in
<productname>PostgreSQL
</productname>
8067 <entry role=
"catalog_table_entry"><para role=
"column_definition">
8068 <structfield>numeric_precision_radix
</structfield> <type>cardinal_number
</type>
8071 Applies to a feature not available in
<productname>PostgreSQL
</productname>
8076 <entry role=
"catalog_table_entry"><para role=
"column_definition">
8077 <structfield>numeric_scale
</structfield> <type>cardinal_number
</type>
8080 Applies to a feature not available in
<productname>PostgreSQL
</productname>
8085 <entry role=
"catalog_table_entry"><para role=
"column_definition">
8086 <structfield>datetime_precision
</structfield> <type>cardinal_number
</type>
8089 Applies to a feature not available in
<productname>PostgreSQL
</productname>
8094 <entry role=
"catalog_table_entry"><para role=
"column_definition">
8095 <structfield>interval_type
</structfield> <type>character_data
</type>
8098 Applies to a feature not available in
<productname>PostgreSQL
</productname>
8103 <entry role=
"catalog_table_entry"><para role=
"column_definition">
8104 <structfield>interval_precision
</structfield> <type>cardinal_number
</type>
8107 Applies to a feature not available in
<productname>PostgreSQL
</productname>
8112 <entry role=
"catalog_table_entry"><para role=
"column_definition">
8113 <structfield>source_dtd_identifier
</structfield> <type>sql_identifier
</type>
8116 Applies to a feature not available in
<productname>PostgreSQL
</productname>
8121 <entry role=
"catalog_table_entry"><para role=
"column_definition">
8122 <structfield>ref_dtd_identifier
</structfield> <type>sql_identifier
</type>
8125 Applies to a feature not available in
<productname>PostgreSQL
</productname>
8133 <sect1 id=
"infoschema-user-mapping-options">
8134 <title><literal>user_mapping_options
</literal></title>
8137 The view
<literal>user_mapping_options
</literal> contains all the
8138 options defined for user mappings in the current database. Only
8139 those user mappings are shown where the current user has access to
8140 the corresponding foreign server (by way of being the owner or
8141 having some privilege).
8145 <title><structname>user_mapping_options
</structname> Columns
</title>
8149 <entry role=
"catalog_table_entry"><para role=
"column_definition">
8160 <entry role=
"catalog_table_entry"><para role=
"column_definition">
8161 <structfield>authorization_identifier
</structfield> <type>sql_identifier
</type>
8164 Name of the user being mapped,
8165 or
<literal>PUBLIC
</literal> if the mapping is public
8170 <entry role=
"catalog_table_entry"><para role=
"column_definition">
8171 <structfield>foreign_server_catalog
</structfield> <type>sql_identifier
</type>
8174 Name of the database that the foreign server used by this
8175 mapping is defined in (always the current database)
8180 <entry role=
"catalog_table_entry"><para role=
"column_definition">
8181 <structfield>foreign_server_name
</structfield> <type>sql_identifier
</type>
8184 Name of the foreign server used by this mapping
8189 <entry role=
"catalog_table_entry"><para role=
"column_definition">
8190 <structfield>option_name
</structfield> <type>sql_identifier
</type>
8198 <entry role=
"catalog_table_entry"><para role=
"column_definition">
8199 <structfield>option_value
</structfield> <type>character_data
</type>
8202 Value of the option. This column will show as null
8203 unless the current user is the user being mapped, or the mapping
8204 is for
<literal>PUBLIC
</literal> and the current user is the
8205 server owner, or the current user is a superuser. The intent is
8206 to protect password information stored as user mapping
8215 <sect1 id=
"infoschema-user-mappings">
8216 <title><literal>user_mappings
</literal></title>
8219 The view
<literal>user_mappings
</literal> contains all user
8220 mappings defined in the current database. Only those user mappings
8221 are shown where the current user has access to the corresponding
8222 foreign server (by way of being the owner or having some
8227 <title><structname>user_mappings
</structname> Columns
</title>
8231 <entry role=
"catalog_table_entry"><para role=
"column_definition">
8242 <entry role=
"catalog_table_entry"><para role=
"column_definition">
8243 <structfield>authorization_identifier
</structfield> <type>sql_identifier
</type>
8246 Name of the user being mapped,
8247 or
<literal>PUBLIC
</literal> if the mapping is public
8252 <entry role=
"catalog_table_entry"><para role=
"column_definition">
8253 <structfield>foreign_server_catalog
</structfield> <type>sql_identifier
</type>
8256 Name of the database that the foreign server used by this
8257 mapping is defined in (always the current database)
8262 <entry role=
"catalog_table_entry"><para role=
"column_definition">
8263 <structfield>foreign_server_name
</structfield> <type>sql_identifier
</type>
8266 Name of the foreign server used by this mapping
8274 <sect1 id=
"infoschema-view-column-usage">
8275 <title><literal>view_column_usage
</literal></title>
8278 The view
<literal>view_column_usage
</literal> identifies all
8279 columns that are used in the query expression of a view (the
8280 <command>SELECT
</command> statement that defines the view). A
8281 column is only included if the table that contains the column is
8282 owned by a currently enabled role.
8287 Columns of system tables are not included. This should be fixed
8293 <title><structname>view_column_usage
</structname> Columns
</title>
8297 <entry role=
"catalog_table_entry"><para role=
"column_definition">
8308 <entry role=
"catalog_table_entry"><para role=
"column_definition">
8309 <structfield>view_catalog
</structfield> <type>sql_identifier
</type>
8312 Name of the database that contains the view (always the current database)
8317 <entry role=
"catalog_table_entry"><para role=
"column_definition">
8318 <structfield>view_schema
</structfield> <type>sql_identifier
</type>
8321 Name of the schema that contains the view
8326 <entry role=
"catalog_table_entry"><para role=
"column_definition">
8327 <structfield>view_name
</structfield> <type>sql_identifier
</type>
8335 <entry role=
"catalog_table_entry"><para role=
"column_definition">
8336 <structfield>table_catalog
</structfield> <type>sql_identifier
</type>
8339 Name of the database that contains the table that contains the
8340 column that is used by the view (always the current database)
8345 <entry role=
"catalog_table_entry"><para role=
"column_definition">
8346 <structfield>table_schema
</structfield> <type>sql_identifier
</type>
8349 Name of the schema that contains the table that contains the
8350 column that is used by the view
8355 <entry role=
"catalog_table_entry"><para role=
"column_definition">
8356 <structfield>table_name
</structfield> <type>sql_identifier
</type>
8359 Name of the table that contains the column that is used by the
8365 <entry role=
"catalog_table_entry"><para role=
"column_definition">
8366 <structfield>column_name
</structfield> <type>sql_identifier
</type>
8369 Name of the column that is used by the view
8377 <sect1 id=
"infoschema-view-routine-usage">
8378 <title><literal>view_routine_usage
</literal></title>
8381 The view
<literal>view_routine_usage
</literal> identifies all
8382 routines (functions and procedures) that are used in the query
8383 expression of a view (the
<command>SELECT
</command> statement that
8384 defines the view). A routine is only included if that routine is
8385 owned by a currently enabled role.
8389 <title><structname>view_routine_usage
</structname> Columns
</title>
8393 <entry role=
"catalog_table_entry"><para role=
"column_definition">
8404 <entry role=
"catalog_table_entry"><para role=
"column_definition">
8405 <structfield>table_catalog
</structfield> <type>sql_identifier
</type>
8408 Name of the database containing the view (always the current database)
8413 <entry role=
"catalog_table_entry"><para role=
"column_definition">
8414 <structfield>table_schema
</structfield> <type>sql_identifier
</type>
8417 Name of the schema containing the view
8422 <entry role=
"catalog_table_entry"><para role=
"column_definition">
8423 <structfield>table_name
</structfield> <type>sql_identifier
</type>
8431 <entry role=
"catalog_table_entry"><para role=
"column_definition">
8432 <structfield>specific_catalog
</structfield> <type>sql_identifier
</type>
8435 Name of the database containing the function (always the current database)
8440 <entry role=
"catalog_table_entry"><para role=
"column_definition">
8441 <structfield>specific_schema
</structfield> <type>sql_identifier
</type>
8444 Name of the schema containing the function
8449 <entry role=
"catalog_table_entry"><para role=
"column_definition">
8450 <structfield>specific_name
</structfield> <type>sql_identifier
</type>
8453 The
<quote>specific name
</quote> of the function. See
<xref linkend=
"infoschema-routines"/> for more information.
8461 <sect1 id=
"infoschema-view-table-usage">
8462 <title><literal>view_table_usage
</literal></title>
8465 The view
<literal>view_table_usage
</literal> identifies all tables
8466 that are used in the query expression of a view (the
8467 <command>SELECT
</command> statement that defines the view). A
8468 table is only included if that table is owned by a currently
8474 System tables are not included. This should be fixed sometime.
8479 <title><structname>view_table_usage
</structname> Columns
</title>
8483 <entry role=
"catalog_table_entry"><para role=
"column_definition">
8494 <entry role=
"catalog_table_entry"><para role=
"column_definition">
8495 <structfield>view_catalog
</structfield> <type>sql_identifier
</type>
8498 Name of the database that contains the view (always the current database)
8503 <entry role=
"catalog_table_entry"><para role=
"column_definition">
8504 <structfield>view_schema
</structfield> <type>sql_identifier
</type>
8507 Name of the schema that contains the view
8512 <entry role=
"catalog_table_entry"><para role=
"column_definition">
8513 <structfield>view_name
</structfield> <type>sql_identifier
</type>
8521 <entry role=
"catalog_table_entry"><para role=
"column_definition">
8522 <structfield>table_catalog
</structfield> <type>sql_identifier
</type>
8525 Name of the database that contains the table that is
8526 used by the view (always the current database)
8531 <entry role=
"catalog_table_entry"><para role=
"column_definition">
8532 <structfield>table_schema
</structfield> <type>sql_identifier
</type>
8535 Name of the schema that contains the table that is used by the
8541 <entry role=
"catalog_table_entry"><para role=
"column_definition">
8542 <structfield>table_name
</structfield> <type>sql_identifier
</type>
8545 Name of the table that is used by the view
8553 <sect1 id=
"infoschema-views">
8554 <title><literal>views
</literal></title>
8557 The view
<literal>views
</literal> contains all views defined in the
8558 current database. Only those views are shown that the current user
8559 has access to (by way of being the owner or having some privilege).
8563 <title><structname>views
</structname> Columns
</title>
8567 <entry role=
"catalog_table_entry"><para role=
"column_definition">
8578 <entry role=
"catalog_table_entry"><para role=
"column_definition">
8579 <structfield>table_catalog
</structfield> <type>sql_identifier
</type>
8582 Name of the database that contains the view (always the current database)
8587 <entry role=
"catalog_table_entry"><para role=
"column_definition">
8588 <structfield>table_schema
</structfield> <type>sql_identifier
</type>
8591 Name of the schema that contains the view
8596 <entry role=
"catalog_table_entry"><para role=
"column_definition">
8597 <structfield>table_name
</structfield> <type>sql_identifier
</type>
8605 <entry role=
"catalog_table_entry"><para role=
"column_definition">
8606 <structfield>view_definition
</structfield> <type>character_data
</type>
8609 Query expression defining the view (null if the view is not
8610 owned by a currently enabled role)
8615 <entry role=
"catalog_table_entry"><para role=
"column_definition">
8616 <structfield>check_option
</structfield> <type>character_data
</type>
8619 <literal>CASCADED
</literal> or
<literal>LOCAL
</literal> if the view
8620 has a
<literal>CHECK OPTION
</literal> defined on it,
8621 <literal>NONE
</literal> if not
8626 <entry role=
"catalog_table_entry"><para role=
"column_definition">
8627 <structfield>is_updatable
</structfield> <type>yes_or_no
</type>
8630 <literal>YES
</literal> if the view is updatable (allows
8631 <command>UPDATE
</command> and
<command>DELETE
</command>),
8632 <literal>NO
</literal> if not
8637 <entry role=
"catalog_table_entry"><para role=
"column_definition">
8638 <structfield>is_insertable_into
</structfield> <type>yes_or_no
</type>
8641 <literal>YES
</literal> if the view is insertable into (allows
8642 <command>INSERT
</command>),
<literal>NO
</literal> if not
8647 <entry role=
"catalog_table_entry"><para role=
"column_definition">
8648 <structfield>is_trigger_updatable
</structfield> <type>yes_or_no
</type>
8651 <literal>YES
</literal> if the view has an
<literal>INSTEAD OF
</literal>
8652 <command>UPDATE
</command> trigger defined on it,
<literal>NO
</literal> if not
8657 <entry role=
"catalog_table_entry"><para role=
"column_definition">
8658 <structfield>is_trigger_deletable
</structfield> <type>yes_or_no
</type>
8661 <literal>YES
</literal> if the view has an
<literal>INSTEAD OF
</literal>
8662 <command>DELETE
</command> trigger defined on it,
<literal>NO
</literal> if not
8667 <entry role=
"catalog_table_entry"><para role=
"column_definition">
8668 <structfield>is_trigger_insertable_into
</structfield> <type>yes_or_no
</type>
8671 <literal>YES
</literal> if the view has an
<literal>INSTEAD OF
</literal>
8672 <command>INSERT
</command> trigger defined on it,
<literal>NO
</literal> if not