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 modelled after
17 implementation concerns. The information schema views do not,
18 however, contain information about
19 <productname>PostgreSQL</productname>-specific features; to inquire
20 about those you need to query the system catalogs or other
21 <productname>PostgreSQL</productname>-specific views.
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</>,
39 <literal>check_constraints</>, <literal>domain_constraints</>, and
40 <literal>referential_constraints</>. Some other views have similar
41 issues but contain the table name to help distinguish duplicate
42 rows, e.g., <literal>constraint_column_usage</>,
43 <literal>constraint_table_usage</>, <literal>table_constraints</>.
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><literal>information_schema_catalog_name</literal> Columns</title>
160 <entry>Data Type</entry>
161 <entry>Description</entry>
167 <entry><literal>catalog_name</literal></entry>
168 <entry><type>sql_identifier</type></entry>
169 <entry>Name of the database that contains this information schema</entry>
176 <sect1 id="infoschema-administrable-role-authorizations">
177 <title><literal>administrable_role_authorizations</literal></title>
180 The view <literal>administrable_role_authorizations</literal>
181 identifies all roles that the current user has the admin option
186 <title><literal>administrable_role_authorizations</literal> Columns</title>
192 <entry>Data Type</entry>
193 <entry>Description</entry>
199 <entry><literal>grantee</literal></entry>
200 <entry><type>sql_identifier</type></entry>
202 Name of the role to which this role membership was granted (can
203 be the current user, or a different role in case of nested role
209 <entry><literal>role_name</literal></entry>
210 <entry><type>sql_identifier</type></entry>
211 <entry>Name of a role</entry>
215 <entry><literal>is_grantable</literal></entry>
216 <entry><type>yes_or_no</type></entry>
217 <entry>Always <literal>YES</literal></entry>
224 <sect1 id="infoschema-applicable-roles">
225 <title><literal>applicable_roles</literal></title>
228 The view <literal>applicable_roles</literal> identifies all roles
229 whose privileges the current user can use. This means there is
230 some chain of role grants from the current user to the role in
231 question. The current user itself is also an applicable role. The
232 set of applicable roles is generally used for permission checking.
233 <indexterm><primary>applicable role</primary></indexterm>
234 <indexterm><primary>role</primary><secondary>applicable</secondary></indexterm>
238 <title><literal>applicable_roles</literal> Columns</title>
244 <entry>Data Type</entry>
245 <entry>Description</entry>
251 <entry><literal>grantee</literal></entry>
252 <entry><type>sql_identifier</type></entry>
254 Name of the role to which this role membership was granted (can
255 be the current user, or a different role in case of nested role
261 <entry><literal>role_name</literal></entry>
262 <entry><type>sql_identifier</type></entry>
263 <entry>Name of a role</entry>
267 <entry><literal>is_grantable</literal></entry>
268 <entry><type>yes_or_no</type></entry>
270 <literal>YES</literal> if the grantee has the admin option on
271 the role, <literal>NO</literal> if not
279 <sect1 id="infoschema-attributes">
280 <title><literal>attributes</literal></title>
283 The view <literal>attributes</literal> contains information about
284 the attributes of composite data types defined in the database.
285 (Note that the view does not give information about table columns,
286 which are sometimes called attributes in PostgreSQL contexts.)
290 <title><literal>attributes</literal> Columns</title>
296 <entry>Data Type</entry>
297 <entry>Description</entry>
303 <entry><literal>udt_catalog</literal></entry>
304 <entry><type>sql_identifier</type></entry>
305 <entry>Name of the database containing the data type (always the current database)</entry>
309 <entry><literal>udt_schema</literal></entry>
310 <entry><type>sql_identifier</type></entry>
311 <entry>Name of the schema containing the data type</entry>
315 <entry><literal>udt_name</literal></entry>
316 <entry><type>sql_identifier</type></entry>
317 <entry>Name of the data type</entry>
321 <entry><literal>attribute_name</literal></entry>
322 <entry><type>sql_identifier</type></entry>
323 <entry>Name of the attribute</entry>
327 <entry><literal>ordinal_position</literal></entry>
328 <entry><type>cardinal_number</type></entry>
329 <entry>Ordinal position of the attribute within the data type (count starts at 1)</entry>
333 <entry><literal>attribute_default</literal></entry>
334 <entry><type>character_data</type></entry>
335 <entry>Default expression of the attribute</entry>
339 <entry><literal>is_nullable</literal></entry>
340 <entry><type>yes_or_no</type></entry>
342 <literal>YES</literal> if the attribute is possibly nullable,
343 <literal>NO</literal> if it is known not nullable.
348 <entry><literal>data_type</literal></entry>
349 <entry><type>character_data</type></entry>
351 Data type of the attribute, if it is a built-in type, or
352 <literal>ARRAY</literal> if it is some array (in that case, see
353 the view <literal>element_types</literal>), else
354 <literal>USER-DEFINED</literal> (in that case, the type is
355 identified in <literal>attribute_udt_name</literal> and
361 <entry><literal>character_maximum_length</literal></entry>
362 <entry><type>cardinal_number</type></entry>
364 If <literal>data_type</literal> identifies a character or bit
365 string type, the declared maximum length; null for all other
366 data types or if no maximum length was declared.
371 <entry><literal>character_octet_length</literal></entry>
372 <entry><type>cardinal_number</type></entry>
374 If <literal>data_type</literal> identifies a character type,
375 the maximum possible length in octets (bytes) of a datum; null
376 for all other data types. The maximum octet length depends on
377 the declared character maximum length (see above) and the
383 <entry><literal>character_set_catalog</literal></entry>
384 <entry><type>sql_identifier</type></entry>
385 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
389 <entry><literal>character_set_schema</literal></entry>
390 <entry><type>sql_identifier</type></entry>
391 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
395 <entry><literal>character_set_name</literal></entry>
396 <entry><type>sql_identifier</type></entry>
397 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
401 <entry><literal>collation_catalog</literal></entry>
402 <entry><type>sql_identifier</type></entry>
404 Name of the database containing the collation of the attribute
405 (always the current database), null if default or the data type
406 of the attribute is not collatable
411 <entry><literal>collation_schema</literal></entry>
412 <entry><type>sql_identifier</type></entry>
414 Name of the schema containing the collation of the attribute,
415 null if default or the data type of the attribute is not
421 <entry><literal>collation_name</literal></entry>
422 <entry><type>sql_identifier</type></entry>
424 Name of the collation of the attribute, null if default or the
425 data type of the attribute is not collatable
430 <entry><literal>numeric_precision</literal></entry>
431 <entry><type>cardinal_number</type></entry>
433 If <literal>data_type</literal> identifies a numeric type, this
434 column contains the (declared or implicit) precision of the
435 type for this attribute. The precision indicates the number of
436 significant digits. It can be expressed in decimal (base 10)
437 or binary (base 2) terms, as specified in the column
438 <literal>numeric_precision_radix</literal>. For all other data
439 types, this column is null.
444 <entry><literal>numeric_precision_radix</literal></entry>
445 <entry><type>cardinal_number</type></entry>
447 If <literal>data_type</literal> identifies a numeric type, this
448 column indicates in which base the values in the columns
449 <literal>numeric_precision</literal> and
450 <literal>numeric_scale</literal> are expressed. The value is
451 either 2 or 10. For all other data types, this column is null.
456 <entry><literal>numeric_scale</literal></entry>
457 <entry><type>cardinal_number</type></entry>
459 If <literal>data_type</literal> identifies an exact numeric
460 type, this column contains the (declared or implicit) scale of
461 the type for this attribute. The scale indicates the number of
462 significant digits to the right of the decimal point. It can
463 be expressed in decimal (base 10) or binary (base 2) terms, as
464 specified in the column
465 <literal>numeric_precision_radix</literal>. For all other data
466 types, this column is null.
471 <entry><literal>datetime_precision</literal></entry>
472 <entry><type>cardinal_number</type></entry>
474 If <literal>data_type</literal> identifies a date, time,
475 timestamp, or interval type, this column contains the (declared
476 or implicit) fractional seconds precision of the type for this
477 attribute, that is, the number of decimal digits maintained
478 following the decimal point in the seconds value. For all
479 other data types, this column is null.
484 <entry><literal>interval_type</literal></entry>
485 <entry><type>character_data</type></entry>
486 <entry>Not yet implemented</entry>
490 <entry><literal>interval_precision</literal></entry>
491 <entry><type>cardinal_number</type></entry>
493 Applies to a feature not available
494 in <productname>PostgreSQL</productname>
495 (see <literal>datetime_precision</literal> for the fractional
496 seconds precision of interval type attributes)
501 <entry><literal>attribute_udt_catalog</literal></entry>
502 <entry><type>sql_identifier</type></entry>
504 Name of the database that the attribute data type is defined in
505 (always the current database)
510 <entry><literal>attribute_udt_schema</literal></entry>
511 <entry><type>sql_identifier</type></entry>
513 Name of the schema that the attribute data type is defined in
518 <entry><literal>attribute_udt_name</literal></entry>
519 <entry><type>sql_identifier</type></entry>
521 Name of the attribute data type
526 <entry><literal>scope_catalog</literal></entry>
527 <entry><type>sql_identifier</type></entry>
528 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
532 <entry><literal>scope_schema</literal></entry>
533 <entry><type>sql_identifier</type></entry>
534 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
538 <entry><literal>scope_name</literal></entry>
539 <entry><type>sql_identifier</type></entry>
540 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
544 <entry><literal>maximum_cardinality</literal></entry>
545 <entry><type>cardinal_number</type></entry>
546 <entry>Always null, because arrays always have unlimited maximum cardinality in <productname>PostgreSQL</></entry>
550 <entry><literal>dtd_identifier</literal></entry>
551 <entry><type>sql_identifier</type></entry>
553 An identifier of the data type descriptor of the column, unique
554 among the data type descriptors pertaining to the table. This
555 is mainly useful for joining with other instances of such
556 identifiers. (The specific format of the identifier is not
557 defined and not guaranteed to remain the same in future
563 <entry><literal>is_derived_reference_attribute</literal></entry>
564 <entry><type>yes_or_no</type></entry>
565 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
572 See also under <xref linkend="infoschema-columns">, a similarly
573 structured view, for further information on some of the columns.
577 <sect1 id="infoschema-character-sets">
578 <title><literal>character_sets</literal></title>
581 The view <literal>character_sets</literal> identifies the character
582 sets available in the current database. Since PostgreSQL does not
583 support multiple character sets within one database, this view only
584 shows one, which is the database encoding.
588 Take note of how the following terms are used in the SQL standard:
591 <term>character repertoire</term>
594 An abstract collection of characters, for
595 example <literal>UNICODE</literal>, <literal>UCS</literal>, or
596 <literal>LATIN1</literal>. Not exposed as an SQL object, but
597 visible in this view.
603 <term>character encoding form</term>
606 An encoding of some character repertoire. Most older character
607 repertoires only use one encoding form, and so there are no
608 separate names for them (e.g., <literal>LATIN1</literal> is an
609 encoding form applicable to the <literal>LATIN1</literal>
610 repertoire). But for example Unicode has the encoding forms
611 <literal>UTF8</literal>, <literal>UTF16</literal>, etc. (not
612 all supported by PostgreSQL). Encoding forms are not exposed
613 as an SQL object, but are visible in this view.
619 <term>character set</term>
622 A named SQL object that identifies a character repertoire, a
623 character encoding, and a default collation. A predefined
624 character set would typically have the same name as an encoding
625 form, but users could define other names. For example, the
626 character set <literal>UTF8</literal> would typically identify
627 the character repertoire <literal>UCS</literal>, encoding
628 form <literal>UTF8</literal>, and some default collation.
634 You can think of an <quote>encoding</quote> in PostgreSQL either as
635 a character set or a character encoding form. They will have the
636 same name, and there can only be one in one database.
640 <title><literal>character_sets</literal> Columns</title>
646 <entry>Data Type</entry>
647 <entry>Description</entry>
653 <entry><literal>character_set_catalog</literal></entry>
654 <entry><literal>sql_identifier</literal></entry>
655 <entry>Character sets are currently not implemented as schema objects, so this column is null.</entry>
659 <entry><literal>character_set_schema</literal></entry>
660 <entry><literal>sql_identifier</literal></entry>
661 <entry>Character sets are currently not implemented as schema objects, so this column is null.</entry>
665 <entry><literal>character_set_name</literal></entry>
666 <entry><literal>sql_identifier</literal></entry>
667 <entry>Name of the character set, currently implemented as showing the name of the database encoding</entry>
671 <entry><literal>character_repertoire</literal></entry>
672 <entry><literal>sql_identifier</literal></entry>
673 <entry>Character repertoire, showing <literal>UCS</literal> if the encoding is <literal>UTF8</literal>, else just the encoding name</entry>
677 <entry><literal>form_of_use</literal></entry>
678 <entry><literal>sql_identifier</literal></entry>
679 <entry>Character encoding form, same as the database encoding</entry>
683 <entry><literal>default_collate_catalog</literal></entry>
684 <entry><literal>sql_identifier</literal></entry>
685 <entry>Name of the database containing the default collation (always the current database, if any collation is identified)</entry>
689 <entry><literal>default_collate_schema</literal></entry>
690 <entry><literal>sql_identifier</literal></entry>
691 <entry>Name of the schema containing the default collation</entry>
695 <entry><literal>default_collate_name</literal></entry>
696 <entry><literal>sql_identifier</literal></entry>
698 Name of the default collation. The default collation is
699 identified as the collation that matches
700 the <literal>COLLATE</literal> and <literal>CTYPE</literal>
701 settings of the current database. If there is no such
702 collation, then this column and the associated schema and
703 catalog columns are null.
711 <sect1 id="infoschema-check-constraint-routine-usage">
712 <title><literal>check_constraint_routine_usage</literal></title>
715 The view <literal>check_constraint_routine_usage</literal>
716 identifies routines (functions and procedures) that are used by a
717 check constraint. Only those routines are shown that are owned by
718 a currently enabled role.
722 <title><literal>check_constraint_routine_usage</literal> Columns</title>
728 <entry>Data Type</entry>
729 <entry>Description</entry>
735 <entry><literal>constraint_catalog</literal></entry>
736 <entry><literal>sql_identifier</literal></entry>
737 <entry>Name of the database containing the constraint (always the current database)</entry>
741 <entry><literal>constraint_schema</literal></entry>
742 <entry><literal>sql_identifier</literal></entry>
743 <entry>Name of the schema containing the constraint</entry>
747 <entry><literal>constraint_name</literal></entry>
748 <entry><literal>sql_identifier</literal></entry>
749 <entry>Name of the constraint</entry>
753 <entry><literal>specific_catalog</literal></entry>
754 <entry><literal>sql_identifier</literal></entry>
755 <entry>Name of the database containing the function (always the current database)</entry>
759 <entry><literal>specific_schema</literal></entry>
760 <entry><literal>sql_identifier</literal></entry>
761 <entry>Name of the schema containing the function</entry>
765 <entry><literal>specific_name</literal></entry>
766 <entry><literal>sql_identifier</literal></entry>
768 The <quote>specific name</quote> of the function. See <xref
769 linkend="infoschema-routines"> for more information.
777 <sect1 id="infoschema-check-constraints">
778 <title><literal>check_constraints</literal></title>
781 The view <literal>check_constraints</literal> contains all check
782 constraints, either defined on a table or on a domain, that are
783 owned by a currently enabled role. (The owner of the table or
784 domain is the owner of the constraint.)
788 <title><literal>check_constraints</literal> Columns</title>
794 <entry>Data Type</entry>
795 <entry>Description</entry>
801 <entry><literal>constraint_catalog</literal></entry>
802 <entry><literal>sql_identifier</literal></entry>
803 <entry>Name of the database containing the constraint (always the current database)</entry>
807 <entry><literal>constraint_schema</literal></entry>
808 <entry><literal>sql_identifier</literal></entry>
809 <entry>Name of the schema containing the constraint</entry>
813 <entry><literal>constraint_name</literal></entry>
814 <entry><literal>sql_identifier</literal></entry>
815 <entry>Name of the constraint</entry>
819 <entry><literal>check_clause</literal></entry>
820 <entry><literal>character_data</literal></entry>
821 <entry>The check expression of the check constraint</entry>
828 <sect1 id="infoschema-collations">
829 <title><literal>collations</literal></title>
832 The view <literal>collations</literal> contains the collations
833 available in the current database.
837 <title><literal>collations</literal> Columns</title>
843 <entry>Data Type</entry>
844 <entry>Description</entry>
850 <entry><literal>collation_catalog</literal></entry>
851 <entry><literal>sql_identifier</literal></entry>
852 <entry>Name of the database containing the collation (always the current database)</entry>
856 <entry><literal>collation_schema</literal></entry>
857 <entry><literal>sql_identifier</literal></entry>
858 <entry>Name of the schema containing the collation</entry>
862 <entry><literal>collation_name</literal></entry>
863 <entry><literal>sql_identifier</literal></entry>
864 <entry>Name of the default collation</entry>
868 <entry><literal>pad_attribute</literal></entry>
869 <entry><literal>character_data</literal></entry>
871 Always <literal>NO PAD</literal> (The alternative <literal>PAD
872 SPACE</literal> is not supported by PostgreSQL.)
880 <sect1 id="infoschema-collation-character-set-applicab"> <!-- max 44 characters -->
881 <title><literal>collation_character_set_applicability</literal></title>
884 The view <literal>collation_character_set_applicability</literal>
885 identifies which character set the available collations are
886 applicable to. In PostgreSQL, there is only one character set per
887 database (see explanation
888 in <xref linkend="infoschema-character-sets">), so this view does
889 not provide much useful information.
893 <title><literal>collation_character_set_applicability</literal> Columns</title>
899 <entry>Data Type</entry>
900 <entry>Description</entry>
906 <entry><literal>collation_catalog</literal></entry>
907 <entry><literal>sql_identifier</literal></entry>
908 <entry>Name of the database containing the collation (always the current database)</entry>
912 <entry><literal>collation_schema</literal></entry>
913 <entry><literal>sql_identifier</literal></entry>
914 <entry>Name of the schema containing the collation</entry>
918 <entry><literal>collation_name</literal></entry>
919 <entry><literal>sql_identifier</literal></entry>
920 <entry>Name of the default collation</entry>
924 <entry><literal>character_set_catalog</literal></entry>
925 <entry><literal>sql_identifier</literal></entry>
926 <entry>Character sets are currently not implemented as schema objects, so this column is null</entry>
930 <entry><literal>character_set_schema</literal></entry>
931 <entry><literal>sql_identifier</literal></entry>
932 <entry>Character sets are currently not implemented as schema objects, so this column is null</entry>
936 <entry><literal>character_set_name</literal></entry>
937 <entry><literal>sql_identifier</literal></entry>
938 <entry>Name of the character set</entry>
945 <sect1 id="infoschema-column-domain-usage">
946 <title><literal>column_domain_usage</literal></title>
949 The view <literal>column_domain_usage</literal> identifies all
950 columns (of a table or a view) that make use of some domain defined
951 in the current database and owned by a currently enabled role.
955 <title><literal>column_domain_usage</literal> Columns</title>
961 <entry>Data Type</entry>
962 <entry>Description</entry>
968 <entry><literal>domain_catalog</literal></entry>
969 <entry><type>sql_identifier</type></entry>
970 <entry>Name of the database containing the domain (always the current database)</entry>
974 <entry><literal>domain_schema</literal></entry>
975 <entry><type>sql_identifier</type></entry>
976 <entry>Name of the schema containing the domain</entry>
980 <entry><literal>domain_name</literal></entry>
981 <entry><type>sql_identifier</type></entry>
982 <entry>Name of the domain</entry>
986 <entry><literal>table_catalog</literal></entry>
987 <entry><type>sql_identifier</type></entry>
988 <entry>Name of the database containing the table (always the current database)</entry>
992 <entry><literal>table_schema</literal></entry>
993 <entry><type>sql_identifier</type></entry>
994 <entry>Name of the schema containing the table</entry>
998 <entry><literal>table_name</literal></entry>
999 <entry><type>sql_identifier</type></entry>
1000 <entry>Name of the table</entry>
1004 <entry><literal>column_name</literal></entry>
1005 <entry><type>sql_identifier</type></entry>
1006 <entry>Name of the column</entry>
1013 <sect1 id="infoschema-column-privileges">
1014 <title><literal>column_privileges</literal></title>
1017 The view <literal>column_privileges</literal> identifies all
1018 privileges granted on columns to a currently enabled role or by a
1019 currently enabled role. There is one row for each combination of
1020 column, grantor, and grantee.
1024 If a privilege has been granted on an entire table, it will show up in
1025 this view as a grant for each column, but only for the
1026 privilege types where column granularity is possible:
1027 <literal>SELECT</literal>, <literal>INSERT</literal>,
1028 <literal>UPDATE</literal>, <literal>REFERENCES</literal>.
1032 <title><literal>column_privileges</literal> Columns</title>
1038 <entry>Data Type</entry>
1039 <entry>Description</entry>
1045 <entry><literal>grantor</literal></entry>
1046 <entry><type>sql_identifier</type></entry>
1047 <entry>Name of the role that granted the privilege</entry>
1051 <entry><literal>grantee</literal></entry>
1052 <entry><type>sql_identifier</type></entry>
1053 <entry>Name of the role that the privilege was granted to</entry>
1057 <entry><literal>table_catalog</literal></entry>
1058 <entry><type>sql_identifier</type></entry>
1059 <entry>Name of the database that contains the table that contains the column (always the current database)</entry>
1063 <entry><literal>table_schema</literal></entry>
1064 <entry><type>sql_identifier</type></entry>
1065 <entry>Name of the schema that contains the table that contains the column</entry>
1069 <entry><literal>table_name</literal></entry>
1070 <entry><type>sql_identifier</type></entry>
1071 <entry>Name of the table that contains the column</entry>
1075 <entry><literal>column_name</literal></entry>
1076 <entry><type>sql_identifier</type></entry>
1077 <entry>Name of the column</entry>
1081 <entry><literal>privilege_type</literal></entry>
1082 <entry><type>character_data</type></entry>
1084 Type of the privilege: <literal>SELECT</literal>,
1085 <literal>INSERT</literal>, <literal>UPDATE</literal>, or
1086 <literal>REFERENCES</literal>
1091 <entry><literal>is_grantable</literal></entry>
1092 <entry><type>yes_or_no</type></entry>
1093 <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
1100 <sect1 id="infoschema-column-udt-usage">
1101 <title><literal>column_udt_usage</literal></title>
1104 The view <literal>column_udt_usage</literal> identifies all columns
1105 that use data types owned by a currently enabled role. Note that in
1106 <productname>PostgreSQL</productname>, built-in data types behave
1107 like user-defined types, so they are included here as well. See
1108 also <xref linkend="infoschema-columns"> for details.
1112 <title><literal>column_udt_usage</literal> Columns</title>
1118 <entry>Data Type</entry>
1119 <entry>Description</entry>
1125 <entry><literal>udt_catalog</literal></entry>
1126 <entry><type>sql_identifier</type></entry>
1128 Name of the database that the column data type (the underlying
1129 type of the domain, if applicable) is defined in (always the
1135 <entry><literal>udt_schema</literal></entry>
1136 <entry><type>sql_identifier</type></entry>
1138 Name of the schema that the column data type (the underlying
1139 type of the domain, if applicable) is defined in
1144 <entry><literal>udt_name</literal></entry>
1145 <entry><type>sql_identifier</type></entry>
1147 Name of the column data type (the underlying type of the
1148 domain, if applicable)
1153 <entry><literal>table_catalog</literal></entry>
1154 <entry><type>sql_identifier</type></entry>
1155 <entry>Name of the database containing the table (always the current database)</entry>
1159 <entry><literal>table_schema</literal></entry>
1160 <entry><type>sql_identifier</type></entry>
1161 <entry>Name of the schema containing the table</entry>
1165 <entry><literal>table_name</literal></entry>
1166 <entry><type>sql_identifier</type></entry>
1167 <entry>Name of the table</entry>
1171 <entry><literal>column_name</literal></entry>
1172 <entry><type>sql_identifier</type></entry>
1173 <entry>Name of the column</entry>
1180 <sect1 id="infoschema-columns">
1181 <title><literal>columns</literal></title>
1184 The view <literal>columns</literal> contains information about all
1185 table columns (or view columns) in the database. System columns
1186 (<literal>oid</>, etc.) are not included. Only those columns are
1187 shown that the current user has access to (by way of being the
1188 owner or having some privilege).
1192 <title><literal>columns</literal> Columns</title>
1198 <entry>Data Type</entry>
1199 <entry>Description</entry>
1205 <entry><literal>table_catalog</literal></entry>
1206 <entry><type>sql_identifier</type></entry>
1207 <entry>Name of the database containing the table (always the current database)</entry>
1211 <entry><literal>table_schema</literal></entry>
1212 <entry><type>sql_identifier</type></entry>
1213 <entry>Name of the schema containing the table</entry>
1217 <entry><literal>table_name</literal></entry>
1218 <entry><type>sql_identifier</type></entry>
1219 <entry>Name of the table</entry>
1223 <entry><literal>column_name</literal></entry>
1224 <entry><type>sql_identifier</type></entry>
1225 <entry>Name of the column</entry>
1229 <entry><literal>ordinal_position</literal></entry>
1230 <entry><type>cardinal_number</type></entry>
1231 <entry>Ordinal position of the column within the table (count starts at 1)</entry>
1235 <entry><literal>column_default</literal></entry>
1236 <entry><type>character_data</type></entry>
1237 <entry>Default expression of the column</entry>
1241 <entry><literal>is_nullable</literal></entry>
1242 <entry><type>yes_or_no</type></entry>
1244 <literal>YES</literal> if the column is possibly nullable,
1245 <literal>NO</literal> if it is known not nullable. A not-null
1246 constraint is one way a column can be known not nullable, but
1247 there can be others.
1252 <entry><literal>data_type</literal></entry>
1253 <entry><type>character_data</type></entry>
1255 Data type of the column, if it is a built-in type, or
1256 <literal>ARRAY</literal> if it is some array (in that case, see
1257 the view <literal>element_types</literal>), else
1258 <literal>USER-DEFINED</literal> (in that case, the type is
1259 identified in <literal>udt_name</literal> and associated
1260 columns). If the column is based on a domain, this column
1261 refers to the type underlying the domain (and the domain is
1262 identified in <literal>domain_name</literal> and associated
1268 <entry><literal>character_maximum_length</literal></entry>
1269 <entry><type>cardinal_number</type></entry>
1271 If <literal>data_type</literal> identifies a character or bit
1272 string type, the declared maximum length; null for all other
1273 data types or if no maximum length was declared.
1278 <entry><literal>character_octet_length</literal></entry>
1279 <entry><type>cardinal_number</type></entry>
1281 If <literal>data_type</literal> identifies a character type,
1282 the maximum possible length in octets (bytes) of a datum; null
1283 for all other data types. The maximum octet length depends on
1284 the declared character maximum length (see above) and the
1290 <entry><literal>numeric_precision</literal></entry>
1291 <entry><type>cardinal_number</type></entry>
1293 If <literal>data_type</literal> identifies a numeric type, this
1294 column contains the (declared or implicit) precision of the
1295 type for this column. The precision indicates the number of
1296 significant digits. It can be expressed in decimal (base 10)
1297 or binary (base 2) terms, as specified in the column
1298 <literal>numeric_precision_radix</literal>. For all other data
1299 types, this column is null.
1304 <entry><literal>numeric_precision_radix</literal></entry>
1305 <entry><type>cardinal_number</type></entry>
1307 If <literal>data_type</literal> identifies a numeric type, this
1308 column indicates in which base the values in the columns
1309 <literal>numeric_precision</literal> and
1310 <literal>numeric_scale</literal> are expressed. The value is
1311 either 2 or 10. For all other data types, this column is null.
1316 <entry><literal>numeric_scale</literal></entry>
1317 <entry><type>cardinal_number</type></entry>
1319 If <literal>data_type</literal> identifies an exact numeric
1320 type, this column contains the (declared or implicit) scale of
1321 the type for this column. The scale indicates the number of
1322 significant digits to the right of the decimal point. It can
1323 be expressed in decimal (base 10) or binary (base 2) terms, as
1324 specified in the column
1325 <literal>numeric_precision_radix</literal>. For all other data
1326 types, this column is null.
1331 <entry><literal>datetime_precision</literal></entry>
1332 <entry><type>cardinal_number</type></entry>
1334 If <literal>data_type</literal> identifies a date, time,
1335 timestamp, or interval type, this column contains the (declared
1336 or implicit) fractional seconds precision of the type for this
1337 column, that is, the number of decimal digits maintained
1338 following the decimal point in the seconds value. For all
1339 other data types, this column is null.
1344 <entry><literal>interval_type</literal></entry>
1345 <entry><type>character_data</type></entry>
1346 <entry>Not yet implemented</entry>
1350 <entry><literal>interval_precision</literal></entry>
1351 <entry><type>cardinal_number</type></entry>
1353 Applies to a feature not available
1354 in <productname>PostgreSQL</productname>
1355 (see <literal>datetime_precision</literal> for the fractional
1356 seconds precision of interval type columns)
1361 <entry><literal>character_set_catalog</literal></entry>
1362 <entry><type>sql_identifier</type></entry>
1363 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1367 <entry><literal>character_set_schema</literal></entry>
1368 <entry><type>sql_identifier</type></entry>
1369 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1373 <entry><literal>character_set_name</literal></entry>
1374 <entry><type>sql_identifier</type></entry>
1375 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1379 <entry><literal>collation_catalog</literal></entry>
1380 <entry><type>sql_identifier</type></entry>
1382 Name of the database containing the collation of the column
1383 (always the current database), null if default or the data type
1384 of the column is not collatable
1389 <entry><literal>collation_schema</literal></entry>
1390 <entry><type>sql_identifier</type></entry>
1392 Name of the schema containing the collation of the column, null
1393 if default or the data type of the column is not collatable
1398 <entry><literal>collation_name</literal></entry>
1399 <entry><type>sql_identifier</type></entry>
1401 Name of the collation of the column, null if default or the
1402 data type of the column is not collatable
1407 <entry><literal>domain_catalog</literal></entry>
1408 <entry><type>sql_identifier</type></entry>
1410 If the column has a domain type, the name of the database that
1411 the domain is defined in (always the current database), else
1417 <entry><literal>domain_schema</literal></entry>
1418 <entry><type>sql_identifier</type></entry>
1420 If the column has a domain type, the name of the schema that
1421 the domain is defined in, else null.
1426 <entry><literal>domain_name</literal></entry>
1427 <entry><type>sql_identifier</type></entry>
1428 <entry>If the column has a domain type, the name of the domain, else null.</entry>
1432 <entry><literal>udt_catalog</literal></entry>
1433 <entry><type>sql_identifier</type></entry>
1435 Name of the database that the column data type (the underlying
1436 type of the domain, if applicable) is defined in (always the
1442 <entry><literal>udt_schema</literal></entry>
1443 <entry><type>sql_identifier</type></entry>
1445 Name of the schema that the column data type (the underlying
1446 type of the domain, if applicable) is defined in
1451 <entry><literal>udt_name</literal></entry>
1452 <entry><type>sql_identifier</type></entry>
1454 Name of the column data type (the underlying type of the
1455 domain, if applicable)
1460 <entry><literal>scope_catalog</literal></entry>
1461 <entry><type>sql_identifier</type></entry>
1462 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1466 <entry><literal>scope_schema</literal></entry>
1467 <entry><type>sql_identifier</type></entry>
1468 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1472 <entry><literal>scope_name</literal></entry>
1473 <entry><type>sql_identifier</type></entry>
1474 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1478 <entry><literal>maximum_cardinality</literal></entry>
1479 <entry><type>cardinal_number</type></entry>
1480 <entry>Always null, because arrays always have unlimited maximum cardinality in <productname>PostgreSQL</></entry>
1484 <entry><literal>dtd_identifier</literal></entry>
1485 <entry><type>sql_identifier</type></entry>
1487 An identifier of the data type descriptor of the column, unique
1488 among the data type descriptors pertaining to the table. This
1489 is mainly useful for joining with other instances of such
1490 identifiers. (The specific format of the identifier is not
1491 defined and not guaranteed to remain the same in future
1497 <entry><literal>is_self_referencing</literal></entry>
1498 <entry><type>yes_or_no</type></entry>
1499 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1503 <entry><literal>is_identity</literal></entry>
1504 <entry><type>yes_or_no</type></entry>
1505 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1509 <entry><literal>identity_generation</literal></entry>
1510 <entry><type>character_data</type></entry>
1511 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1515 <entry><literal>identity_start</literal></entry>
1516 <entry><type>character_data</type></entry>
1517 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1521 <entry><literal>identity_increment</literal></entry>
1522 <entry><type>character_data</type></entry>
1523 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1527 <entry><literal>identity_maximum</literal></entry>
1528 <entry><type>character_data</type></entry>
1529 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1533 <entry><literal>identity_minimum</literal></entry>
1534 <entry><type>character_data</type></entry>
1535 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1539 <entry><literal>identity_cycle</literal></entry>
1540 <entry><type>yes_or_no</type></entry>
1541 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1545 <entry><literal>is_generated</literal></entry>
1546 <entry><type>character_data</type></entry>
1547 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1551 <entry><literal>generation_expression</literal></entry>
1552 <entry><type>character_data</type></entry>
1553 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1557 <entry><literal>is_updatable</literal></entry>
1558 <entry><type>yes_or_no</type></entry>
1560 <literal>YES</literal> if the column is updatable,
1561 <literal>NO</literal> if not (Columns in base tables are always
1562 updatable, columns in views not necessarily)
1570 Since data types can be defined in a variety of ways in SQL, and
1571 <productname>PostgreSQL</productname> contains additional ways to
1572 define data types, their representation in the information schema
1573 can be somewhat difficult. The column <literal>data_type</literal>
1574 is supposed to identify the underlying built-in type of the column.
1575 In <productname>PostgreSQL</productname>, this means that the type
1576 is defined in the system catalog schema
1577 <literal>pg_catalog</literal>. This column might be useful if the
1578 application can handle the well-known built-in types specially (for
1579 example, format the numeric types differently or use the data in
1580 the precision columns). The columns <literal>udt_name</literal>,
1581 <literal>udt_schema</literal>, and <literal>udt_catalog</literal>
1582 always identify the underlying data type of the column, even if the
1583 column is based on a domain. (Since
1584 <productname>PostgreSQL</productname> treats built-in types like
1585 user-defined types, built-in types appear here as well. This is an
1586 extension of the SQL standard.) These columns should be used if an
1587 application wants to process data differently according to the
1588 type, because in that case it wouldn't matter if the column is
1589 really based on a domain. If the column is based on a domain, the
1590 identity of the domain is stored in the columns
1591 <literal>domain_name</literal>, <literal>domain_schema</literal>,
1592 and <literal>domain_catalog</literal>. If you want to pair up
1593 columns with their associated data types and treat domains as
1594 separate types, you could write <literal>coalesce(domain_name,
1595 udt_name)</literal>, etc.
1599 <sect1 id="infoschema-constraint-column-usage">
1600 <title><literal>constraint_column_usage</literal></title>
1603 The view <literal>constraint_column_usage</literal> identifies all
1604 columns in the current database that are used by some constraint.
1605 Only those columns are shown that are contained in a table owned by
1606 a currently enabled role. For a check constraint, this view
1607 identifies the columns that are used in the check expression. For
1608 a foreign key constraint, this view identifies the columns that the
1609 foreign key references. For a unique or primary key constraint,
1610 this view identifies the constrained columns.
1614 <title><literal>constraint_column_usage</literal> Columns</title>
1620 <entry>Data Type</entry>
1621 <entry>Description</entry>
1627 <entry><literal>table_catalog</literal></entry>
1628 <entry><type>sql_identifier</type></entry>
1630 Name of the database that contains the table that contains the
1631 column that is used by some constraint (always the current
1637 <entry><literal>table_schema</literal></entry>
1638 <entry><type>sql_identifier</type></entry>
1640 Name of the schema that contains the table that contains the
1641 column that is used by some constraint
1646 <entry><literal>table_name</literal></entry>
1647 <entry><type>sql_identifier</type></entry>
1649 Name of the table that contains the column that is used by some
1655 <entry><literal>column_name</literal></entry>
1656 <entry><type>sql_identifier</type></entry>
1658 Name of the column that is used by some constraint
1663 <entry><literal>constraint_catalog</literal></entry>
1664 <entry><type>sql_identifier</type></entry>
1665 <entry>Name of the database that contains the constraint (always the current database)</entry>
1669 <entry><literal>constraint_schema</literal></entry>
1670 <entry><type>sql_identifier</type></entry>
1671 <entry>Name of the schema that contains the constraint</entry>
1675 <entry><literal>constraint_name</literal></entry>
1676 <entry><type>sql_identifier</type></entry>
1677 <entry>Name of the constraint</entry>
1684 <sect1 id="infoschema-constraint-table-usage">
1685 <title><literal>constraint_table_usage</literal></title>
1688 The view <literal>constraint_table_usage</literal> identifies all
1689 tables in the current database that are used by some constraint and
1690 are owned by a currently enabled role. (This is different from the
1691 view <literal>table_constraints</literal>, which identifies all
1692 table constraints along with the table they are defined on.) For a
1693 foreign key constraint, this view identifies the table that the
1694 foreign key references. For a unique or primary key constraint,
1695 this view simply identifies the table the constraint belongs to.
1696 Check constraints and not-null constraints are not included in this
1701 <title><literal>constraint_table_usage</literal> Columns</title>
1707 <entry>Data Type</entry>
1708 <entry>Description</entry>
1714 <entry><literal>table_catalog</literal></entry>
1715 <entry><type>sql_identifier</type></entry>
1717 Name of the database that contains the table that is used by
1718 some constraint (always the current database)
1723 <entry><literal>table_schema</literal></entry>
1724 <entry><type>sql_identifier</type></entry>
1726 Name of the schema that contains the table that is used by some
1732 <entry><literal>table_name</literal></entry>
1733 <entry><type>sql_identifier</type></entry>
1734 <entry>Name of the table that is used by some constraint</entry>
1738 <entry><literal>constraint_catalog</literal></entry>
1739 <entry><type>sql_identifier</type></entry>
1740 <entry>Name of the database that contains the constraint (always the current database)</entry>
1744 <entry><literal>constraint_schema</literal></entry>
1745 <entry><type>sql_identifier</type></entry>
1746 <entry>Name of the schema that contains the constraint</entry>
1750 <entry><literal>constraint_name</literal></entry>
1751 <entry><type>sql_identifier</type></entry>
1752 <entry>Name of the constraint</entry>
1759 <sect1 id="infoschema-data-type-privileges">
1760 <title><literal>data_type_privileges</literal></title>
1763 The view <literal>data_type_privileges</literal> identifies all
1764 data type descriptors that the current user has access to, by way
1765 of being the owner of the described object or having some privilege
1766 for it. A data type descriptor is generated whenever a data type
1767 is used in the definition of a table column, a domain, or a
1768 function (as parameter or return type) and stores some information
1769 about how the data type is used in that instance (for example, the
1770 declared maximum length, if applicable). Each data type
1771 descriptor is assigned an arbitrary identifier that is unique
1772 among the data type descriptor identifiers assigned for one object
1773 (table, domain, function). This view is probably not useful for
1774 applications, but it is used to define some other views in the
1779 <title><literal>data_type_privileges</literal> Columns</title>
1785 <entry>Data Type</entry>
1786 <entry>Description</entry>
1792 <entry><literal>object_catalog</literal></entry>
1793 <entry><type>sql_identifier</type></entry>
1794 <entry>Name of the database that contains the described object (always the current database)</entry>
1798 <entry><literal>object_schema</literal></entry>
1799 <entry><type>sql_identifier</type></entry>
1800 <entry>Name of the schema that contains the described object</entry>
1804 <entry><literal>object_name</literal></entry>
1805 <entry><type>sql_identifier</type></entry>
1806 <entry>Name of the described object</entry>
1810 <entry><literal>object_type</literal></entry>
1811 <entry><type>character_data</type></entry>
1813 The type of the described object: one of
1814 <literal>TABLE</literal> (the data type descriptor pertains to
1815 a column of that table), <literal>DOMAIN</literal> (the data
1816 type descriptors pertains to that domain),
1817 <literal>ROUTINE</literal> (the data type descriptor pertains
1818 to a parameter or the return data type of that function).
1823 <entry><literal>dtd_identifier</literal></entry>
1824 <entry><type>sql_identifier</type></entry>
1826 The identifier of the data type descriptor, which is unique
1827 among the data type descriptors for that same object.
1835 <sect1 id="infoschema-domain-constraints">
1836 <title><literal>domain_constraints</literal></title>
1839 The view <literal>domain_constraints</literal> contains all
1840 constraints belonging to domains defined in the current database.
1844 <title><literal>domain_constraints</literal> Columns</title>
1850 <entry>Data Type</entry>
1851 <entry>Description</entry>
1857 <entry><literal>constraint_catalog</literal></entry>
1858 <entry><type>sql_identifier</type></entry>
1859 <entry>Name of the database that contains the constraint (always the current database)</entry>
1863 <entry><literal>constraint_schema</literal></entry>
1864 <entry><type>sql_identifier</type></entry>
1865 <entry>Name of the schema that contains the constraint</entry>
1869 <entry><literal>constraint_name</literal></entry>
1870 <entry><type>sql_identifier</type></entry>
1871 <entry>Name of the constraint</entry>
1875 <entry><literal>domain_catalog</literal></entry>
1876 <entry><type>sql_identifier</type></entry>
1877 <entry>Name of the database that contains the domain (always the current database)</entry>
1881 <entry><literal>domain_schema</literal></entry>
1882 <entry><type>sql_identifier</type></entry>
1883 <entry>Name of the schema that contains the domain</entry>
1887 <entry><literal>domain_name</literal></entry>
1888 <entry><type>sql_identifier</type></entry>
1889 <entry>Name of the domain</entry>
1893 <entry><literal>is_deferrable</literal></entry>
1894 <entry><type>yes_or_no</type></entry>
1895 <entry><literal>YES</literal> if the constraint is deferrable, <literal>NO</literal> if not</entry>
1899 <entry><literal>initially_deferred</literal></entry>
1900 <entry><type>yes_or_no</type></entry>
1901 <entry><literal>YES</literal> if the constraint is deferrable and initially deferred, <literal>NO</literal> if not</entry>
1908 <sect1 id="infoschema-domain-udt-usage">
1909 <title><literal>domain_udt_usage</literal></title>
1912 The view <literal>domain_udt_usage</literal> identifies all domains
1913 that are based on data types owned by a currently enabled role.
1914 Note that in <productname>PostgreSQL</productname>, built-in data
1915 types behave like user-defined types, so they are included here as
1920 <title><literal>domain_udt_usage</literal> Columns</title>
1926 <entry>Data Type</entry>
1927 <entry>Description</entry>
1933 <entry><literal>udt_catalog</literal></entry>
1934 <entry><type>sql_identifier</type></entry>
1935 <entry>Name of the database that the domain data type is defined in (always the current database)</entry>
1939 <entry><literal>udt_schema</literal></entry>
1940 <entry><type>sql_identifier</type></entry>
1941 <entry>Name of the schema that the domain data type is defined in</entry>
1945 <entry><literal>udt_name</literal></entry>
1946 <entry><type>sql_identifier</type></entry>
1947 <entry>Name of the domain data type</entry>
1951 <entry><literal>domain_catalog</literal></entry>
1952 <entry><type>sql_identifier</type></entry>
1953 <entry>Name of the database that contains the domain (always the current database)</entry>
1957 <entry><literal>domain_schema</literal></entry>
1958 <entry><type>sql_identifier</type></entry>
1959 <entry>Name of the schema that contains the domain</entry>
1963 <entry><literal>domain_name</literal></entry>
1964 <entry><type>sql_identifier</type></entry>
1965 <entry>Name of the domain</entry>
1972 <sect1 id="infoschema-domains">
1973 <title><literal>domains</literal></title>
1976 The view <literal>domains</literal> contains all domains defined in
1977 the current database.
1981 <title><literal>domains</literal> Columns</title>
1987 <entry>Data Type</entry>
1988 <entry>Description</entry>
1994 <entry><literal>domain_catalog</literal></entry>
1995 <entry><type>sql_identifier</type></entry>
1996 <entry>Name of the database that contains the domain (always the current database)</entry>
2000 <entry><literal>domain_schema</literal></entry>
2001 <entry><type>sql_identifier</type></entry>
2002 <entry>Name of the schema that contains the domain</entry>
2006 <entry><literal>domain_name</literal></entry>
2007 <entry><type>sql_identifier</type></entry>
2008 <entry>Name of the domain</entry>
2012 <entry><literal>data_type</literal></entry>
2013 <entry><type>character_data</type></entry>
2015 Data type of the domain, if it is a built-in type, or
2016 <literal>ARRAY</literal> if it is some array (in that case, see
2017 the view <literal>element_types</literal>), else
2018 <literal>USER-DEFINED</literal> (in that case, the type is
2019 identified in <literal>udt_name</literal> and associated
2025 <entry><literal>character_maximum_length</literal></entry>
2026 <entry><type>cardinal_number</type></entry>
2028 If the domain has a character or bit string type, the declared
2029 maximum length; null for all other data types or if no maximum
2030 length was declared.
2035 <entry><literal>character_octet_length</literal></entry>
2036 <entry><type>cardinal_number</type></entry>
2038 If the domain has a character type, the maximum possible length
2039 in octets (bytes) of a datum; null for all other data types.
2040 The maximum octet length depends on the declared character
2041 maximum length (see above) and the server encoding.
2046 <entry><literal>character_set_catalog</literal></entry>
2047 <entry><type>sql_identifier</type></entry>
2048 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2052 <entry><literal>character_set_schema</literal></entry>
2053 <entry><type>sql_identifier</type></entry>
2054 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2058 <entry><literal>character_set_name</literal></entry>
2059 <entry><type>sql_identifier</type></entry>
2060 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2064 <entry><literal>collation_catalog</literal></entry>
2065 <entry><type>sql_identifier</type></entry>
2067 Name of the database containing the collation of the domain
2068 (always the current database), null if default or the data type
2069 of the domain is not collatable
2074 <entry><literal>collation_schema</literal></entry>
2075 <entry><type>sql_identifier</type></entry>
2077 Name of the schema containing the collation of the domain, null
2078 if default or the data type of the domain is not collatable
2083 <entry><literal>collation_name</literal></entry>
2084 <entry><type>sql_identifier</type></entry>
2086 Name of the collation of the column, null if default or the
2087 data type of the domain is not collatable
2092 <entry><literal>numeric_precision</literal></entry>
2093 <entry><type>cardinal_number</type></entry>
2095 If the domain has a numeric type, this column contains the
2096 (declared or implicit) precision of the type for this domain.
2097 The precision indicates the number of significant digits. It
2098 can be expressed in decimal (base 10) or binary (base 2) terms,
2099 as specified in the column
2100 <literal>numeric_precision_radix</literal>. For all other data
2101 types, this column is null.
2106 <entry><literal>numeric_precision_radix</literal></entry>
2107 <entry><type>cardinal_number</type></entry>
2109 If the domain has a numeric type, this column indicates in
2110 which base the values in the columns
2111 <literal>numeric_precision</literal> and
2112 <literal>numeric_scale</literal> are expressed. The value is
2113 either 2 or 10. For all other data types, this column is null.
2118 <entry><literal>numeric_scale</literal></entry>
2119 <entry><type>cardinal_number</type></entry>
2121 If the domain has an exact numeric type, this column contains
2122 the (declared or implicit) scale of the type for this domain.
2123 The scale indicates the number of significant digits to the
2124 right of the decimal point. It can be expressed in decimal
2125 (base 10) or binary (base 2) terms, as specified in the column
2126 <literal>numeric_precision_radix</literal>. For all other data
2127 types, this column is null.
2132 <entry><literal>datetime_precision</literal></entry>
2133 <entry><type>cardinal_number</type></entry>
2135 If <literal>data_type</literal> identifies a date, time,
2136 timestamp, or interval type, this column contains the (declared
2137 or implicit) fractional seconds precision of the type for this
2138 domain, that is, the number of decimal digits maintained
2139 following the decimal point in the seconds value. For all
2140 other data types, this column is null.
2145 <entry><literal>interval_type</literal></entry>
2146 <entry><type>character_data</type></entry>
2147 <entry>Not yet implemented</entry>
2151 <entry><literal>interval_precision</literal></entry>
2152 <entry><type>cardinal_number</type></entry>
2154 Applies to a feature not available
2155 in <productname>PostgreSQL</productname>
2156 (see <literal>datetime_precision</literal> for the fractional
2157 seconds precision of interval type domains)
2162 <entry><literal>domain_default</literal></entry>
2163 <entry><type>character_data</type></entry>
2164 <entry>Default expression of the domain</entry>
2168 <entry><literal>udt_catalog</literal></entry>
2169 <entry><type>sql_identifier</type></entry>
2170 <entry>Name of the database that the domain data type is defined in (always the current database)</entry>
2174 <entry><literal>udt_schema</literal></entry>
2175 <entry><type>sql_identifier</type></entry>
2176 <entry>Name of the schema that the domain data type is defined in</entry>
2180 <entry><literal>udt_name</literal></entry>
2181 <entry><type>sql_identifier</type></entry>
2182 <entry>Name of the domain data type</entry>
2186 <entry><literal>scope_catalog</literal></entry>
2187 <entry><type>sql_identifier</type></entry>
2188 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2192 <entry><literal>scope_schema</literal></entry>
2193 <entry><type>sql_identifier</type></entry>
2194 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2198 <entry><literal>scope_name</literal></entry>
2199 <entry><type>sql_identifier</type></entry>
2200 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2204 <entry><literal>maximum_cardinality</literal></entry>
2205 <entry><type>cardinal_number</type></entry>
2206 <entry>Always null, because arrays always have unlimited maximum cardinality in <productname>PostgreSQL</></entry>
2210 <entry><literal>dtd_identifier</literal></entry>
2211 <entry><type>sql_identifier</type></entry>
2213 An identifier of the data type descriptor of the domain, unique
2214 among the data type descriptors pertaining to the domain (which
2215 is trivial, because a domain only contains one data type
2216 descriptor). This is mainly useful for joining with other
2217 instances of such identifiers. (The specific format of the
2218 identifier is not defined and not guaranteed to remain the same
2219 in future versions.)
2227 <sect1 id="infoschema-element-types">
2228 <title><literal>element_types</literal></title>
2231 The view <literal>element_types</literal> contains the data type
2232 descriptors of the elements of arrays. When a table column, composite-type attribute,
2233 domain, function parameter, or function return value is defined to
2234 be of an array type, the respective information schema view only
2235 contains <literal>ARRAY</literal> in the column
2236 <literal>data_type</literal>. To obtain information on the element
2237 type of the array, you can join the respective view with this view.
2238 For example, to show the columns of a table with data types and
2239 array element types, if applicable, you could do:
2241 SELECT c.column_name, c.data_type, e.data_type AS element_type
2242 FROM information_schema.columns c LEFT JOIN information_schema.element_types e
2243 ON ((c.table_catalog, c.table_schema, c.table_name, 'TABLE', c.dtd_identifier)
2244 = (e.object_catalog, e.object_schema, e.object_name, e.object_type, e.collection_type_identifier))
2245 WHERE c.table_schema = '...' AND c.table_name = '...'
2246 ORDER BY c.ordinal_position;
2248 This view only includes objects that the current user has access
2249 to, by way of being the owner or having some privilege.
2253 <title><literal>element_types</literal> Columns</title>
2259 <entry>Data Type</entry>
2260 <entry>Description</entry>
2266 <entry><literal>object_catalog</literal></entry>
2267 <entry><type>sql_identifier</type></entry>
2269 Name of the database that contains the object that uses the
2270 array being described (always the current database)
2275 <entry><literal>object_schema</literal></entry>
2276 <entry><type>sql_identifier</type></entry>
2278 Name of the schema that contains the object that uses the array
2284 <entry><literal>object_name</literal></entry>
2285 <entry><type>sql_identifier</type></entry>
2287 Name of the object that uses the array being described
2292 <entry><literal>object_type</literal></entry>
2293 <entry><type>character_data</type></entry>
2295 The type of the object that uses the array being described: one
2296 of <literal>TABLE</literal> (the array is used by a column of
2297 that table), <literal>USER-DEFINED TYPE</literal> (the array is
2298 used by an attribute of that composite type),
2299 <literal>DOMAIN</literal> (the array is used by that domain),
2300 <literal>ROUTINE</literal> (the array is used by a parameter or
2301 the return data type of that function).
2306 <entry><literal>collection_type_identifier</literal></entry>
2307 <entry><type>sql_identifier</type></entry>
2309 The identifier of the data type descriptor of the array being
2310 described. Use this to join with the
2311 <literal>dtd_identifier</literal> columns of other information
2317 <entry><literal>data_type</literal></entry>
2318 <entry><type>character_data</type></entry>
2320 Data type of the array elements, if it is a built-in type, else
2321 <literal>USER-DEFINED</literal> (in that case, the type is
2322 identified in <literal>udt_name</literal> and associated
2328 <entry><literal>character_maximum_length</literal></entry>
2329 <entry><type>cardinal_number</type></entry>
2330 <entry>Always null, since this information is not applied to array element data types in <productname>PostgreSQL</></entry>
2334 <entry><literal>character_octet_length</literal></entry>
2335 <entry><type>cardinal_number</type></entry>
2336 <entry>Always null, since this information is not applied to array element data types in <productname>PostgreSQL</></entry>
2340 <entry><literal>character_set_catalog</literal></entry>
2341 <entry><type>sql_identifier</type></entry>
2342 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2346 <entry><literal>character_set_schema</literal></entry>
2347 <entry><type>sql_identifier</type></entry>
2348 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2352 <entry><literal>character_set_name</literal></entry>
2353 <entry><type>sql_identifier</type></entry>
2354 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2358 <entry><literal>collation_catalog</literal></entry>
2359 <entry><type>sql_identifier</type></entry>
2361 Name of the database containing the collation of the element
2362 type (always the current database), null if default or the data
2363 type of the element is not collatable
2368 <entry><literal>collation_schema</literal></entry>
2369 <entry><type>sql_identifier</type></entry>
2371 Name of the schema containing the collation of the element
2372 type, null if default or the data type of the element is not
2378 <entry><literal>collation_name</literal></entry>
2379 <entry><type>sql_identifier</type></entry>
2381 Name of the collation of the element type, null if default or
2382 the data type of the element is not collatable
2387 <entry><literal>numeric_precision</literal></entry>
2388 <entry><type>cardinal_number</type></entry>
2389 <entry>Always null, since this information is not applied to array element data types in <productname>PostgreSQL</></entry>
2393 <entry><literal>numeric_precision_radix</literal></entry>
2394 <entry><type>cardinal_number</type></entry>
2395 <entry>Always null, since this information is not applied to array element data types in <productname>PostgreSQL</></entry>
2399 <entry><literal>numeric_scale</literal></entry>
2400 <entry><type>cardinal_number</type></entry>
2401 <entry>Always null, since this information is not applied to array element data types in <productname>PostgreSQL</></entry>
2405 <entry><literal>datetime_precision</literal></entry>
2406 <entry><type>cardinal_number</type></entry>
2407 <entry>Always null, since this information is not applied to array element data types in <productname>PostgreSQL</></entry>
2411 <entry><literal>interval_type</literal></entry>
2412 <entry><type>character_data</type></entry>
2413 <entry>Always null, since this information is not applied to array element data types in <productname>PostgreSQL</></entry>
2417 <entry><literal>interval_precision</literal></entry>
2418 <entry><type>cardinal_number</type></entry>
2419 <entry>Always null, since this information is not applied to array element data types in <productname>PostgreSQL</></entry>
2423 <entry><literal>domain_default</literal></entry>
2424 <entry><type>character_data</type></entry>
2425 <entry>Not yet implemented</entry>
2429 <entry><literal>udt_catalog</literal></entry>
2430 <entry><type>sql_identifier</type></entry>
2432 Name of the database that the data type of the elements is
2433 defined in (always the current database)
2438 <entry><literal>udt_schema</literal></entry>
2439 <entry><type>sql_identifier</type></entry>
2441 Name of the schema that the data type of the elements is
2447 <entry><literal>udt_name</literal></entry>
2448 <entry><type>sql_identifier</type></entry>
2450 Name of the data type of the elements
2455 <entry><literal>scope_catalog</literal></entry>
2456 <entry><type>sql_identifier</type></entry>
2457 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2461 <entry><literal>scope_schema</literal></entry>
2462 <entry><type>sql_identifier</type></entry>
2463 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2467 <entry><literal>scope_name</literal></entry>
2468 <entry><type>sql_identifier</type></entry>
2469 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2473 <entry><literal>maximum_cardinality</literal></entry>
2474 <entry><type>cardinal_number</type></entry>
2475 <entry>Always null, because arrays always have unlimited maximum cardinality in <productname>PostgreSQL</></entry>
2479 <entry><literal>dtd_identifier</literal></entry>
2480 <entry><type>sql_identifier</type></entry>
2482 An identifier of the data type descriptor of the element. This
2483 is currently not useful.
2491 <sect1 id="infoschema-enabled-roles">
2492 <title><literal>enabled_roles</literal></title>
2495 The view <literal>enabled_roles</literal> identifies the currently
2496 <quote>enabled roles</quote>. The enabled roles are recursively
2497 defined as the current user together with all roles that have been
2498 granted to the enabled roles with automatic inheritance. In other
2499 words, these are all roles that the current user has direct or
2500 indirect, automatically inheriting membership in.
2501 <indexterm><primary>enabled role</primary></indexterm>
2502 <indexterm><primary>role</primary><secondary>enabled</secondary></indexterm>
2506 For permission checking, the set of <quote>applicable roles</quote>
2507 is applied, which can be broader than the set of enabled roles. So
2508 generally, it is better to use the view
2509 <literal>applicable_roles</literal> instead of this one; see also
2514 <title><literal>enabled_roles</literal> Columns</title>
2520 <entry>Data Type</entry>
2521 <entry>Description</entry>
2527 <entry><literal>role_name</literal></entry>
2528 <entry><type>sql_identifier</type></entry>
2529 <entry>Name of a role</entry>
2536 <sect1 id="infoschema-foreign-data-wrapper-options">
2537 <title><literal>foreign_data_wrapper_options</literal></title>
2540 The view <literal>foreign_data_wrapper_options</literal> contains
2541 all the options defined for foreign-data wrappers in the current
2542 database. Only those foreign-data wrappers are shown that the
2543 current user has access to (by way of being the owner or having
2548 <title><literal>foreign_data_wrapper_options</literal> Columns</title>
2554 <entry>Data Type</entry>
2555 <entry>Description</entry>
2561 <entry><literal>foreign_data_wrapper_catalog</literal></entry>
2562 <entry><type>sql_identifier</type></entry>
2563 <entry>Name of the database that the foreign-data wrapper is defined in (always the current database)</entry>
2567 <entry><literal>foreign_data_wrapper_name</literal></entry>
2568 <entry><type>sql_identifier</type></entry>
2569 <entry>Name of the foreign-data wrapper</entry>
2573 <entry><literal>option_name</literal></entry>
2574 <entry><type>sql_identifier</type></entry>
2575 <entry>Name of an option</entry>
2579 <entry><literal>option_value</literal></entry>
2580 <entry><type>character_data</type></entry>
2581 <entry>Value of the option</entry>
2588 <sect1 id="infoschema-foreign-data-wrappers">
2589 <title><literal>foreign_data_wrappers</literal></title>
2592 The view <literal>foreign_data_wrappers</literal> contains all
2593 foreign-data wrappers defined in the current database. Only those
2594 foreign-data wrappers are shown that the current user has access to
2595 (by way of being the owner or having some privilege).
2599 <title><literal>foreign_data_wrappers</literal> Columns</title>
2605 <entry>Data Type</entry>
2606 <entry>Description</entry>
2612 <entry><literal>foreign_data_wrapper_catalog</literal></entry>
2613 <entry><type>sql_identifier</type></entry>
2614 <entry>Name of the database that contains the foreign-data
2615 wrapper (always the current database)</entry>
2619 <entry><literal>foreign_data_wrapper_name</literal></entry>
2620 <entry><type>sql_identifier</type></entry>
2621 <entry>Name of the foreign-data wrapper</entry>
2625 <entry><literal>authorization_identifier</literal></entry>
2626 <entry><type>sql_identifier</type></entry>
2627 <entry>Name of the owner of the foreign server</entry>
2631 <entry><literal>library_name</literal></entry>
2632 <entry><type>character_data</type></entry>
2633 <entry>File name of the library that implementing this foreign-data wrapper</entry>
2637 <entry><literal>foreign_data_wrapper_language</literal></entry>
2638 <entry><type>character_data</type></entry>
2639 <entry>Language used to implement this foreign-data wrapper</entry>
2646 <sect1 id="infoschema-foreign-server-options">
2647 <title><literal>foreign_server_options</literal></title>
2650 The view <literal>foreign_server_options</literal> contains all the
2651 options defined for foreign servers in the current database. Only
2652 those foreign servers are shown that the current user has access to
2653 (by way of being the owner or having some privilege).
2657 <title><literal>foreign_server_options</literal> Columns</title>
2663 <entry>Data Type</entry>
2664 <entry>Description</entry>
2670 <entry><literal>foreign_server_catalog</literal></entry>
2671 <entry><type>sql_identifier</type></entry>
2672 <entry>Name of the database that the foreign server is defined in (always the current database)</entry>
2676 <entry><literal>foreign_server_name</literal></entry>
2677 <entry><type>sql_identifier</type></entry>
2678 <entry>Name of the foreign server</entry>
2682 <entry><literal>option_name</literal></entry>
2683 <entry><type>sql_identifier</type></entry>
2684 <entry>Name of an option</entry>
2688 <entry><literal>option_value</literal></entry>
2689 <entry><type>character_data</type></entry>
2690 <entry>Value of the option</entry>
2697 <sect1 id="infoschema-foreign-servers">
2698 <title><literal>foreign_servers</literal></title>
2701 The view <literal>foreign_servers</literal> contains all foreign
2702 servers defined in the current database. Only those foreign
2703 servers are shown that the current user has access to (by way of
2704 being the owner or having some privilege).
2708 <title><literal>foreign_servers</literal> Columns</title>
2714 <entry>Data Type</entry>
2715 <entry>Description</entry>
2721 <entry><literal>foreign_server_catalog</literal></entry>
2722 <entry><type>sql_identifier</type></entry>
2723 <entry>Name of the database that the foreign server is defined in (always the current database)</entry>
2727 <entry><literal>foreign_server_name</literal></entry>
2728 <entry><type>sql_identifier</type></entry>
2729 <entry>Name of the foreign server</entry>
2733 <entry><literal>foreign_data_wrapper_catalog</literal></entry>
2734 <entry><type>sql_identifier</type></entry>
2735 <entry>Name of the database that contains the foreign-data
2736 wrapper used by the foreign server (always the current database)</entry>
2740 <entry><literal>foreign_data_wrapper_name</literal></entry>
2741 <entry><type>sql_identifier</type></entry>
2742 <entry>Name of the foreign-data wrapper used by the foreign server</entry>
2746 <entry><literal>foreign_server_type</literal></entry>
2747 <entry><type>character_data</type></entry>
2748 <entry>Foreign server type information, if specified upon creation</entry>
2752 <entry><literal>foreign_server_version</literal></entry>
2753 <entry><type>character_data</type></entry>
2754 <entry>Foreign server version information, if specified upon creation</entry>
2758 <entry><literal>authorization_identifier</literal></entry>
2759 <entry><type>sql_identifier</type></entry>
2760 <entry>Name of the owner of the foreign server</entry>
2767 <sect1 id="infoschema-foreign-table-options">
2768 <title><literal>foreign_table_options</literal></title>
2771 The view <literal>foreign_table_options</literal> contains all the
2772 options defined for foreign tables in the current database. Only
2773 those foreign tables are shown that the current user has access to
2774 (by way of being the owner or having some privilege).
2778 <title><literal>foreign_table_options</literal> Columns</title>
2784 <entry>Data Type</entry>
2785 <entry>Description</entry>
2791 <entry><literal>foreign_table_catalog</literal></entry>
2792 <entry><type>sql_identifier</type></entry>
2793 <entry>Name of the database that contains the foreign table (always the current database)</entry>
2797 <entry><literal>foreign_table_schema</literal></entry>
2798 <entry><type>sql_identifier</type></entry>
2799 <entry>Name of the schema that contains the foreign table</entry>
2803 <entry><literal>foreign_table_name</literal></entry>
2804 <entry><type>sql_identifier</type></entry>
2805 <entry>Name of the foreign table</entry>
2809 <entry><literal>foreign_server_catalog</literal></entry>
2810 <entry><type>sql_identifier</type></entry>
2811 <entry>Name of the database that the foreign server is defined in (always the current database)</entry>
2815 <entry><literal>foreign_server_name</literal></entry>
2816 <entry><type>sql_identifier</type></entry>
2817 <entry>Name of the foreign server</entry>
2821 <entry><literal>option_name</literal></entry>
2822 <entry><type>sql_identifier</type></entry>
2823 <entry>Name of an option</entry>
2827 <entry><literal>option_value</literal></entry>
2828 <entry><type>character_data</type></entry>
2829 <entry>Value of the option</entry>
2836 <sect1 id="infoschema-foreign-tables">
2837 <title><literal>foreign_tables</literal></title>
2840 The view <literal>foreign_tables</literal> contains all foreign
2841 tables defined in the current database. Only those foreign
2842 tables are shown that the current user has access to (by way of
2843 being the owner or having some privilege).
2847 <title><literal>foreign_tables</literal> Columns</title>
2853 <entry>Data Type</entry>
2854 <entry>Description</entry>
2860 <entry><literal>foreign_table_catalog</literal></entry>
2861 <entry><type>sql_identifier</type></entry>
2862 <entry>Name of the database that the foreign table is defined in (always the current database)</entry>
2866 <entry><literal>foreign_table_schema</literal></entry>
2867 <entry><type>sql_identifier</type></entry>
2868 <entry>Name of the schema that contains the foreign table</entry>
2872 <entry><literal>foreign_table_name</literal></entry>
2873 <entry><type>sql_identifier</type></entry>
2874 <entry>Name of the foreign table</entry>
2878 <entry><literal>foreign_server_catalog</literal></entry>
2879 <entry><type>sql_identifier</type></entry>
2880 <entry>Name of the database that the foreign server is defined in (always the current database)</entry>
2884 <entry><literal>foreign_server_name</literal></entry>
2885 <entry><type>sql_identifier</type></entry>
2886 <entry>Name of the foreign server</entry>
2893 <sect1 id="infoschema-key-column-usage">
2894 <title><literal>key_column_usage</literal></title>
2897 The view <literal>key_column_usage</literal> identifies all columns
2898 in the current database that are restricted by some unique, primary
2899 key, or foreign key constraint. Check constraints are not included
2900 in this view. Only those columns are shown that the current user
2901 has access to, by way of being the owner or having some privilege.
2905 <title><literal>key_column_usage</literal> Columns</title>
2911 <entry>Data Type</entry>
2912 <entry>Description</entry>
2918 <entry><literal>constraint_catalog</literal></entry>
2919 <entry><type>sql_identifier</type></entry>
2920 <entry>Name of the database that contains the constraint (always the current database)</entry>
2924 <entry><literal>constraint_schema</literal></entry>
2925 <entry><type>sql_identifier</type></entry>
2926 <entry>Name of the schema that contains the constraint</entry>
2930 <entry><literal>constraint_name</literal></entry>
2931 <entry><type>sql_identifier</type></entry>
2932 <entry>Name of the constraint</entry>
2936 <entry><literal>table_catalog</literal></entry>
2937 <entry><type>sql_identifier</type></entry>
2939 Name of the database that contains the table that contains the
2940 column that is restricted by this constraint (always the
2946 <entry><literal>table_schema</literal></entry>
2947 <entry><type>sql_identifier</type></entry>
2949 Name of the schema that contains the table that contains the
2950 column that is restricted by this constraint
2955 <entry><literal>table_name</literal></entry>
2956 <entry><type>sql_identifier</type></entry>
2958 Name of the table that contains the column that is restricted
2964 <entry><literal>column_name</literal></entry>
2965 <entry><type>sql_identifier</type></entry>
2967 Name of the column that is restricted by this constraint
2972 <entry><literal>ordinal_position</literal></entry>
2973 <entry><type>cardinal_number</type></entry>
2975 Ordinal position of the column within the constraint key (count
2981 <entry><literal>position_in_unique_constraint</literal></entry>
2982 <entry><type>cardinal_number</type></entry>
2984 For a foreign-key constraint, ordinal position of the referenced
2985 column within its unique constraint (count starts at 1);
2994 <sect1 id="infoschema-parameters">
2995 <title><literal>parameters</literal></title>
2998 The view <literal>parameters</literal> contains information about
2999 the parameters (arguments) of all functions in the current database.
3000 Only those functions are shown that the current user has access to
3001 (by way of being the owner or having some privilege).
3005 <title><literal>parameters</literal> Columns</title>
3011 <entry>Data Type</entry>
3012 <entry>Description</entry>
3018 <entry><literal>specific_catalog</literal></entry>
3019 <entry><type>sql_identifier</type></entry>
3020 <entry>Name of the database containing the function (always the current database)</entry>
3024 <entry><literal>specific_schema</literal></entry>
3025 <entry><type>sql_identifier</type></entry>
3026 <entry>Name of the schema containing the function</entry>
3030 <entry><literal>specific_name</literal></entry>
3031 <entry><type>sql_identifier</type></entry>
3033 The <quote>specific name</quote> of the function. See <xref
3034 linkend="infoschema-routines"> for more information.
3039 <entry><literal>ordinal_position</literal></entry>
3040 <entry><type>cardinal_number</type></entry>
3042 Ordinal position of the parameter in the argument list of the
3043 function (count starts at 1)
3048 <entry><literal>parameter_mode</literal></entry>
3049 <entry><type>character_data</type></entry>
3051 <literal>IN</literal> for input parameter,
3052 <literal>OUT</literal> for output parameter,
3053 and <literal>INOUT</literal> for input/output parameter.
3058 <entry><literal>is_result</literal></entry>
3059 <entry><type>yes_or_no</type></entry>
3060 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3064 <entry><literal>as_locator</literal></entry>
3065 <entry><type>yes_or_no</type></entry>
3066 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3070 <entry><literal>parameter_name</literal></entry>
3071 <entry><type>sql_identifier</type></entry>
3072 <entry>Name of the parameter, or null if the parameter has no name</entry>
3076 <entry><literal>data_type</literal></entry>
3077 <entry><type>character_data</type></entry>
3079 Data type of the parameter, if it is a built-in type, or
3080 <literal>ARRAY</literal> if it is some array (in that case, see
3081 the view <literal>element_types</literal>), else
3082 <literal>USER-DEFINED</literal> (in that case, the type is
3083 identified in <literal>udt_name</literal> and associated
3089 <entry><literal>character_maximum_length</literal></entry>
3090 <entry><type>cardinal_number</type></entry>
3091 <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</></entry>
3095 <entry><literal>character_octet_length</literal></entry>
3096 <entry><type>cardinal_number</type></entry>
3097 <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</></entry>
3101 <entry><literal>character_set_catalog</literal></entry>
3102 <entry><type>sql_identifier</type></entry>
3103 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3107 <entry><literal>character_set_schema</literal></entry>
3108 <entry><type>sql_identifier</type></entry>
3109 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3113 <entry><literal>character_set_name</literal></entry>
3114 <entry><type>sql_identifier</type></entry>
3115 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3119 <entry><literal>collation_catalog</literal></entry>
3120 <entry><type>sql_identifier</type></entry>
3121 <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</></entry>
3125 <entry><literal>collation_schema</literal></entry>
3126 <entry><type>sql_identifier</type></entry>
3127 <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</></entry>
3131 <entry><literal>collation_name</literal></entry>
3132 <entry><type>sql_identifier</type></entry>
3133 <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</></entry>
3137 <entry><literal>numeric_precision</literal></entry>
3138 <entry><type>cardinal_number</type></entry>
3139 <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</></entry>
3143 <entry><literal>numeric_precision_radix</literal></entry>
3144 <entry><type>cardinal_number</type></entry>
3145 <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</></entry>
3149 <entry><literal>numeric_scale</literal></entry>
3150 <entry><type>cardinal_number</type></entry>
3151 <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</></entry>
3155 <entry><literal>datetime_precision</literal></entry>
3156 <entry><type>cardinal_number</type></entry>
3157 <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</></entry>
3161 <entry><literal>interval_type</literal></entry>
3162 <entry><type>character_data</type></entry>
3163 <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</></entry>
3167 <entry><literal>interval_precision</literal></entry>
3168 <entry><type>cardinal_number</type></entry>
3169 <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</></entry>
3173 <entry><literal>udt_catalog</literal></entry>
3174 <entry><type>sql_identifier</type></entry>
3176 Name of the database that the data type of the parameter is
3177 defined in (always the current database)
3182 <entry><literal>udt_schema</literal></entry>
3183 <entry><type>sql_identifier</type></entry>
3185 Name of the schema that the data type of the parameter is
3191 <entry><literal>udt_name</literal></entry>
3192 <entry><type>sql_identifier</type></entry>
3194 Name of the data type of the parameter
3199 <entry><literal>scope_catalog</literal></entry>
3200 <entry><type>sql_identifier</type></entry>
3201 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3205 <entry><literal>scope_schema</literal></entry>
3206 <entry><type>sql_identifier</type></entry>
3207 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3211 <entry><literal>scope_name</literal></entry>
3212 <entry><type>sql_identifier</type></entry>
3213 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3217 <entry><literal>maximum_cardinality</literal></entry>
3218 <entry><type>cardinal_number</type></entry>
3219 <entry>Always null, because arrays always have unlimited maximum cardinality in <productname>PostgreSQL</></entry>
3223 <entry><literal>dtd_identifier</literal></entry>
3224 <entry><type>sql_identifier</type></entry>
3226 An identifier of the data type descriptor of the parameter,
3227 unique among the data type descriptors pertaining to the
3228 function. This is mainly useful for joining with other
3229 instances of such identifiers. (The specific format of the
3230 identifier is not defined and not guaranteed to remain the same
3231 in future versions.)
3239 <sect1 id="infoschema-referential-constraints">
3240 <title><literal>referential_constraints</literal></title>
3243 The view <literal>referential_constraints</literal> contains all
3244 referential (foreign key) constraints in the current database.
3245 Only those constraints are shown for which the current user has
3246 write access to the referencing table (by way of being the
3247 owner or having some privilege other than SELECT).
3251 <title><literal>referential_constraints</literal> Columns</title>
3257 <entry>Data Type</entry>
3258 <entry>Description</entry>
3264 <entry><literal>constraint_catalog</literal></entry>
3265 <entry><literal>sql_identifier</literal></entry>
3266 <entry>Name of the database containing the constraint (always the current database)</entry>
3270 <entry><literal>constraint_schema</literal></entry>
3271 <entry><literal>sql_identifier</literal></entry>
3272 <entry>Name of the schema containing the constraint</entry>
3276 <entry><literal>constraint_name</literal></entry>
3277 <entry><literal>sql_identifier</literal></entry>
3278 <entry>Name of the constraint</entry>
3282 <entry><literal>unique_constraint_catalog</literal></entry>
3283 <entry><literal>sql_identifier</literal></entry>
3285 Name of the database that contains the unique or primary key
3286 constraint that the foreign key constraint references (always
3287 the current database)
3292 <entry><literal>unique_constraint_schema</literal></entry>
3293 <entry><literal>sql_identifier</literal></entry>
3295 Name of the schema that contains the unique or primary key
3296 constraint that the foreign key constraint references
3301 <entry><literal>unique_constraint_name</literal></entry>
3302 <entry><literal>sql_identifier</literal></entry>
3304 Name of the unique or primary key constraint that the foreign
3305 key constraint references
3310 <entry><literal>match_option</literal></entry>
3311 <entry><literal>character_data</literal></entry>
3313 Match option of the foreign key constraint:
3314 <literal>FULL</literal>, <literal>PARTIAL</literal>, or
3315 <literal>NONE</literal>.
3320 <entry><literal>update_rule</literal></entry>
3321 <entry><literal>character_data</literal></entry>
3323 Update rule of the foreign key constraint:
3324 <literal>CASCADE</literal>, <literal>SET NULL</literal>,
3325 <literal>SET DEFAULT</literal>, <literal>RESTRICT</literal>, or
3326 <literal>NO ACTION</literal>.
3331 <entry><literal>delete_rule</literal></entry>
3332 <entry><literal>character_data</literal></entry>
3334 Delete rule of the foreign key constraint:
3335 <literal>CASCADE</literal>, <literal>SET NULL</literal>,
3336 <literal>SET DEFAULT</literal>, <literal>RESTRICT</literal>, or
3337 <literal>NO ACTION</literal>.
3346 <sect1 id="infoschema-role-column-grants">
3347 <title><literal>role_column_grants</literal></title>
3350 The view <literal>role_column_grants</literal> identifies all
3351 privileges granted on columns where the grantor or grantee is a
3352 currently enabled role. Further information can be found under
3353 <literal>column_privileges</literal>. The only effective
3354 difference between this view
3355 and <literal>column_privileges</literal> is that this view omits
3356 columns that have been made accessible to the current user by way
3357 of a grant to <literal>PUBLIC</literal>.
3361 <title><literal>role_column_grants</literal> Columns</title>
3367 <entry>Data Type</entry>
3368 <entry>Description</entry>
3374 <entry><literal>grantor</literal></entry>
3375 <entry><type>sql_identifier</type></entry>
3376 <entry>Name of the role that granted the privilege</entry>
3380 <entry><literal>grantee</literal></entry>
3381 <entry><type>sql_identifier</type></entry>
3382 <entry>Name of the role that the privilege was granted to</entry>
3386 <entry><literal>table_catalog</literal></entry>
3387 <entry><type>sql_identifier</type></entry>
3388 <entry>Name of the database that contains the table that contains the column (always the current database)</entry>
3392 <entry><literal>table_schema</literal></entry>
3393 <entry><type>sql_identifier</type></entry>
3394 <entry>Name of the schema that contains the table that contains the column</entry>
3398 <entry><literal>table_name</literal></entry>
3399 <entry><type>sql_identifier</type></entry>
3400 <entry>Name of the table that contains the column</entry>
3404 <entry><literal>column_name</literal></entry>
3405 <entry><type>sql_identifier</type></entry>
3406 <entry>Name of the column</entry>
3410 <entry><literal>privilege_type</literal></entry>
3411 <entry><type>character_data</type></entry>
3413 Type of the privilege: <literal>SELECT</literal>,
3414 <literal>INSERT</literal>, <literal>UPDATE</literal>, or
3415 <literal>REFERENCES</literal>
3420 <entry><literal>is_grantable</literal></entry>
3421 <entry><type>yes_or_no</type></entry>
3422 <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
3429 <sect1 id="infoschema-role-routine-grants">
3430 <title><literal>role_routine_grants</literal></title>
3433 The view <literal>role_routine_grants</literal> identifies all
3434 privileges granted on functions where the grantor or grantee is a
3435 currently enabled role. Further information can be found under
3436 <literal>routine_privileges</literal>. The only effective
3437 difference between this view
3438 and <literal>routine_privileges</literal> is that this view omits
3439 functions that have been made accessible to the current user by way
3440 of a grant to <literal>PUBLIC</literal>.
3444 <title><literal>role_routine_grants</literal> Columns</title>
3450 <entry>Data Type</entry>
3451 <entry>Description</entry>
3457 <entry><literal>grantor</literal></entry>
3458 <entry><type>sql_identifier</type></entry>
3459 <entry>Name of the role that granted the privilege</entry>
3463 <entry><literal>grantee</literal></entry>
3464 <entry><type>sql_identifier</type></entry>
3465 <entry>Name of the role that the privilege was granted to</entry>
3469 <entry><literal>specific_catalog</literal></entry>
3470 <entry><type>sql_identifier</type></entry>
3471 <entry>Name of the database containing the function (always the current database)</entry>
3475 <entry><literal>specific_schema</literal></entry>
3476 <entry><type>sql_identifier</type></entry>
3477 <entry>Name of the schema containing the function</entry>
3481 <entry><literal>specific_name</literal></entry>
3482 <entry><type>sql_identifier</type></entry>
3484 The <quote>specific name</quote> of the function. See <xref
3485 linkend="infoschema-routines"> for more information.
3490 <entry><literal>routine_catalog</literal></entry>
3491 <entry><type>sql_identifier</type></entry>
3492 <entry>Name of the database containing the function (always the current database)</entry>
3496 <entry><literal>routine_schema</literal></entry>
3497 <entry><type>sql_identifier</type></entry>
3498 <entry>Name of the schema containing the function</entry>
3502 <entry><literal>routine_name</literal></entry>
3503 <entry><type>sql_identifier</type></entry>
3504 <entry>Name of the function (might be duplicated in case of overloading)</entry>
3508 <entry><literal>privilege_type</literal></entry>
3509 <entry><type>character_data</type></entry>
3510 <entry>Always <literal>EXECUTE</literal> (the only privilege type for functions)</entry>
3514 <entry><literal>is_grantable</literal></entry>
3515 <entry><type>yes_or_no</type></entry>
3516 <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
3523 <sect1 id="infoschema-role-table-grants">
3524 <title><literal>role_table_grants</literal></title>
3527 The view <literal>role_table_grants</literal> identifies all
3528 privileges granted on tables or views where the grantor or grantee
3529 is a currently enabled role. Further information can be found
3530 under <literal>table_privileges</literal>. The only effective
3531 difference between this view
3532 and <literal>table_privileges</literal> is that this view omits
3533 tables that have been made accessible to the current user by way of
3534 a grant to <literal>PUBLIC</literal>.
3538 <title><literal>role_table_grants</literal> Columns</title>
3544 <entry>Data Type</entry>
3545 <entry>Description</entry>
3551 <entry><literal>grantor</literal></entry>
3552 <entry><type>sql_identifier</type></entry>
3553 <entry>Name of the role that granted the privilege</entry>
3557 <entry><literal>grantee</literal></entry>
3558 <entry><type>sql_identifier</type></entry>
3559 <entry>Name of the role that the privilege was granted to</entry>
3563 <entry><literal>table_catalog</literal></entry>
3564 <entry><type>sql_identifier</type></entry>
3565 <entry>Name of the database that contains the table (always the current database)</entry>
3569 <entry><literal>table_schema</literal></entry>
3570 <entry><type>sql_identifier</type></entry>
3571 <entry>Name of the schema that contains the table</entry>
3575 <entry><literal>table_name</literal></entry>
3576 <entry><type>sql_identifier</type></entry>
3577 <entry>Name of the table</entry>
3581 <entry><literal>privilege_type</literal></entry>
3582 <entry><type>character_data</type></entry>
3584 Type of the privilege: <literal>SELECT</literal>,
3585 <literal>INSERT</literal>, <literal>UPDATE</literal>,
3586 <literal>DELETE</literal>, <literal>TRUNCATE</literal>,
3587 <literal>REFERENCES</literal>, or <literal>TRIGGER</literal>
3592 <entry><literal>is_grantable</literal></entry>
3593 <entry><type>yes_or_no</type></entry>
3594 <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
3598 <entry><literal>with_hierarchy</literal></entry>
3599 <entry><type>yes_or_no</type></entry>
3600 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3607 <sect1 id="infoschema-role-udt-grants">
3608 <title><literal>role_udt_grants</literal></title>
3611 The view <literal>role_udt_grants</literal> is intended to identify
3612 <literal>USAGE</literal> privileges granted on user-defined types
3613 where the grantor or grantee is a currently enabled role. Further
3614 information can be found under
3615 <literal>udt_privileges</literal>. The only effective difference
3616 between this view and <literal>udt_privileges</literal> is that
3617 this view omits objects that have been made accessible to the
3618 current user by way of a grant to <literal>PUBLIC</literal>. Since
3619 data types do not have real privileges in PostgreSQL, but only an
3620 implicit grant to <literal>PUBLIC</literal>, this view is empty.
3624 <title><literal>role_udt_grants</literal> Columns</title>
3630 <entry>Data Type</entry>
3631 <entry>Description</entry>
3637 <entry><literal>grantor</literal></entry>
3638 <entry><type>sql_identifier</type></entry>
3639 <entry>The name of the role that granted the privilege</entry>
3643 <entry><literal>grantee</literal></entry>
3644 <entry><type>sql_identifier</type></entry>
3645 <entry>The name of the role that the privilege was granted to</entry>
3649 <entry><literal>udt_catalog</literal></entry>
3650 <entry><type>sql_identifier</type></entry>
3651 <entry>Name of the database containing the type (always the current database)</entry>
3655 <entry><literal>udt_schema</literal></entry>
3656 <entry><type>sql_identifier</type></entry>
3657 <entry>Name of the schema containing the type</entry>
3661 <entry><literal>udt_name</literal></entry>
3662 <entry><type>sql_identifier</type></entry>
3663 <entry>Name of the type</entry>
3667 <entry><literal>privilege_type</literal></entry>
3668 <entry><type>character_data</type></entry>
3669 <entry>Always <literal>TYPE USAGE</literal></entry>
3673 <entry><literal>is_grantable</literal></entry>
3674 <entry><type>yes_or_no</type></entry>
3675 <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
3682 <sect1 id="infoschema-role-usage-grants">
3683 <title><literal>role_usage_grants</literal></title>
3686 The view <literal>role_usage_grants</literal> identifies
3687 <literal>USAGE</literal> privileges granted on various kinds of
3688 objects where the grantor or grantee is a currently enabled role.
3689 Further information can be found under
3690 <literal>usage_privileges</literal>. The only effective difference
3691 between this view and <literal>usage_privileges</literal> is that
3692 this view omits objects that have been made accessible to the
3693 current user by way of a grant to <literal>PUBLIC</literal>.
3697 <title><literal>role_usage_grants</literal> Columns</title>
3703 <entry>Data Type</entry>
3704 <entry>Description</entry>
3710 <entry><literal>grantor</literal></entry>
3711 <entry><type>sql_identifier</type></entry>
3712 <entry>The name of the role that granted the privilege</entry>
3716 <entry><literal>grantee</literal></entry>
3717 <entry><type>sql_identifier</type></entry>
3718 <entry>The name of the role that the privilege was granted to</entry>
3722 <entry><literal>object_catalog</literal></entry>
3723 <entry><type>sql_identifier</type></entry>
3724 <entry>Name of the database containing the object (always the current database)</entry>
3728 <entry><literal>object_schema</literal></entry>
3729 <entry><type>sql_identifier</type></entry>
3730 <entry>Name of the schema containing the object, if applicable,
3731 else an empty string</entry>
3735 <entry><literal>object_name</literal></entry>
3736 <entry><type>sql_identifier</type></entry>
3737 <entry>Name of the object</entry>
3741 <entry><literal>object_type</literal></entry>
3742 <entry><type>character_data</type></entry>
3743 <entry><literal>COLLATION</literal> or <literal>DOMAIN</literal> or <literal>FOREIGN DATA WRAPPER</literal> or <literal>FOREIGN SERVER</literal></entry>
3747 <entry><literal>privilege_type</literal></entry>
3748 <entry><type>character_data</type></entry>
3749 <entry>Always <literal>USAGE</literal></entry>
3753 <entry><literal>is_grantable</literal></entry>
3754 <entry><type>yes_or_no</type></entry>
3755 <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
3762 <sect1 id="infoschema-routine-privileges">
3763 <title><literal>routine_privileges</literal></title>
3766 The view <literal>routine_privileges</literal> identifies all
3767 privileges granted on functions to a currently enabled role or by a
3768 currently enabled role. There is one row for each combination of function,
3769 grantor, and grantee.
3773 <title><literal>routine_privileges</literal> Columns</title>
3779 <entry>Data Type</entry>
3780 <entry>Description</entry>
3786 <entry><literal>grantor</literal></entry>
3787 <entry><type>sql_identifier</type></entry>
3788 <entry>Name of the role that granted the privilege</entry>
3792 <entry><literal>grantee</literal></entry>
3793 <entry><type>sql_identifier</type></entry>
3794 <entry>Name of the role that the privilege was granted to</entry>
3798 <entry><literal>specific_catalog</literal></entry>
3799 <entry><type>sql_identifier</type></entry>
3800 <entry>Name of the database containing the function (always the current database)</entry>
3804 <entry><literal>specific_schema</literal></entry>
3805 <entry><type>sql_identifier</type></entry>
3806 <entry>Name of the schema containing the function</entry>
3810 <entry><literal>specific_name</literal></entry>
3811 <entry><type>sql_identifier</type></entry>
3813 The <quote>specific name</quote> of the function. See <xref
3814 linkend="infoschema-routines"> for more information.
3819 <entry><literal>routine_catalog</literal></entry>
3820 <entry><type>sql_identifier</type></entry>
3821 <entry>Name of the database containing the function (always the current database)</entry>
3825 <entry><literal>routine_schema</literal></entry>
3826 <entry><type>sql_identifier</type></entry>
3827 <entry>Name of the schema containing the function</entry>
3831 <entry><literal>routine_name</literal></entry>
3832 <entry><type>sql_identifier</type></entry>
3833 <entry>Name of the function (might be duplicated in case of overloading)</entry>
3837 <entry><literal>privilege_type</literal></entry>
3838 <entry><type>character_data</type></entry>
3839 <entry>Always <literal>EXECUTE</literal> (the only privilege type for functions)</entry>
3843 <entry><literal>is_grantable</literal></entry>
3844 <entry><type>yes_or_no</type></entry>
3845 <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
3852 <sect1 id="infoschema-routines">
3853 <title><literal>routines</literal></title>
3856 The view <literal>routines</literal> contains all functions in the
3857 current database. Only those functions are shown that the current
3858 user has access to (by way of being the owner or having some
3863 <title><literal>routines</literal> Columns</title>
3869 <entry>Data Type</entry>
3870 <entry>Description</entry>
3876 <entry><literal>specific_catalog</literal></entry>
3877 <entry><type>sql_identifier</type></entry>
3878 <entry>Name of the database containing the function (always the current database)</entry>
3882 <entry><literal>specific_schema</literal></entry>
3883 <entry><type>sql_identifier</type></entry>
3884 <entry>Name of the schema containing the function</entry>
3888 <entry><literal>specific_name</literal></entry>
3889 <entry><type>sql_identifier</type></entry>
3891 The <quote>specific name</quote> of the function. This is a
3892 name that uniquely identifies the function in the schema, even
3893 if the real name of the function is overloaded. The format of
3894 the specific name is not defined, it should only be used to
3895 compare it to other instances of specific routine names.
3900 <entry><literal>routine_catalog</literal></entry>
3901 <entry><type>sql_identifier</type></entry>
3902 <entry>Name of the database containing the function (always the current database)</entry>
3906 <entry><literal>routine_schema</literal></entry>
3907 <entry><type>sql_identifier</type></entry>
3908 <entry>Name of the schema containing the function</entry>
3912 <entry><literal>routine_name</literal></entry>
3913 <entry><type>sql_identifier</type></entry>
3914 <entry>Name of the function (might be duplicated in case of overloading)</entry>
3918 <entry><literal>routine_type</literal></entry>
3919 <entry><type>character_data</type></entry>
3921 Always <literal>FUNCTION</literal> (In the future there might
3922 be other types of routines.)
3927 <entry><literal>module_catalog</literal></entry>
3928 <entry><type>sql_identifier</type></entry>
3929 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3933 <entry><literal>module_schema</literal></entry>
3934 <entry><type>sql_identifier</type></entry>
3935 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3939 <entry><literal>module_name</literal></entry>
3940 <entry><type>sql_identifier</type></entry>
3941 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3945 <entry><literal>udt_catalog</literal></entry>
3946 <entry><type>sql_identifier</type></entry>
3947 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3951 <entry><literal>udt_schema</literal></entry>
3952 <entry><type>sql_identifier</type></entry>
3953 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3957 <entry><literal>udt_name</literal></entry>
3958 <entry><type>sql_identifier</type></entry>
3959 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3963 <entry><literal>data_type</literal></entry>
3964 <entry><type>character_data</type></entry>
3966 Return data type of the function, if it is a built-in type, or
3967 <literal>ARRAY</literal> if it is some array (in that case, see
3968 the view <literal>element_types</literal>), else
3969 <literal>USER-DEFINED</literal> (in that case, the type is
3970 identified in <literal>type_udt_name</literal> and associated
3976 <entry><literal>character_maximum_length</literal></entry>
3977 <entry><type>cardinal_number</type></entry>
3978 <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
3982 <entry><literal>character_octet_length</literal></entry>
3983 <entry><type>cardinal_number</type></entry>
3984 <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
3988 <entry><literal>character_set_catalog</literal></entry>
3989 <entry><type>sql_identifier</type></entry>
3990 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3994 <entry><literal>character_set_schema</literal></entry>
3995 <entry><type>sql_identifier</type></entry>
3996 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4000 <entry><literal>character_set_name</literal></entry>
4001 <entry><type>sql_identifier</type></entry>
4002 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4006 <entry><literal>collation_catalog</literal></entry>
4007 <entry><type>sql_identifier</type></entry>
4008 <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
4012 <entry><literal>collation_schema</literal></entry>
4013 <entry><type>sql_identifier</type></entry>
4014 <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
4018 <entry><literal>collation_name</literal></entry>
4019 <entry><type>sql_identifier</type></entry>
4020 <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
4024 <entry><literal>numeric_precision</literal></entry>
4025 <entry><type>cardinal_number</type></entry>
4026 <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
4030 <entry><literal>numeric_precision_radix</literal></entry>
4031 <entry><type>cardinal_number</type></entry>
4032 <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
4036 <entry><literal>numeric_scale</literal></entry>
4037 <entry><type>cardinal_number</type></entry>
4038 <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
4042 <entry><literal>datetime_precision</literal></entry>
4043 <entry><type>cardinal_number</type></entry>
4044 <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
4048 <entry><literal>interval_type</literal></entry>
4049 <entry><type>character_data</type></entry>
4050 <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
4054 <entry><literal>interval_precision</literal></entry>
4055 <entry><type>cardinal_number</type></entry>
4056 <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
4060 <entry><literal>type_udt_catalog</literal></entry>
4061 <entry><type>sql_identifier</type></entry>
4063 Name of the database that the return data type of the function
4064 is defined in (always the current database)
4069 <entry><literal>type_udt_schema</literal></entry>
4070 <entry><type>sql_identifier</type></entry>
4072 Name of the schema that the return data type of the function is
4078 <entry><literal>type_udt_name</literal></entry>
4079 <entry><type>sql_identifier</type></entry>
4081 Name of the return data type of the function
4086 <entry><literal>scope_catalog</literal></entry>
4087 <entry><type>sql_identifier</type></entry>
4088 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4092 <entry><literal>scope_schema</literal></entry>
4093 <entry><type>sql_identifier</type></entry>
4094 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4098 <entry><literal>scope_name</literal></entry>
4099 <entry><type>sql_identifier</type></entry>
4100 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4104 <entry><literal>maximum_cardinality</literal></entry>
4105 <entry><type>cardinal_number</type></entry>
4106 <entry>Always null, because arrays always have unlimited maximum cardinality in <productname>PostgreSQL</></entry>
4110 <entry><literal>dtd_identifier</literal></entry>
4111 <entry><type>sql_identifier</type></entry>
4113 An identifier of the data type descriptor of the return data
4114 type of this function, unique among the data type descriptors
4115 pertaining to the function. This is mainly useful for joining
4116 with other instances of such identifiers. (The specific format
4117 of the identifier is not defined and not guaranteed to remain
4118 the same in future versions.)
4123 <entry><literal>routine_body</literal></entry>
4124 <entry><type>character_data</type></entry>
4126 If the function is an SQL function, then
4127 <literal>SQL</literal>, else <literal>EXTERNAL</literal>.
4132 <entry><literal>routine_definition</literal></entry>
4133 <entry><type>character_data</type></entry>
4135 The source text of the function (null if the function is not
4136 owned by a currently enabled role). (According to the SQL
4137 standard, this column is only applicable if
4138 <literal>routine_body</literal> is <literal>SQL</literal>, but
4139 in <productname>PostgreSQL</productname> it will contain
4140 whatever source text was specified when the function was
4146 <entry><literal>external_name</literal></entry>
4147 <entry><type>character_data</type></entry>
4149 If this function is a C function, then the external name (link
4150 symbol) of the function; else null. (This works out to be the
4151 same value that is shown in
4152 <literal>routine_definition</literal>.)
4157 <entry><literal>external_language</literal></entry>
4158 <entry><type>character_data</type></entry>
4159 <entry>The language the function is written in</entry>
4163 <entry><literal>parameter_style</literal></entry>
4164 <entry><type>character_data</type></entry>
4166 Always <literal>GENERAL</literal> (The SQL standard defines
4167 other parameter styles, which are not available in <productname>PostgreSQL</>.)
4172 <entry><literal>is_deterministic</literal></entry>
4173 <entry><type>yes_or_no</type></entry>
4175 If the function is declared immutable (called deterministic in
4176 the SQL standard), then <literal>YES</literal>, else
4177 <literal>NO</literal>. (You cannot query the other volatility
4178 levels available in <productname>PostgreSQL</> through the information schema.)
4183 <entry><literal>sql_data_access</literal></entry>
4184 <entry><type>character_data</type></entry>
4186 Always <literal>MODIFIES</literal>, meaning that the function
4187 possibly modifies SQL data. This information is not useful for
4188 <productname>PostgreSQL</>.
4193 <entry><literal>is_null_call</literal></entry>
4194 <entry><type>yes_or_no</type></entry>
4196 If the function automatically returns null if any of its
4197 arguments are null, then <literal>YES</literal>, else
4198 <literal>NO</literal>.
4203 <entry><literal>sql_path</literal></entry>
4204 <entry><type>character_data</type></entry>
4205 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4209 <entry><literal>schema_level_routine</literal></entry>
4210 <entry><type>yes_or_no</type></entry>
4212 Always <literal>YES</literal> (The opposite would be a method
4213 of a user-defined type, which is a feature not available in
4214 <productname>PostgreSQL</>.)
4219 <entry><literal>max_dynamic_result_sets</literal></entry>
4220 <entry><type>cardinal_number</type></entry>
4221 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4225 <entry><literal>is_user_defined_cast</literal></entry>
4226 <entry><type>yes_or_no</type></entry>
4227 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4231 <entry><literal>is_implicitly_invocable</literal></entry>
4232 <entry><type>yes_or_no</type></entry>
4233 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4237 <entry><literal>security_type</literal></entry>
4238 <entry><type>character_data</type></entry>
4240 If the function runs with the privileges of the current user,
4241 then <literal>INVOKER</literal>, if the function runs with the
4242 privileges of the user who defined it, then
4243 <literal>DEFINER</literal>.
4248 <entry><literal>to_sql_specific_catalog</literal></entry>
4249 <entry><type>sql_identifier</type></entry>
4250 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4254 <entry><literal>to_sql_specific_schema</literal></entry>
4255 <entry><type>sql_identifier</type></entry>
4256 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4260 <entry><literal>to_sql_specific_name</literal></entry>
4261 <entry><type>sql_identifier</type></entry>
4262 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4266 <entry><literal>as_locator</literal></entry>
4267 <entry><type>yes_or_no</type></entry>
4268 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4272 <entry><literal>created</literal></entry>
4273 <entry><type>time_stamp</type></entry>
4274 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4278 <entry><literal>last_altered</literal></entry>
4279 <entry><type>time_stamp</type></entry>
4280 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4284 <entry><literal>new_savepoint_level</literal></entry>
4285 <entry><type>yes_or_no</type></entry>
4286 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4290 <entry><literal>is_udt_dependent</literal></entry>
4291 <entry><type>yes_or_no</type></entry>
4292 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4296 <entry><literal>result_cast_from_data_type</literal></entry>
4297 <entry><type>character_data</type></entry>
4298 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4302 <entry><literal>result_cast_as_locator</literal></entry>
4303 <entry><type>yes_or_no</type></entry>
4304 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4308 <entry><literal>result_cast_char_max_length</literal></entry>
4309 <entry><type>cardinal_number</type></entry>
4310 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4314 <entry><literal>result_cast_char_octet_length</literal></entry>
4315 <entry><type>character_data</type></entry>
4316 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4320 <entry><literal>result_cast_char_set_catalog</literal></entry>
4321 <entry><type>sql_identifier</type></entry>
4322 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4326 <entry><literal>result_cast_char_set_schema</literal></entry>
4327 <entry><type>sql_identifier</type></entry>
4328 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4332 <entry><literal>result_cast_char_set_name</literal></entry>
4333 <entry><type>sql_identifier</type></entry>
4334 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4338 <entry><literal>result_cast_collation_catalog</literal></entry>
4339 <entry><type>sql_identifier</type></entry>
4340 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4344 <entry><literal>result_cast_collation_schema</literal></entry>
4345 <entry><type>sql_identifier</type></entry>
4346 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4350 <entry><literal>result_cast_collation_name</literal></entry>
4351 <entry><type>sql_identifier</type></entry>
4352 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4356 <entry><literal>result_cast_numeric_precision</literal></entry>
4357 <entry><type>cardinal_number</type></entry>
4358 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4362 <entry><literal>result_cast_numeric_precision_radix</literal></entry>
4363 <entry><type>cardinal_number</type></entry>
4364 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4368 <entry><literal>result_cast_numeric_scale</literal></entry>
4369 <entry><type>cardinal_number</type></entry>
4370 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4374 <entry><literal>result_cast_datetime_precision</literal></entry>
4375 <entry><type>character_data</type></entry>
4376 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4380 <entry><literal>result_cast_interval_type</literal></entry>
4381 <entry><type>character_data</type></entry>
4382 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4386 <entry><literal>result_cast_interval_precision</literal></entry>
4387 <entry><type>cardinal_number</type></entry>
4388 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4392 <entry><literal>result_cast_type_udt_catalog</literal></entry>
4393 <entry><type>sql_identifier</type></entry>
4394 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4398 <entry><literal>result_cast_type_udt_schema</literal></entry>
4399 <entry><type>sql_identifier</type></entry>
4400 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4404 <entry><literal>result_cast_type_udt_name</literal></entry>
4405 <entry><type>sql_identifier</type></entry>
4406 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4410 <entry><literal>result_cast_scope_catalog</literal></entry>
4411 <entry><type>sql_identifier</type></entry>
4412 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4416 <entry><literal>result_cast_scope_schema</literal></entry>
4417 <entry><type>sql_identifier</type></entry>
4418 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4422 <entry><literal>result_cast_scope_name</literal></entry>
4423 <entry><type>sql_identifier</type></entry>
4424 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4428 <entry><literal>result_cast_maximum_cardinality</literal></entry>
4429 <entry><type>cardinal_number</type></entry>
4430 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4434 <entry><literal>result_cast_dtd_identifier</literal></entry>
4435 <entry><type>sql_identifier</type></entry>
4436 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4443 <sect1 id="infoschema-schemata">
4444 <title><literal>schemata</literal></title>
4447 The view <literal>schemata</literal> contains all schemas in the
4448 current database that are owned by a currently enabled role.
4452 <title><literal>schemata</literal> Columns</title>
4458 <entry>Data Type</entry>
4459 <entry>Description</entry>
4465 <entry><literal>catalog_name</literal></entry>
4466 <entry><type>sql_identifier</type></entry>
4467 <entry>Name of the database that the schema is contained in (always the current database)</entry>
4471 <entry><literal>schema_name</literal></entry>
4472 <entry><type>sql_identifier</type></entry>
4473 <entry>Name of the schema</entry>
4477 <entry><literal>schema_owner</literal></entry>
4478 <entry><type>sql_identifier</type></entry>
4479 <entry>Name of the owner of the schema</entry>
4483 <entry><literal>default_character_set_catalog</literal></entry>
4484 <entry><type>sql_identifier</type></entry>
4485 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4489 <entry><literal>default_character_set_schema</literal></entry>
4490 <entry><type>sql_identifier</type></entry>
4491 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4495 <entry><literal>default_character_set_name</literal></entry>
4496 <entry><type>sql_identifier</type></entry>
4497 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4501 <entry><literal>sql_path</literal></entry>
4502 <entry><type>character_data</type></entry>
4503 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4510 <sect1 id="infoschema-sequences">
4511 <title><literal>sequences</literal></title>
4514 The view <literal>sequences</literal> contains all sequences
4515 defined in the current database. Only those sequences are shown
4516 that the current user has access to (by way of being the owner or
4517 having some privilege).
4521 <title><literal>sequences</literal> Columns</title>
4527 <entry>Data Type</entry>
4528 <entry>Description</entry>
4534 <entry><literal>sequence_catalog</literal></entry>
4535 <entry><type>sql_identifier</type></entry>
4536 <entry>Name of the database that contains the sequence (always the current database)</entry>
4540 <entry><literal>sequence_schema</literal></entry>
4541 <entry><type>sql_identifier</type></entry>
4542 <entry>Name of the schema that contains the sequence</entry>
4546 <entry><literal>sequence_name</literal></entry>
4547 <entry><type>sql_identifier</type></entry>
4548 <entry>Name of the sequence</entry>
4552 <entry><literal>data_type</literal></entry>
4553 <entry><type>character_data</type></entry>
4555 The data type of the sequence. In
4556 <productname>PostgreSQL</productname>, this is currently always
4557 <literal>bigint</literal>.
4562 <entry><literal>numeric_precision</literal></entry>
4563 <entry><type>cardinal_number</type></entry>
4565 This column contains the (declared or implicit) precision of
4566 the sequence data type (see above). The precision indicates
4567 the number of significant digits. It can be expressed in
4568 decimal (base 10) or binary (base 2) terms, as specified in the
4569 column <literal>numeric_precision_radix</literal>.
4574 <entry><literal>numeric_precision_radix</literal></entry>
4575 <entry><type>cardinal_number</type></entry>
4577 This column indicates in which base the values in the columns
4578 <literal>numeric_precision</literal> and
4579 <literal>numeric_scale</literal> are expressed. The value is
4585 <entry><literal>numeric_scale</literal></entry>
4586 <entry><type>cardinal_number</type></entry>
4588 This column contains the (declared or implicit) scale of the
4589 sequence data type (see above). The scale indicates the number
4590 of significant digits to the right of the decimal point. It
4591 can be expressed in decimal (base 10) or binary (base 2) terms,
4592 as specified in the column
4593 <literal>numeric_precision_radix</literal>.
4598 <entry><literal>start_value</literal></entry>
4599 <entry><type>character_data</type></entry>
4600 <entry>The start value of the sequence</entry>
4604 <entry><literal>minimum_value</literal></entry>
4605 <entry><type>character_data</type></entry>
4606 <entry>The minimum value of the sequence</entry>
4610 <entry><literal>maximum_value</literal></entry>
4611 <entry><type>character_data</type></entry>
4612 <entry>The maximum value of the sequence</entry>
4616 <entry><literal>increment</literal></entry>
4617 <entry><type>character_data</type></entry>
4618 <entry>The increment of the sequence</entry>
4622 <entry><literal>cycle_option</literal></entry>
4623 <entry><type>yes_or_no</type></entry>
4624 <entry><literal>YES</literal> if the sequence cycles, else <literal>NO</literal></entry>
4631 Note that in accordance with the SQL standard, the start, minimum,
4632 maximum, and increment values are returned as character strings.
4636 <sect1 id="infoschema-sql-features">
4637 <title><literal>sql_features</literal></title>
4640 The table <literal>sql_features</literal> contains information
4641 about which formal features defined in the SQL standard are
4642 supported by <productname>PostgreSQL</productname>. This is the
4643 same information that is presented in <xref linkend="features">.
4644 There you can also find some additional background information.
4648 <title><literal>sql_features</literal> Columns</title>
4654 <entry>Data Type</entry>
4655 <entry>Description</entry>
4661 <entry><literal>feature_id</literal></entry>
4662 <entry><type>character_data</type></entry>
4663 <entry>Identifier string of the feature</entry>
4667 <entry><literal>feature_name</literal></entry>
4668 <entry><type>character_data</type></entry>
4669 <entry>Descriptive name of the feature</entry>
4673 <entry><literal>sub_feature_id</literal></entry>
4674 <entry><type>character_data</type></entry>
4675 <entry>Identifier string of the subfeature, or a zero-length string if not a subfeature</entry>
4679 <entry><literal>sub_feature_name</literal></entry>
4680 <entry><type>character_data</type></entry>
4681 <entry>Descriptive name of the subfeature, or a zero-length string if not a subfeature</entry>
4685 <entry><literal>is_supported</literal></entry>
4686 <entry><type>yes_or_no</type></entry>
4688 <literal>YES</literal> if the feature is fully supported by the
4689 current version of <productname>PostgreSQL</>, <literal>NO</literal> if not
4694 <entry><literal>is_verified_by</literal></entry>
4695 <entry><type>character_data</type></entry>
4697 Always null, since the <productname>PostgreSQL</> development group does not
4698 perform formal testing of feature conformance
4703 <entry><literal>comments</literal></entry>
4704 <entry><type>character_data</type></entry>
4705 <entry>Possibly a comment about the supported status of the feature</entry>
4712 <sect1 id="infoschema-sql-implementation-info">
4713 <title><literal>sql_implementation_info</literal></title>
4716 The table <literal>sql_implementation_info</literal> contains
4717 information about various aspects that are left
4718 implementation-defined by the SQL standard. This information is
4719 primarily intended for use in the context of the ODBC interface;
4720 users of other interfaces will probably find this information to be
4721 of little use. For this reason, the individual implementation
4722 information items are not described here; you will find them in the
4723 description of the ODBC interface.
4727 <title><literal>sql_implementation_info</literal> Columns</title>
4733 <entry>Data Type</entry>
4734 <entry>Description</entry>
4740 <entry><literal>implementation_info_id</literal></entry>
4741 <entry><type>character_data</type></entry>
4742 <entry>Identifier string of the implementation information item</entry>
4746 <entry><literal>implementation_info_name</literal></entry>
4747 <entry><type>character_data</type></entry>
4748 <entry>Descriptive name of the implementation information item</entry>
4752 <entry><literal>integer_value</literal></entry>
4753 <entry><type>cardinal_number</type></entry>
4755 Value of the implementation information item, or null if the
4756 value is contained in the column
4757 <literal>character_value</literal>
4762 <entry><literal>character_value</literal></entry>
4763 <entry><type>character_data</type></entry>
4765 Value of the implementation information item, or null if the
4766 value is contained in the column
4767 <literal>integer_value</literal>
4772 <entry><literal>comments</literal></entry>
4773 <entry><type>character_data</type></entry>
4774 <entry>Possibly a comment pertaining to the implementation information item</entry>
4781 <sect1 id="infoschema-sql-languages">
4782 <title><literal>sql_languages</literal></title>
4785 The table <literal>sql_languages</literal> contains one row for
4786 each SQL language binding that is supported by
4787 <productname>PostgreSQL</productname>.
4788 <productname>PostgreSQL</productname> supports direct SQL and
4789 embedded SQL in C; that is all you will learn from this table.
4793 <title><literal>sql_languages</literal> Columns</title>
4799 <entry>Data Type</entry>
4800 <entry>Description</entry>
4806 <entry><literal>sql_language_source</literal></entry>
4807 <entry><type>character_data</type></entry>
4809 The name of the source of the language definition; always
4810 <literal>ISO 9075</literal>, that is, the SQL standard
4815 <entry><literal>sql_language_year</literal></entry>
4816 <entry><type>character_data</type></entry>
4818 The year the standard referenced in
4819 <literal>sql_language_source</literal> was approved; currently
4825 <entry><literal>sql_language_conformance</literal></entry>
4826 <entry><type>character_data</type></entry>
4828 The standard conformance level for the language binding. For
4829 ISO 9075:2003 this is always <literal>CORE</literal>.
4834 <entry><literal>sql_language_integrity</literal></entry>
4835 <entry><type>character_data</type></entry>
4836 <entry>Always null (This value is relevant to an earlier version of the SQL standard.)</entry>
4840 <entry><literal>sql_language_implementation</literal></entry>
4841 <entry><type>character_data</type></entry>
4842 <entry>Always null</entry>
4846 <entry><literal>sql_language_binding_style</literal></entry>
4847 <entry><type>character_data</type></entry>
4849 The language binding style, either <literal>DIRECT</literal> or
4850 <literal>EMBEDDED</literal>
4855 <entry><literal>sql_language_programming_language</literal></entry>
4856 <entry><type>character_data</type></entry>
4858 The programming language, if the binding style is
4859 <literal>EMBEDDED</literal>, else null. <productname>PostgreSQL</> only
4860 supports the language C.
4868 <sect1 id="infoschema-sql-packages">
4869 <title><literal>sql_packages</literal></title>
4872 The table <literal>sql_packages</literal> contains information
4873 about which feature packages defined in the SQL standard are
4874 supported by <productname>PostgreSQL</productname>. Refer to <xref
4875 linkend="features"> for background information on feature packages.
4879 <title><literal>sql_packages</literal> Columns</title>
4885 <entry>Data Type</entry>
4886 <entry>Description</entry>
4892 <entry><literal>feature_id</literal></entry>
4893 <entry><type>character_data</type></entry>
4894 <entry>Identifier string of the package</entry>
4898 <entry><literal>feature_name</literal></entry>
4899 <entry><type>character_data</type></entry>
4900 <entry>Descriptive name of the package</entry>
4904 <entry><literal>is_supported</literal></entry>
4905 <entry><type>yes_or_no</type></entry>
4907 <literal>YES</literal> if the package is fully supported by the
4908 current version of <productname>PostgreSQL</>, <literal>NO</literal> if not
4913 <entry><literal>is_verified_by</literal></entry>
4914 <entry><type>character_data</type></entry>
4916 Always null, since the <productname>PostgreSQL</> development group does not
4917 perform formal testing of feature conformance
4922 <entry><literal>comments</literal></entry>
4923 <entry><type>character_data</type></entry>
4924 <entry>Possibly a comment about the supported status of the package</entry>
4931 <sect1 id="infoschema-sql-parts">
4932 <title><literal>sql_parts</literal></title>
4935 The table <literal>sql_parts</literal> contains information about
4936 which of the several parts of the SQL standard are supported by
4937 <productname>PostgreSQL</productname>.
4941 <title><literal>sql_parts</literal> Columns</title>
4947 <entry>Data Type</entry>
4948 <entry>Description</entry>
4954 <entry><literal>feature_id</literal></entry>
4955 <entry><type>character_data</type></entry>
4956 <entry>An identifier string containing the number of the part</entry>
4960 <entry><literal>feature_name</literal></entry>
4961 <entry><type>character_data</type></entry>
4962 <entry>Descriptive name of the part</entry>
4966 <entry><literal>is_supported</literal></entry>
4967 <entry><type>yes_or_no</type></entry>
4969 <literal>YES</literal> if the part is fully supported by the
4970 current version of <productname>PostgreSQL</>,
4971 <literal>NO</literal> if not
4976 <entry><literal>is_verified_by</literal></entry>
4977 <entry><type>character_data</type></entry>
4979 Always null, since the <productname>PostgreSQL</> development group does not
4980 perform formal testing of feature conformance
4985 <entry><literal>comments</literal></entry>
4986 <entry><type>character_data</type></entry>
4987 <entry>Possibly a comment about the supported status of the part</entry>
4994 <sect1 id="infoschema-sql-sizing">
4995 <title><literal>sql_sizing</literal></title>
4998 The table <literal>sql_sizing</literal> contains information about
4999 various size limits and maximum values in
5000 <productname>PostgreSQL</productname>. This information is
5001 primarily intended for use in the context of the ODBC interface;
5002 users of other interfaces will probably find this information to be
5003 of little use. For this reason, the individual sizing items are
5004 not described here; you will find them in the description of the
5009 <title><literal>sql_sizing</literal> Columns</title>
5015 <entry>Data Type</entry>
5016 <entry>Description</entry>
5022 <entry><literal>sizing_id</literal></entry>
5023 <entry><type>cardinal_number</type></entry>
5024 <entry>Identifier of the sizing item</entry>
5028 <entry><literal>sizing_name</literal></entry>
5029 <entry><type>character_data</type></entry>
5030 <entry>Descriptive name of the sizing item</entry>
5034 <entry><literal>supported_value</literal></entry>
5035 <entry><type>cardinal_number</type></entry>
5037 Value of the sizing item, or 0 if the size is unlimited or
5038 cannot be determined, or null if the features for which the
5039 sizing item is applicable are not supported
5044 <entry><literal>comments</literal></entry>
5045 <entry><type>character_data</type></entry>
5046 <entry>Possibly a comment pertaining to the sizing item</entry>
5053 <sect1 id="infoschema-sql-sizing-profiles">
5054 <title><literal>sql_sizing_profiles</literal></title>
5057 The table <literal>sql_sizing_profiles</literal> contains
5058 information about the <literal>sql_sizing</literal> values that are
5059 required by various profiles of the SQL standard. <productname>PostgreSQL</> does
5060 not track any SQL profiles, so this table is empty.
5064 <title><literal>sql_sizing_profiles</literal> Columns</title>
5070 <entry>Data Type</entry>
5071 <entry>Description</entry>
5077 <entry><literal>sizing_id</literal></entry>
5078 <entry><type>cardinal_number</type></entry>
5079 <entry>Identifier of the sizing item</entry>
5083 <entry><literal>sizing_name</literal></entry>
5084 <entry><type>character_data</type></entry>
5085 <entry>Descriptive name of the sizing item</entry>
5089 <entry><literal>profile_id</literal></entry>
5090 <entry><type>character_data</type></entry>
5091 <entry>Identifier string of a profile</entry>
5095 <entry><literal>required_value</literal></entry>
5096 <entry><type>cardinal_number</type></entry>
5098 The value required by the SQL profile for the sizing item, or 0
5099 if the profile places no limit on the sizing item, or null if
5100 the profile does not require any of the features for which the
5101 sizing item is applicable
5106 <entry><literal>comments</literal></entry>
5107 <entry><type>character_data</type></entry>
5108 <entry>Possibly a comment pertaining to the sizing item within the profile</entry>
5115 <sect1 id="infoschema-table-constraints">
5116 <title><literal>table_constraints</literal></title>
5119 The view <literal>table_constraints</literal> contains all
5120 constraints belonging to tables that the current user owns or has
5121 some non-SELECT privilege on.
5125 <title><literal>table_constraints</literal> Columns</title>
5131 <entry>Data Type</entry>
5132 <entry>Description</entry>
5138 <entry><literal>constraint_catalog</literal></entry>
5139 <entry><type>sql_identifier</type></entry>
5140 <entry>Name of the database that contains the constraint (always the current database)</entry>
5144 <entry><literal>constraint_schema</literal></entry>
5145 <entry><type>sql_identifier</type></entry>
5146 <entry>Name of the schema that contains the constraint</entry>
5150 <entry><literal>constraint_name</literal></entry>
5151 <entry><type>sql_identifier</type></entry>
5152 <entry>Name of the constraint</entry>
5156 <entry><literal>table_catalog</literal></entry>
5157 <entry><type>sql_identifier</type></entry>
5158 <entry>Name of the database that contains the table (always the current database)</entry>
5162 <entry><literal>table_schema</literal></entry>
5163 <entry><type>sql_identifier</type></entry>
5164 <entry>Name of the schema that contains the table</entry>
5168 <entry><literal>table_name</literal></entry>
5169 <entry><type>sql_identifier</type></entry>
5170 <entry>Name of the table</entry>
5174 <entry><literal>constraint_type</literal></entry>
5175 <entry><type>character_data</type></entry>
5177 Type of the constraint: <literal>CHECK</literal>,
5178 <literal>FOREIGN KEY</literal>, <literal>PRIMARY KEY</literal>,
5179 or <literal>UNIQUE</literal>
5184 <entry><literal>is_deferrable</literal></entry>
5185 <entry><type>yes_or_no</type></entry>
5186 <entry><literal>YES</literal> if the constraint is deferrable, <literal>NO</literal> if not</entry>
5190 <entry><literal>initially_deferred</literal></entry>
5191 <entry><type>yes_or_no</type></entry>
5192 <entry><literal>YES</literal> if the constraint is deferrable and initially deferred, <literal>NO</literal> if not</entry>
5199 <sect1 id="infoschema-table-privileges">
5200 <title><literal>table_privileges</literal></title>
5203 The view <literal>table_privileges</literal> identifies all
5204 privileges granted on tables or views to a currently enabled role
5205 or by a currently enabled role. There is one row for each
5206 combination of table, grantor, and grantee.
5210 <title><literal>table_privileges</literal> Columns</title>
5216 <entry>Data Type</entry>
5217 <entry>Description</entry>
5223 <entry><literal>grantor</literal></entry>
5224 <entry><type>sql_identifier</type></entry>
5225 <entry>Name of the role that granted the privilege</entry>
5229 <entry><literal>grantee</literal></entry>
5230 <entry><type>sql_identifier</type></entry>
5231 <entry>Name of the role that the privilege was granted to</entry>
5235 <entry><literal>table_catalog</literal></entry>
5236 <entry><type>sql_identifier</type></entry>
5237 <entry>Name of the database that contains the table (always the current database)</entry>
5241 <entry><literal>table_schema</literal></entry>
5242 <entry><type>sql_identifier</type></entry>
5243 <entry>Name of the schema that contains the table</entry>
5247 <entry><literal>table_name</literal></entry>
5248 <entry><type>sql_identifier</type></entry>
5249 <entry>Name of the table</entry>
5253 <entry><literal>privilege_type</literal></entry>
5254 <entry><type>character_data</type></entry>
5256 Type of the privilege: <literal>SELECT</literal>,
5257 <literal>INSERT</literal>, <literal>UPDATE</literal>,
5258 <literal>DELETE</literal>, <literal>TRUNCATE</literal>,
5259 <literal>REFERENCES</literal>, or <literal>TRIGGER</literal>
5264 <entry><literal>is_grantable</literal></entry>
5265 <entry><type>yes_or_no</type></entry>
5266 <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
5270 <entry><literal>with_hierarchy</literal></entry>
5271 <entry><type>yes_or_no</type></entry>
5272 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5279 <sect1 id="infoschema-tables">
5280 <title><literal>tables</literal></title>
5283 The view <literal>tables</literal> contains all tables and views
5284 defined in the current database. Only those tables and views are
5285 shown that the current user has access to (by way of being the
5286 owner or having some privilege).
5290 <title><literal>tables</literal> Columns</title>
5296 <entry>Data Type</entry>
5297 <entry>Description</entry>
5303 <entry><literal>table_catalog</literal></entry>
5304 <entry><type>sql_identifier</type></entry>
5305 <entry>Name of the database that contains the table (always the current database)</entry>
5309 <entry><literal>table_schema</literal></entry>
5310 <entry><type>sql_identifier</type></entry>
5311 <entry>Name of the schema that contains the table</entry>
5315 <entry><literal>table_name</literal></entry>
5316 <entry><type>sql_identifier</type></entry>
5317 <entry>Name of the table</entry>
5321 <entry><literal>table_type</literal></entry>
5322 <entry><type>character_data</type></entry>
5324 Type of the table: <literal>BASE TABLE</literal> for a
5325 persistent base table (the normal table type),
5326 <literal>VIEW</literal> for a view, <literal>FOREIGN TABLE</literal>
5327 for a foreign table, or
5328 <literal>LOCAL TEMPORARY</literal> for a temporary table
5333 <entry><literal>self_referencing_column_name</literal></entry>
5334 <entry><type>sql_identifier</type></entry>
5335 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5339 <entry><literal>reference_generation</literal></entry>
5340 <entry><type>character_data</type></entry>
5341 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5345 <entry><literal>user_defined_type_catalog</literal></entry>
5346 <entry><type>sql_identifier</type></entry>
5348 If the table is a typed table, the name of the database that
5349 contains the underlying data type (always the current
5350 database), else null.
5355 <entry><literal>user_defined_type_schema</literal></entry>
5356 <entry><type>sql_identifier</type></entry>
5358 If the table is a typed table, the name of the schema that
5359 contains the underlying data type, else null.
5364 <entry><literal>user_defined_type_name</literal></entry>
5365 <entry><type>sql_identifier</type></entry>
5367 If the table is a typed table, the name of the underlying data
5373 <entry><literal>is_insertable_into</literal></entry>
5374 <entry><type>yes_or_no</type></entry>
5376 <literal>YES</literal> if the table is insertable into,
5377 <literal>NO</literal> if not (Base tables are always insertable
5378 into, views not necessarily.)
5383 <entry><literal>is_typed</literal></entry>
5384 <entry><type>yes_or_no</type></entry>
5385 <entry><literal>YES</literal> if the table is a typed table, <literal>NO</literal> if not</entry>
5389 <entry><literal>commit_action</literal></entry>
5390 <entry><type>character_data</type></entry>
5392 If the table is a temporary table, then
5393 <literal>PRESERVE</literal>, else null. (The SQL standard
5394 defines other commit actions for temporary tables, which are
5395 not supported by <productname>PostgreSQL</>.)
5403 <sect1 id="infoschema-triggered-update-columns">
5404 <title><literal>triggered_update_columns</literal></title>
5407 For triggers in the current database that specify a column list
5408 (like <literal>UPDATE OF column1, column2</literal>), the
5409 view <literal>triggered_update_columns</literal> identifies these
5410 columns. Triggers that do not specify a column list are not
5411 included in this view. Only those columns are shown that the
5412 current user owns or has some non-SELECT privilege on.
5416 <title><literal>triggered_update_columns</literal> Columns</title>
5422 <entry>Data Type</entry>
5423 <entry>Description</entry>
5429 <entry><literal>trigger_catalog</literal></entry>
5430 <entry><type>sql_identifier</type></entry>
5431 <entry>Name of the database that contains the trigger (always the current database)</entry>
5435 <entry><literal>trigger_schema</literal></entry>
5436 <entry><type>sql_identifier</type></entry>
5437 <entry>Name of the schema that contains the trigger</entry>
5441 <entry><literal>trigger_name</literal></entry>
5442 <entry><type>sql_identifier</type></entry>
5443 <entry>Name of the trigger</entry>
5447 <entry><literal>event_object_catalog</literal></entry>
5448 <entry><type>sql_identifier</type></entry>
5450 Name of the database that contains the table that the trigger
5451 is defined on (always the current database)
5456 <entry><literal>event_object_schema</literal></entry>
5457 <entry><type>sql_identifier</type></entry>
5458 <entry>Name of the schema that contains the table that the trigger is defined on</entry>
5462 <entry><literal>event_object_table</literal></entry>
5463 <entry><type>sql_identifier</type></entry>
5464 <entry>Name of the table that the trigger is defined on</entry>
5468 <entry><literal>event_object_column</literal></entry>
5469 <entry><type>sql_identifier</type></entry>
5470 <entry>Name of the column that the trigger is defined on</entry>
5477 <sect1 id="infoschema-triggers">
5478 <title><literal>triggers</literal></title>
5481 The view <literal>triggers</literal> contains all triggers defined
5482 in the current database on tables and views that the current user owns
5483 or has some non-SELECT privilege on.
5487 <title><literal>triggers</literal> Columns</title>
5493 <entry>Data Type</entry>
5494 <entry>Description</entry>
5500 <entry><literal>trigger_catalog</literal></entry>
5501 <entry><type>sql_identifier</type></entry>
5502 <entry>Name of the database that contains the trigger (always the current database)</entry>
5506 <entry><literal>trigger_schema</literal></entry>
5507 <entry><type>sql_identifier</type></entry>
5508 <entry>Name of the schema that contains the trigger</entry>
5512 <entry><literal>trigger_name</literal></entry>
5513 <entry><type>sql_identifier</type></entry>
5514 <entry>Name of the trigger</entry>
5518 <entry><literal>event_manipulation</literal></entry>
5519 <entry><type>character_data</type></entry>
5521 Event that fires the trigger (<literal>INSERT</literal>,
5522 <literal>UPDATE</literal>, or <literal>DELETE</literal>)
5527 <entry><literal>event_object_catalog</literal></entry>
5528 <entry><type>sql_identifier</type></entry>
5530 Name of the database that contains the table that the trigger
5531 is defined on (always the current database)
5536 <entry><literal>event_object_schema</literal></entry>
5537 <entry><type>sql_identifier</type></entry>
5538 <entry>Name of the schema that contains the table that the trigger is defined on</entry>
5542 <entry><literal>event_object_table</literal></entry>
5543 <entry><type>sql_identifier</type></entry>
5544 <entry>Name of the table that the trigger is defined on</entry>
5548 <entry><literal>action_order</literal></entry>
5549 <entry><type>cardinal_number</type></entry>
5550 <entry>Not yet implemented</entry>
5554 <entry><literal>action_condition</literal></entry>
5555 <entry><type>character_data</type></entry>
5557 <literal>WHEN</literal> condition of the trigger, null if none
5558 (also null if the table is not owned by a currently enabled
5564 <entry><literal>action_statement</literal></entry>
5565 <entry><type>character_data</type></entry>
5567 Statement that is executed by the trigger (currently always
5568 <literal>EXECUTE PROCEDURE
5569 <replaceable>function</replaceable>(...)</literal>)
5574 <entry><literal>action_orientation</literal></entry>
5575 <entry><type>character_data</type></entry>
5577 Identifies whether the trigger fires once for each processed
5578 row or once for each statement (<literal>ROW</literal> or
5579 <literal>STATEMENT</literal>)
5584 <entry><literal>action_timing</literal></entry>
5585 <entry><type>character_data</type></entry>
5587 Time at which the trigger fires (<literal>BEFORE</literal>,
5588 <literal>AFTER</literal>, or <literal>INSTEAD OF</literal>)
5593 <entry><literal>action_reference_old_table</literal></entry>
5594 <entry><type>sql_identifier</type></entry>
5595 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5599 <entry><literal>action_reference_new_table</literal></entry>
5600 <entry><type>sql_identifier</type></entry>
5601 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5605 <entry><literal>action_reference_old_row</literal></entry>
5606 <entry><type>sql_identifier</type></entry>
5607 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5611 <entry><literal>action_reference_new_row</literal></entry>
5612 <entry><type>sql_identifier</type></entry>
5613 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5617 <entry><literal>created</literal></entry>
5618 <entry><type>time_stamp</type></entry>
5619 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5626 Triggers in <productname>PostgreSQL</productname> have two
5627 incompatibilities with the SQL standard that affect the
5628 representation in the information schema. First, trigger names are
5629 local to each table in <productname>PostgreSQL</productname>, rather
5630 than being independent schema objects. Therefore there can be duplicate
5631 trigger names defined in one schema, so long as they belong to
5632 different tables. (<literal>trigger_catalog</literal> and
5633 <literal>trigger_schema</literal> are really the values pertaining
5634 to the table that the trigger is defined on.) Second, triggers can
5635 be defined to fire on multiple events in
5636 <productname>PostgreSQL</productname> (e.g., <literal>ON INSERT OR
5637 UPDATE</literal>), whereas the SQL standard only allows one. If a
5638 trigger is defined to fire on multiple events, it is represented as
5639 multiple rows in the information schema, one for each type of
5640 event. As a consequence of these two issues, the primary key of
5641 the view <literal>triggers</literal> is really
5642 <literal>(trigger_catalog, trigger_schema, event_object_table,
5643 trigger_name, event_manipulation)</literal> instead of
5644 <literal>(trigger_catalog, trigger_schema, trigger_name)</literal>,
5645 which is what the SQL standard specifies. Nonetheless, if you
5646 define your triggers in a manner that conforms with the SQL
5647 standard (trigger names unique in the schema and only one event
5648 type per trigger), this will not affect you.
5653 Prior to <productname>PostgreSQL</> 9.1, this view's columns
5654 <structfield>action_timing</structfield>,
5655 <structfield>action_reference_old_table</structfield>,
5656 <structfield>action_reference_new_table</structfield>,
5657 <structfield>action_reference_old_row</structfield>, and
5658 <structfield>action_reference_new_row</structfield>
5660 <structfield>condition_timing</structfield>,
5661 <structfield>condition_reference_old_table</structfield>,
5662 <structfield>condition_reference_new_table</structfield>,
5663 <structfield>condition_reference_old_row</structfield>, and
5664 <structfield>condition_reference_new_row</structfield>
5666 That was how they were named in the SQL:1999 standard.
5667 The new naming conforms to SQL:2003 and later.
5672 <sect1 id="infoschema-udt-privileges">
5673 <title><literal>udt_privileges</literal></title>
5676 The view <literal>udt_privileges</literal> is intended to identify
5677 <literal>USAGE</literal> privileges granted on user-defined types
5678 to a currently enabled role or by a currently enabled role. Since
5679 data types do not have real privileges
5680 in <productname>PostgreSQL</productname>, this view shows implicit
5681 non-grantable <literal>USAGE</literal> privileges granted by the
5682 owner to <literal>PUBLIC</literal> for all types, including
5683 built-in ones (except domains,
5684 see <xref linkend="infoschema-usage-privileges"> for that).
5688 <title><literal>udt_privileges</literal> Columns</title>
5694 <entry>Data Type</entry>
5695 <entry>Description</entry>
5701 <entry><literal>grantor</literal></entry>
5702 <entry><type>sql_identifier</type></entry>
5703 <entry>Name of the role that granted the privilege</entry>
5707 <entry><literal>grantee</literal></entry>
5708 <entry><type>sql_identifier</type></entry>
5709 <entry>Name of the role that the privilege was granted to</entry>
5713 <entry><literal>udt_catalog</literal></entry>
5714 <entry><type>sql_identifier</type></entry>
5715 <entry>Name of the database containing the type (always the current database)</entry>
5719 <entry><literal>udt_schema</literal></entry>
5720 <entry><type>sql_identifier</type></entry>
5721 <entry>Name of the schema containing the type</entry>
5725 <entry><literal>udt_name</literal></entry>
5726 <entry><type>sql_identifier</type></entry>
5727 <entry>Name of the type</entry>
5731 <entry><literal>privilege_type</literal></entry>
5732 <entry><type>character_data</type></entry>
5733 <entry>Always <literal>TYPE USAGE</literal></entry>
5737 <entry><literal>is_grantable</literal></entry>
5738 <entry><type>yes_or_no</type></entry>
5739 <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
5746 <sect1 id="infoschema-usage-privileges">
5747 <title><literal>usage_privileges</literal></title>
5750 The view <literal>usage_privileges</literal> identifies
5751 <literal>USAGE</literal> privileges granted on various kinds of
5752 objects to a currently enabled role or by a currently enabled role.
5753 In <productname>PostgreSQL</productname>, this currently applies to
5754 collations, domains, foreign-data wrappers, and foreign servers. There is one
5755 row for each combination of object, grantor, and grantee.
5759 Since collations and domains do not have real privileges
5760 in <productname>PostgreSQL</productname>, this view shows implicit
5761 non-grantable <literal>USAGE</literal> privileges granted by the
5762 owner to <literal>PUBLIC</literal> for all collations and domains. The other
5763 object types, however, show real privileges.
5767 <title><literal>usage_privileges</literal> Columns</title>
5773 <entry>Data Type</entry>
5774 <entry>Description</entry>
5780 <entry><literal>grantor</literal></entry>
5781 <entry><type>sql_identifier</type></entry>
5782 <entry>Name of the role that granted the privilege</entry>
5786 <entry><literal>grantee</literal></entry>
5787 <entry><type>sql_identifier</type></entry>
5788 <entry>Name of the role that the privilege was granted to</entry>
5792 <entry><literal>object_catalog</literal></entry>
5793 <entry><type>sql_identifier</type></entry>
5794 <entry>Name of the database containing the object (always the current database)</entry>
5798 <entry><literal>object_schema</literal></entry>
5799 <entry><type>sql_identifier</type></entry>
5800 <entry>Name of the schema containing the object, if applicable,
5801 else an empty string</entry>
5805 <entry><literal>object_name</literal></entry>
5806 <entry><type>sql_identifier</type></entry>
5807 <entry>Name of the object</entry>
5811 <entry><literal>object_type</literal></entry>
5812 <entry><type>character_data</type></entry>
5813 <entry><literal>COLLATION</literal> or <literal>DOMAIN</literal> or <literal>FOREIGN DATA WRAPPER</literal> or <literal>FOREIGN SERVER</literal></entry>
5817 <entry><literal>privilege_type</literal></entry>
5818 <entry><type>character_data</type></entry>
5819 <entry>Always <literal>USAGE</literal></entry>
5823 <entry><literal>is_grantable</literal></entry>
5824 <entry><type>yes_or_no</type></entry>
5825 <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
5832 <sect1 id="infoschema-user-defined-types">
5833 <title><literal>user_defined_types</literal></title>
5836 The view <literal>user_defined_types</literal> currently contains
5837 all composite types defined in the current database.
5841 SQL knows about two kinds of user-defined types: structured types
5842 (also known as composite types
5843 in <productname>PostgreSQL</productname>) and distinct types (not
5844 implemented in <productname>PostgreSQL</productname>). To be
5845 future-proof, use the
5846 column <literal>user_defined_type_category</literal> to
5847 differentiate between these. Other user-defined types such as base
5848 types and enums, which are <productname>PostgreSQL</productname>
5849 extensions, are not shown here. For domains,
5850 see <xref linkend="infoschema-domains"> instead.
5854 <title><literal>user_defined_types</literal> Columns</title>
5860 <entry>Data Type</entry>
5861 <entry>Description</entry>
5867 <entry><literal>user_defined_type_catalog</literal></entry>
5868 <entry><type>sql_identifier</type></entry>
5869 <entry>Name of the database that contains the type (always the current database)</entry>
5873 <entry><literal>user_defined_type_schema</literal></entry>
5874 <entry><type>sql_identifier</type></entry>
5875 <entry>Name of the schema that contains the type</entry>
5879 <entry><literal>user_defined_type_name</literal></entry>
5880 <entry><type>sql_identifier</type></entry>
5881 <entry>Name of the type</entry>
5885 <entry><literal>user_defined_type_category</literal></entry>
5886 <entry><type>character_data</type></entry>
5888 Currently always <literal>STRUCTURED</literal>
5893 <entry><literal>is_instantiable</literal></entry>
5894 <entry><type>yes_or_no</type></entry>
5895 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5899 <entry><literal>is_final</literal></entry>
5900 <entry><type>yes_or_no</type></entry>
5901 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5905 <entry><literal>ordering_form</literal></entry>
5906 <entry><type>character_data</type></entry>
5907 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5911 <entry><literal>ordering_category</literal></entry>
5912 <entry><type>character_data</type></entry>
5913 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5917 <entry><literal>ordering_routine_catalog</literal></entry>
5918 <entry><type>sql_identifier</type></entry>
5919 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5923 <entry><literal>ordering_routine_schema</literal></entry>
5924 <entry><type>sql_identifier</type></entry>
5925 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5929 <entry><literal>ordering_routine_name</literal></entry>
5930 <entry><type>sql_identifier</type></entry>
5931 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5935 <entry><literal>reference_type</literal></entry>
5936 <entry><type>character_data</type></entry>
5937 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5941 <entry><literal>data_type</literal></entry>
5942 <entry><type>character_data</type></entry>
5943 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5947 <entry><literal>character_maximum_length</literal></entry>
5948 <entry><type>cardinal_number</type></entry>
5949 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5953 <entry><literal>character_octet_length</literal></entry>
5954 <entry><type>cardinal_number</type></entry>
5955 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5959 <entry><literal>character_set_catalog</literal></entry>
5960 <entry><type>sql_identifier</type></entry>
5961 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5965 <entry><literal>character_set_schema</literal></entry>
5966 <entry><type>sql_identifier</type></entry>
5967 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5971 <entry><literal>character_set_name</literal></entry>
5972 <entry><type>sql_identifier</type></entry>
5973 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5977 <entry><literal>collation_catalog</literal></entry>
5978 <entry><type>sql_identifier</type></entry>
5979 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5983 <entry><literal>collation_schema</literal></entry>
5984 <entry><type>sql_identifier</type></entry>
5985 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5989 <entry><literal>collation_name</literal></entry>
5990 <entry><type>sql_identifier</type></entry>
5991 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5995 <entry><literal>numeric_precision</literal></entry>
5996 <entry><type>cardinal_number</type></entry>
5997 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
6001 <entry><literal>numeric_precision_radix</literal></entry>
6002 <entry><type>cardinal_number</type></entry>
6003 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
6007 <entry><literal>numeric_scale</literal></entry>
6008 <entry><type>cardinal_number</type></entry>
6009 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
6013 <entry><literal>datetime_precision</literal></entry>
6014 <entry><type>cardinal_number</type></entry>
6015 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
6019 <entry><literal>interval_type</literal></entry>
6020 <entry><type>character_data</type></entry>
6021 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
6025 <entry><literal>interval_precision</literal></entry>
6026 <entry><type>cardinal_number</type></entry>
6027 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
6031 <entry><literal>source_dtd_identifier</literal></entry>
6032 <entry><type>sql_identifier</type></entry>
6033 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
6037 <entry><literal>ref_dtd_identifier</literal></entry>
6038 <entry><type>sql_identifier</type></entry>
6039 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
6046 <sect1 id="infoschema-user-mapping-options">
6047 <title><literal>user_mapping_options</literal></title>
6050 The view <literal>user_mapping_options</literal> contains all the
6051 options defined for user mappings in the current database. Only
6052 those user mappings are shown where the current user has access to
6053 the corresponding foreign server (by way of being the owner or
6054 having some privilege).
6058 <title><literal>user_mapping_options</literal> Columns</title>
6064 <entry>Data Type</entry>
6065 <entry>Description</entry>
6071 <entry><literal>authorization_identifier</literal></entry>
6072 <entry><type>sql_identifier</type></entry>
6073 <entry>Name of the user being mapped,
6074 or <literal>PUBLIC</literal> if the mapping is public</entry>
6078 <entry><literal>foreign_server_catalog</literal></entry>
6079 <entry><type>sql_identifier</type></entry>
6080 <entry>Name of the database that the foreign server used by this
6081 mapping is defined in (always the current database)</entry>
6085 <entry><literal>foreign_server_name</literal></entry>
6086 <entry><type>sql_identifier</type></entry>
6087 <entry>Name of the foreign server used by this mapping</entry>
6091 <entry><literal>option_name</literal></entry>
6092 <entry><type>sql_identifier</type></entry>
6093 <entry>Name of an option</entry>
6097 <entry><literal>option_value</literal></entry>
6098 <entry><type>character_data</type></entry>
6099 <entry>Value of the option. This column will show as null
6100 unless the current user is the user being mapped, or the mapping
6101 is for <literal>PUBLIC</literal> and the current user is the
6102 server owner, or the current user is a superuser. The intent is
6103 to protect password information stored as user mapping
6111 <sect1 id="infoschema-user-mappings">
6112 <title><literal>user_mappings</literal></title>
6115 The view <literal>user_mappings</literal> contains all user
6116 mappings defined in the current database. Only those user mappings
6117 are shown where the current user has access to the corresponding
6118 foreign server (by way of being the owner or having some
6123 <title><literal>user_mappings</literal> Columns</title>
6129 <entry>Data Type</entry>
6130 <entry>Description</entry>
6136 <entry><literal>authorization_identifier</literal></entry>
6137 <entry><type>sql_identifier</type></entry>
6138 <entry>Name of the user being mapped,
6139 or <literal>PUBLIC</literal> if the mapping is public</entry>
6143 <entry><literal>foreign_server_catalog</literal></entry>
6144 <entry><type>sql_identifier</type></entry>
6145 <entry>Name of the database that the foreign server used by this
6146 mapping is defined in (always the current database)</entry>
6150 <entry><literal>foreign_server_name</literal></entry>
6151 <entry><type>sql_identifier</type></entry>
6152 <entry>Name of the foreign server used by this mapping</entry>
6159 <sect1 id="infoschema-view-column-usage">
6160 <title><literal>view_column_usage</literal></title>
6163 The view <literal>view_column_usage</literal> identifies all
6164 columns that are used in the query expression of a view (the
6165 <command>SELECT</command> statement that defines the view). A
6166 column is only included if the table that contains the column is
6167 owned by a currently enabled role.
6172 Columns of system tables are not included. This should be fixed
6178 <title><literal>view_column_usage</literal> Columns</title>
6184 <entry>Data Type</entry>
6185 <entry>Description</entry>
6191 <entry><literal>view_catalog</literal></entry>
6192 <entry><type>sql_identifier</type></entry>
6193 <entry>Name of the database that contains the view (always the current database)</entry>
6197 <entry><literal>view_schema</literal></entry>
6198 <entry><type>sql_identifier</type></entry>
6199 <entry>Name of the schema that contains the view</entry>
6203 <entry><literal>view_name</literal></entry>
6204 <entry><type>sql_identifier</type></entry>
6205 <entry>Name of the view</entry>
6209 <entry><literal>table_catalog</literal></entry>
6210 <entry><type>sql_identifier</type></entry>
6212 Name of the database that contains the table that contains the
6213 column that is used by the view (always the current database)
6218 <entry><literal>table_schema</literal></entry>
6219 <entry><type>sql_identifier</type></entry>
6221 Name of the schema that contains the table that contains the
6222 column that is used by the view
6227 <entry><literal>table_name</literal></entry>
6228 <entry><type>sql_identifier</type></entry>
6230 Name of the table that contains the column that is used by the
6236 <entry><literal>column_name</literal></entry>
6237 <entry><type>sql_identifier</type></entry>
6238 <entry>Name of the column that is used by the view</entry>
6245 <sect1 id="infoschema-view-routine-usage">
6246 <title><literal>view_routine_usage</literal></title>
6249 The view <literal>view_routine_usage</literal> identifies all
6250 routines (functions and procedures) that are used in the query
6251 expression of a view (the <command>SELECT</command> statement that
6252 defines the view). A routine is only included if that routine is
6253 owned by a currently enabled role.
6257 <title><literal>view_routine_usage</literal> Columns</title>
6263 <entry>Data Type</entry>
6264 <entry>Description</entry>
6270 <entry><literal>table_catalog</literal></entry>
6271 <entry><literal>sql_identifier</literal></entry>
6272 <entry>Name of the database containing the view (always the current database)</entry>
6276 <entry><literal>table_schema</literal></entry>
6277 <entry><literal>sql_identifier</literal></entry>
6278 <entry>Name of the schema containing the view</entry>
6282 <entry><literal>table_name</literal></entry>
6283 <entry><literal>sql_identifier</literal></entry>
6284 <entry>Name of the view</entry>
6288 <entry><literal>specific_catalog</literal></entry>
6289 <entry><literal>sql_identifier</literal></entry>
6290 <entry>Name of the database containing the function (always the current database)</entry>
6294 <entry><literal>specific_schema</literal></entry>
6295 <entry><literal>sql_identifier</literal></entry>
6296 <entry>Name of the schema containing the function</entry>
6300 <entry><literal>specific_name</literal></entry>
6301 <entry><literal>sql_identifier</literal></entry>
6303 The <quote>specific name</quote> of the function. See <xref
6304 linkend="infoschema-routines"> for more information.
6312 <sect1 id="infoschema-view-table-usage">
6313 <title><literal>view_table_usage</literal></title>
6316 The view <literal>view_table_usage</literal> identifies all tables
6317 that are used in the query expression of a view (the
6318 <command>SELECT</command> statement that defines the view). A
6319 table is only included if that table is owned by a currently
6325 System tables are not included. This should be fixed sometime.
6330 <title><literal>view_table_usage</literal> Columns</title>
6336 <entry>Data Type</entry>
6337 <entry>Description</entry>
6343 <entry><literal>view_catalog</literal></entry>
6344 <entry><type>sql_identifier</type></entry>
6345 <entry>Name of the database that contains the view (always the current database)</entry>
6349 <entry><literal>view_schema</literal></entry>
6350 <entry><type>sql_identifier</type></entry>
6351 <entry>Name of the schema that contains the view</entry>
6355 <entry><literal>view_name</literal></entry>
6356 <entry><type>sql_identifier</type></entry>
6357 <entry>Name of the view</entry>
6361 <entry><literal>table_catalog</literal></entry>
6362 <entry><type>sql_identifier</type></entry>
6364 Name of the database that contains the table that is
6365 used by the view (always the current database)
6370 <entry><literal>table_schema</literal></entry>
6371 <entry><type>sql_identifier</type></entry>
6373 Name of the schema that contains the table that is used by the
6379 <entry><literal>table_name</literal></entry>
6380 <entry><type>sql_identifier</type></entry>
6382 Name of the table that is used by the view
6390 <sect1 id="infoschema-views">
6391 <title><literal>views</literal></title>
6394 The view <literal>views</literal> contains all views defined in the
6395 current database. Only those views are shown that the current user
6396 has access to (by way of being the owner or having some privilege).
6400 <title><literal>views</literal> Columns</title>
6406 <entry>Data Type</entry>
6407 <entry>Description</entry>
6413 <entry><literal>table_catalog</literal></entry>
6414 <entry><type>sql_identifier</type></entry>
6415 <entry>Name of the database that contains the view (always the current database)</entry>
6419 <entry><literal>table_schema</literal></entry>
6420 <entry><type>sql_identifier</type></entry>
6421 <entry>Name of the schema that contains the view</entry>
6425 <entry><literal>table_name</literal></entry>
6426 <entry><type>sql_identifier</type></entry>
6427 <entry>Name of the view</entry>
6431 <entry><literal>view_definition</literal></entry>
6432 <entry><type>character_data</type></entry>
6434 Query expression defining the view (null if the view is not
6435 owned by a currently enabled role)
6440 <entry><literal>check_option</literal></entry>
6441 <entry><type>character_data</type></entry>
6442 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
6446 <entry><literal>is_updatable</literal></entry>
6447 <entry><type>yes_or_no</type></entry>
6449 <literal>YES</literal> if the view is updatable (allows
6450 <command>UPDATE</command> and <command>DELETE</command>),
6451 <literal>NO</literal> if not
6456 <entry><literal>is_insertable_into</literal></entry>
6457 <entry><type>yes_or_no</type></entry>
6459 <literal>YES</literal> if the view is insertable into (allows
6460 <command>INSERT</command>), <literal>NO</literal> if not
6465 <entry><literal>is_trigger_updatable</literal></entry>
6466 <entry><type>yes_or_no</type></entry>
6468 <literal>YES</> if the view has an <literal>INSTEAD OF</>
6469 <command>UPDATE</> trigger defined on it, <literal>NO</> if not
6474 <entry><literal>is_trigger_deletable</literal></entry>
6475 <entry><type>yes_or_no</type></entry>
6477 <literal>YES</> if the view has an <literal>INSTEAD OF</>
6478 <command>DELETE</> trigger defined on it, <literal>NO</> if not
6483 <entry><literal>is_trigger_insertable_into</literal></entry>
6484 <entry><type>yes_or_no</type></entry>
6486 <literal>YES</> if the view has an <literal>INSTEAD OF</>
6487 <command>INSERT</> trigger defined on it, <literal>NO</> if not