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>numeric_precision</literal></entry>
384 <entry><type>cardinal_number</type></entry>
386 If <literal>data_type</literal> identifies a numeric type, this
387 column contains the (declared or implicit) precision of the
388 type for this attribute. The precision indicates the number of
389 significant digits. It can be expressed in decimal (base 10)
390 or binary (base 2) terms, as specified in the column
391 <literal>numeric_precision_radix</literal>. For all other data
392 types, this column is null.
397 <entry><literal>numeric_precision_radix</literal></entry>
398 <entry><type>cardinal_number</type></entry>
400 If <literal>data_type</literal> identifies a numeric type, this
401 column indicates in which base the values in the columns
402 <literal>numeric_precision</literal> and
403 <literal>numeric_scale</literal> are expressed. The value is
404 either 2 or 10. For all other data types, this column is null.
409 <entry><literal>numeric_scale</literal></entry>
410 <entry><type>cardinal_number</type></entry>
412 If <literal>data_type</literal> identifies an exact numeric
413 type, this column contains the (declared or implicit) scale of
414 the type for this attribute. The scale indicates the number of
415 significant digits to the right of the decimal point. It can
416 be expressed in decimal (base 10) or binary (base 2) terms, as
417 specified in the column
418 <literal>numeric_precision_radix</literal>. For all other data
419 types, this column is null.
424 <entry><literal>datetime_precision</literal></entry>
425 <entry><type>cardinal_number</type></entry>
427 If <literal>data_type</literal> identifies a date, time,
428 timestamp, or interval type, this column contains the (declared
429 or implicit) fractional seconds precision of the type for this
430 attribute, that is, the number of decimal digits maintained
431 following the decimal point in the seconds value. For all
432 other data types, this column is null.
437 <entry><literal>interval_type</literal></entry>
438 <entry><type>character_data</type></entry>
439 <entry>Not yet implemented</entry>
443 <entry><literal>interval_precision</literal></entry>
444 <entry><type>character_data</type></entry>
445 <entry>Not yet implemented</entry>
449 <entry><literal>attribute_udt_catalog</literal></entry>
450 <entry><type>sql_identifier</type></entry>
452 Name of the database that the attribute data type is defined in
453 (always the current database)
458 <entry><literal>attribute_udt_schema</literal></entry>
459 <entry><type>sql_identifier</type></entry>
461 Name of the schema that the attribute data type is defined in
466 <entry><literal>attribute_udt_name</literal></entry>
467 <entry><type>sql_identifier</type></entry>
469 Name of the attribute data type
474 <entry><literal>scope_catalog</literal></entry>
475 <entry><type>sql_identifier</type></entry>
476 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
480 <entry><literal>scope_schema</literal></entry>
481 <entry><type>sql_identifier</type></entry>
482 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
486 <entry><literal>scope_name</literal></entry>
487 <entry><type>sql_identifier</type></entry>
488 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
492 <entry><literal>maximum_cardinality</literal></entry>
493 <entry><type>cardinal_number</type></entry>
494 <entry>Always null, because arrays always have unlimited maximum cardinality in <productname>PostgreSQL</></entry>
498 <entry><literal>dtd_identifier</literal></entry>
499 <entry><type>sql_identifier</type></entry>
501 An identifier of the data type descriptor of the column, unique
502 among the data type descriptors pertaining to the table. This
503 is mainly useful for joining with other instances of such
504 identifiers. (The specific format of the identifier is not
505 defined and not guaranteed to remain the same in future
511 <entry><literal>is_derived_reference_attribute</literal></entry>
512 <entry><type>yes_or_no</type></entry>
513 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
520 See also under <xref linkend="infoschema-columns">, a similarly
521 structured view, for further information on some of the columns.
525 <sect1 id="infoschema-character-sets">
526 <title><literal>character_sets</literal></title>
529 The view <literal>character_sets</literal> identifies the character
530 sets available in the current database. Since PostgreSQL does not
531 support multiple character sets within one database, this view only
532 shows one, which is the database encoding.
536 Take note of how the following terms are used in the SQL standard:
539 <term>character repertoire</term>
542 An abstract collection of characters, for
543 example <literal>UNICODE</literal>, <literal>UCS</literal>, or
544 <literal>LATIN1</literal>. Not exposed as an SQL object, but
545 visible in this view.
551 <term>character encoding form</term>
554 An encoding of some character repertoire. Most older character
555 repertoires only use one encoding form, and so there are no
556 separate names for them (e.g., <literal>LATIN1</literal> is an
557 encoding form applicable to the <literal>LATIN1</literal>
558 repertoire). But for example Unicode has the encoding forms
559 <literal>UTF8</literal>, <literal>UTF16</literal>, etc. (not
560 all supported by PostgreSQL). Encoding forms are not exposed
561 as an SQL object, but are visible in this view.
567 <term>character set</term>
570 A named SQL object that identifies a character repertoire, a
571 character encoding, and a default collation. A predefined
572 character set would typically have the same name as an encoding
573 form, but users could define other names. For example, the
574 character set <literal>UTF8</literal> would typically identify
575 the character repertoire <literal>UCS</literal>, encoding
576 form <literal>UTF8</literal>, and some default collation.
582 You can think of an <quote>encoding</quote> in PostgreSQL either as
583 a character set or a character encoding form. They will have the
584 same name, and there can only be one in one database.
588 <title><literal>character_sets</literal> Columns</title>
594 <entry>Data Type</entry>
595 <entry>Description</entry>
601 <entry><literal>character_set_catalog</literal></entry>
602 <entry><literal>sql_identifier</literal></entry>
603 <entry>Character sets are currently not implemented as schema objects, so this column is null.</entry>
607 <entry><literal>character_set_schema</literal></entry>
608 <entry><literal>sql_identifier</literal></entry>
609 <entry>Character sets are currently not implemented as schema objects, so this column is null.</entry>
613 <entry><literal>character_set_name</literal></entry>
614 <entry><literal>sql_identifier</literal></entry>
615 <entry>Name of the character set, currently implemented as showing the name of the database encoding</entry>
619 <entry><literal>character_repertoire</literal></entry>
620 <entry><literal>sql_identifier</literal></entry>
621 <entry>Character repertoire, showing <literal>UCS</literal> if the encoding is <literal>UTF8</literal>, else just the encoding name</entry>
625 <entry><literal>form_of_use</literal></entry>
626 <entry><literal>sql_identifier</literal></entry>
627 <entry>Character encoding form, same as the database encoding</entry>
631 <entry><literal>default_collate_catalog</literal></entry>
632 <entry><literal>sql_identifier</literal></entry>
633 <entry>Name of the database containing the default collation (always the current database, if any collation is identified)</entry>
637 <entry><literal>default_collate_schema</literal></entry>
638 <entry><literal>sql_identifier</literal></entry>
639 <entry>Name of the schema containing the default collation</entry>
643 <entry><literal>default_collate_name</literal></entry>
644 <entry><literal>sql_identifier</literal></entry>
646 Name of the default collation. The default collation is
647 identified as the collation that matches
648 the <literal>COLLATE</literal> and <literal>CTYPE</literal>
649 settings of the current database. If there is no such
650 collation, then this column and the associated schema and
651 catalog columns are null.
659 <sect1 id="infoschema-check-constraint-routine-usage">
660 <title><literal>check_constraint_routine_usage</literal></title>
663 The view <literal>check_constraint_routine_usage</literal>
664 identifies routines (functions and procedures) that are used by a
665 check constraint. Only those routines are shown that are owned by
666 a currently enabled role.
670 <title><literal>check_constraint_routine_usage</literal> Columns</title>
676 <entry>Data Type</entry>
677 <entry>Description</entry>
683 <entry><literal>constraint_catalog</literal></entry>
684 <entry><literal>sql_identifier</literal></entry>
685 <entry>Name of the database containing the constraint (always the current database)</entry>
689 <entry><literal>constraint_schema</literal></entry>
690 <entry><literal>sql_identifier</literal></entry>
691 <entry>Name of the schema containing the constraint</entry>
695 <entry><literal>constraint_name</literal></entry>
696 <entry><literal>sql_identifier</literal></entry>
697 <entry>Name of the constraint</entry>
701 <entry><literal>specific_catalog</literal></entry>
702 <entry><literal>sql_identifier</literal></entry>
703 <entry>Name of the database containing the function (always the current database)</entry>
707 <entry><literal>specific_schema</literal></entry>
708 <entry><literal>sql_identifier</literal></entry>
709 <entry>Name of the schema containing the function</entry>
713 <entry><literal>specific_name</literal></entry>
714 <entry><literal>sql_identifier</literal></entry>
716 The <quote>specific name</quote> of the function. See <xref
717 linkend="infoschema-routines"> for more information.
725 <sect1 id="infoschema-check-constraints">
726 <title><literal>check_constraints</literal></title>
729 The view <literal>check_constraints</literal> contains all check
730 constraints, either defined on a table or on a domain, that are
731 owned by a currently enabled role. (The owner of the table or
732 domain is the owner of the constraint.)
736 <title><literal>check_constraints</literal> Columns</title>
742 <entry>Data Type</entry>
743 <entry>Description</entry>
749 <entry><literal>constraint_catalog</literal></entry>
750 <entry><literal>sql_identifier</literal></entry>
751 <entry>Name of the database containing the constraint (always the current database)</entry>
755 <entry><literal>constraint_schema</literal></entry>
756 <entry><literal>sql_identifier</literal></entry>
757 <entry>Name of the schema containing the constraint</entry>
761 <entry><literal>constraint_name</literal></entry>
762 <entry><literal>sql_identifier</literal></entry>
763 <entry>Name of the constraint</entry>
767 <entry><literal>check_clause</literal></entry>
768 <entry><literal>character_data</literal></entry>
769 <entry>The check expression of the check constraint</entry>
776 <sect1 id="infoschema-collations">
777 <title><literal>collations</literal></title>
780 The view <literal>collations</literal> contains the collations
781 available in the current database.
785 <title><literal>collations</literal> Columns</title>
791 <entry>Data Type</entry>
792 <entry>Description</entry>
798 <entry><literal>collation_catalog</literal></entry>
799 <entry><literal>sql_identifier</literal></entry>
800 <entry>Name of the database containing the collation (always the current database)</entry>
804 <entry><literal>collation_schema</literal></entry>
805 <entry><literal>sql_identifier</literal></entry>
806 <entry>Name of the schema containing the collation</entry>
810 <entry><literal>collation_name</literal></entry>
811 <entry><literal>sql_identifier</literal></entry>
812 <entry>Name of the default collation</entry>
816 <entry><literal>pad_attribute</literal></entry>
817 <entry><literal>character_data</literal></entry>
819 Always <literal>NO PAD</literal> (The alternative <literal>PAD
820 SPACE</literal> is not supported by PostgreSQL.)
828 <sect1 id="infoschema-collation-character-set-applicab"> <!-- max 44 characters -->
829 <title><literal>collation_character_set_applicability</literal></title>
832 The view <literal>collation_character_set_applicability</literal>
833 identifies which character set the available collations are
834 applicable to. In PostgreSQL, there is only one character set per
835 database (see explanation
836 in <xref linkend="infoschema-character-sets">), so this view does
837 not provide much useful information.
841 <title><literal>collation_character_set_applicability</literal> Columns</title>
847 <entry>Data Type</entry>
848 <entry>Description</entry>
854 <entry><literal>collation_catalog</literal></entry>
855 <entry><literal>sql_identifier</literal></entry>
856 <entry>Name of the database containing the collation (always the current database)</entry>
860 <entry><literal>collation_schema</literal></entry>
861 <entry><literal>sql_identifier</literal></entry>
862 <entry>Name of the schema containing the collation</entry>
866 <entry><literal>collation_name</literal></entry>
867 <entry><literal>sql_identifier</literal></entry>
868 <entry>Name of the default collation</entry>
872 <entry><literal>character_set_catalog</literal></entry>
873 <entry><literal>sql_identifier</literal></entry>
874 <entry>Character sets are currently not implemented as schema objects, so this column is null</entry>
878 <entry><literal>character_set_schema</literal></entry>
879 <entry><literal>sql_identifier</literal></entry>
880 <entry>Character sets are currently not implemented as schema objects, so this column is null</entry>
884 <entry><literal>character_set_name</literal></entry>
885 <entry><literal>sql_identifier</literal></entry>
886 <entry>Name of the character set</entry>
893 <sect1 id="infoschema-column-domain-usage">
894 <title><literal>column_domain_usage</literal></title>
897 The view <literal>column_domain_usage</literal> identifies all
898 columns (of a table or a view) that make use of some domain defined
899 in the current database and owned by a currently enabled role.
903 <title><literal>column_domain_usage</literal> Columns</title>
909 <entry>Data Type</entry>
910 <entry>Description</entry>
916 <entry><literal>domain_catalog</literal></entry>
917 <entry><type>sql_identifier</type></entry>
918 <entry>Name of the database containing the domain (always the current database)</entry>
922 <entry><literal>domain_schema</literal></entry>
923 <entry><type>sql_identifier</type></entry>
924 <entry>Name of the schema containing the domain</entry>
928 <entry><literal>domain_name</literal></entry>
929 <entry><type>sql_identifier</type></entry>
930 <entry>Name of the domain</entry>
934 <entry><literal>table_catalog</literal></entry>
935 <entry><type>sql_identifier</type></entry>
936 <entry>Name of the database containing the table (always the current database)</entry>
940 <entry><literal>table_schema</literal></entry>
941 <entry><type>sql_identifier</type></entry>
942 <entry>Name of the schema containing the table</entry>
946 <entry><literal>table_name</literal></entry>
947 <entry><type>sql_identifier</type></entry>
948 <entry>Name of the table</entry>
952 <entry><literal>column_name</literal></entry>
953 <entry><type>sql_identifier</type></entry>
954 <entry>Name of the column</entry>
961 <sect1 id="infoschema-column-privileges">
962 <title><literal>column_privileges</literal></title>
965 The view <literal>column_privileges</literal> identifies all
966 privileges granted on columns to a currently enabled role or by a
967 currently enabled role. There is one row for each combination of
968 column, grantor, and grantee.
972 If a privilege has been granted on an entire table, it will show up in
973 this view as a grant for each column, but only for the
974 privilege types where column granularity is possible:
975 <literal>SELECT</literal>, <literal>INSERT</literal>,
976 <literal>UPDATE</literal>, <literal>REFERENCES</literal>.
980 <title><literal>column_privileges</literal> Columns</title>
986 <entry>Data Type</entry>
987 <entry>Description</entry>
993 <entry><literal>grantor</literal></entry>
994 <entry><type>sql_identifier</type></entry>
995 <entry>Name of the role that granted the privilege</entry>
999 <entry><literal>grantee</literal></entry>
1000 <entry><type>sql_identifier</type></entry>
1001 <entry>Name of the role that the privilege was granted to</entry>
1005 <entry><literal>table_catalog</literal></entry>
1006 <entry><type>sql_identifier</type></entry>
1007 <entry>Name of the database that contains the table that contains the column (always the current database)</entry>
1011 <entry><literal>table_schema</literal></entry>
1012 <entry><type>sql_identifier</type></entry>
1013 <entry>Name of the schema that contains the table that contains the column</entry>
1017 <entry><literal>table_name</literal></entry>
1018 <entry><type>sql_identifier</type></entry>
1019 <entry>Name of the table that contains the column</entry>
1023 <entry><literal>column_name</literal></entry>
1024 <entry><type>sql_identifier</type></entry>
1025 <entry>Name of the column</entry>
1029 <entry><literal>privilege_type</literal></entry>
1030 <entry><type>character_data</type></entry>
1032 Type of the privilege: <literal>SELECT</literal>,
1033 <literal>INSERT</literal>, <literal>UPDATE</literal>, or
1034 <literal>REFERENCES</literal>
1039 <entry><literal>is_grantable</literal></entry>
1040 <entry><type>yes_or_no</type></entry>
1041 <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
1048 <sect1 id="infoschema-column-udt-usage">
1049 <title><literal>column_udt_usage</literal></title>
1052 The view <literal>column_udt_usage</literal> identifies all columns
1053 that use data types owned by a currently enabled role. Note that in
1054 <productname>PostgreSQL</productname>, built-in data types behave
1055 like user-defined types, so they are included here as well. See
1056 also <xref linkend="infoschema-columns"> for details.
1060 <title><literal>column_udt_usage</literal> Columns</title>
1066 <entry>Data Type</entry>
1067 <entry>Description</entry>
1073 <entry><literal>udt_catalog</literal></entry>
1074 <entry><type>sql_identifier</type></entry>
1076 Name of the database that the column data type (the underlying
1077 type of the domain, if applicable) is defined in (always the
1083 <entry><literal>udt_schema</literal></entry>
1084 <entry><type>sql_identifier</type></entry>
1086 Name of the schema that the column data type (the underlying
1087 type of the domain, if applicable) is defined in
1092 <entry><literal>udt_name</literal></entry>
1093 <entry><type>sql_identifier</type></entry>
1095 Name of the column data type (the underlying type of the
1096 domain, if applicable)
1101 <entry><literal>table_catalog</literal></entry>
1102 <entry><type>sql_identifier</type></entry>
1103 <entry>Name of the database containing the table (always the current database)</entry>
1107 <entry><literal>table_schema</literal></entry>
1108 <entry><type>sql_identifier</type></entry>
1109 <entry>Name of the schema containing the table</entry>
1113 <entry><literal>table_name</literal></entry>
1114 <entry><type>sql_identifier</type></entry>
1115 <entry>Name of the table</entry>
1119 <entry><literal>column_name</literal></entry>
1120 <entry><type>sql_identifier</type></entry>
1121 <entry>Name of the column</entry>
1128 <sect1 id="infoschema-columns">
1129 <title><literal>columns</literal></title>
1132 The view <literal>columns</literal> contains information about all
1133 table columns (or view columns) in the database. System columns
1134 (<literal>oid</>, etc.) are not included. Only those columns are
1135 shown that the current user has access to (by way of being the
1136 owner or having some privilege).
1140 <title><literal>columns</literal> Columns</title>
1146 <entry>Data Type</entry>
1147 <entry>Description</entry>
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>
1177 <entry><literal>ordinal_position</literal></entry>
1178 <entry><type>cardinal_number</type></entry>
1179 <entry>Ordinal position of the column within the table (count starts at 1)</entry>
1183 <entry><literal>column_default</literal></entry>
1184 <entry><type>character_data</type></entry>
1185 <entry>Default expression of the column</entry>
1189 <entry><literal>is_nullable</literal></entry>
1190 <entry><type>yes_or_no</type></entry>
1192 <literal>YES</literal> if the column is possibly nullable,
1193 <literal>NO</literal> if it is known not nullable. A not-null
1194 constraint is one way a column can be known not nullable, but
1195 there can be others.
1200 <entry><literal>data_type</literal></entry>
1201 <entry><type>character_data</type></entry>
1203 Data type of the column, if it is a built-in type, or
1204 <literal>ARRAY</literal> if it is some array (in that case, see
1205 the view <literal>element_types</literal>), else
1206 <literal>USER-DEFINED</literal> (in that case, the type is
1207 identified in <literal>udt_name</literal> and associated
1208 columns). If the column is based on a domain, this column
1209 refers to the type underlying the domain (and the domain is
1210 identified in <literal>domain_name</literal> and associated
1216 <entry><literal>character_maximum_length</literal></entry>
1217 <entry><type>cardinal_number</type></entry>
1219 If <literal>data_type</literal> identifies a character or bit
1220 string type, the declared maximum length; null for all other
1221 data types or if no maximum length was declared.
1226 <entry><literal>character_octet_length</literal></entry>
1227 <entry><type>cardinal_number</type></entry>
1229 If <literal>data_type</literal> identifies a character type,
1230 the maximum possible length in octets (bytes) of a datum; null
1231 for all other data types. The maximum octet length depends on
1232 the declared character maximum length (see above) and the
1238 <entry><literal>numeric_precision</literal></entry>
1239 <entry><type>cardinal_number</type></entry>
1241 If <literal>data_type</literal> identifies a numeric type, this
1242 column contains the (declared or implicit) precision of the
1243 type for this column. The precision indicates the number of
1244 significant digits. It can be expressed in decimal (base 10)
1245 or binary (base 2) terms, as specified in the column
1246 <literal>numeric_precision_radix</literal>. For all other data
1247 types, this column is null.
1252 <entry><literal>numeric_precision_radix</literal></entry>
1253 <entry><type>cardinal_number</type></entry>
1255 If <literal>data_type</literal> identifies a numeric type, this
1256 column indicates in which base the values in the columns
1257 <literal>numeric_precision</literal> and
1258 <literal>numeric_scale</literal> are expressed. The value is
1259 either 2 or 10. For all other data types, this column is null.
1264 <entry><literal>numeric_scale</literal></entry>
1265 <entry><type>cardinal_number</type></entry>
1267 If <literal>data_type</literal> identifies an exact numeric
1268 type, this column contains the (declared or implicit) scale of
1269 the type for this column. The scale indicates the number of
1270 significant digits to the right of the decimal point. It can
1271 be expressed in decimal (base 10) or binary (base 2) terms, as
1272 specified in the column
1273 <literal>numeric_precision_radix</literal>. For all other data
1274 types, this column is null.
1279 <entry><literal>datetime_precision</literal></entry>
1280 <entry><type>cardinal_number</type></entry>
1282 If <literal>data_type</literal> identifies a date, time,
1283 timestamp, or interval type, this column contains the (declared
1284 or implicit) fractional seconds precision of the type for this
1285 column, that is, the number of decimal digits maintained
1286 following the decimal point in the seconds value. For all
1287 other data types, this column is null.
1292 <entry><literal>interval_type</literal></entry>
1293 <entry><type>character_data</type></entry>
1294 <entry>Not yet implemented</entry>
1298 <entry><literal>interval_precision</literal></entry>
1299 <entry><type>character_data</type></entry>
1300 <entry>Not yet implemented</entry>
1304 <entry><literal>character_set_catalog</literal></entry>
1305 <entry><type>sql_identifier</type></entry>
1306 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1310 <entry><literal>character_set_schema</literal></entry>
1311 <entry><type>sql_identifier</type></entry>
1312 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1316 <entry><literal>character_set_name</literal></entry>
1317 <entry><type>sql_identifier</type></entry>
1318 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1322 <entry><literal>collation_catalog</literal></entry>
1323 <entry><type>sql_identifier</type></entry>
1324 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1328 <entry><literal>collation_schema</literal></entry>
1329 <entry><type>sql_identifier</type></entry>
1330 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1334 <entry><literal>collation_name</literal></entry>
1335 <entry><type>sql_identifier</type></entry>
1336 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1340 <entry><literal>domain_catalog</literal></entry>
1341 <entry><type>sql_identifier</type></entry>
1343 If the column has a domain type, the name of the database that
1344 the domain is defined in (always the current database), else
1350 <entry><literal>domain_schema</literal></entry>
1351 <entry><type>sql_identifier</type></entry>
1353 If the column has a domain type, the name of the schema that
1354 the domain is defined in, else null.
1359 <entry><literal>domain_name</literal></entry>
1360 <entry><type>sql_identifier</type></entry>
1361 <entry>If the column has a domain type, the name of the domain, else null.</entry>
1365 <entry><literal>udt_catalog</literal></entry>
1366 <entry><type>sql_identifier</type></entry>
1368 Name of the database that the column data type (the underlying
1369 type of the domain, if applicable) is defined in (always the
1375 <entry><literal>udt_schema</literal></entry>
1376 <entry><type>sql_identifier</type></entry>
1378 Name of the schema that the column data type (the underlying
1379 type of the domain, if applicable) is defined in
1384 <entry><literal>udt_name</literal></entry>
1385 <entry><type>sql_identifier</type></entry>
1387 Name of the column data type (the underlying type of the
1388 domain, if applicable)
1393 <entry><literal>scope_catalog</literal></entry>
1394 <entry><type>sql_identifier</type></entry>
1395 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1399 <entry><literal>scope_schema</literal></entry>
1400 <entry><type>sql_identifier</type></entry>
1401 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1405 <entry><literal>scope_name</literal></entry>
1406 <entry><type>sql_identifier</type></entry>
1407 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1411 <entry><literal>maximum_cardinality</literal></entry>
1412 <entry><type>cardinal_number</type></entry>
1413 <entry>Always null, because arrays always have unlimited maximum cardinality in <productname>PostgreSQL</></entry>
1417 <entry><literal>dtd_identifier</literal></entry>
1418 <entry><type>sql_identifier</type></entry>
1420 An identifier of the data type descriptor of the column, unique
1421 among the data type descriptors pertaining to the table. This
1422 is mainly useful for joining with other instances of such
1423 identifiers. (The specific format of the identifier is not
1424 defined and not guaranteed to remain the same in future
1430 <entry><literal>is_self_referencing</literal></entry>
1431 <entry><type>yes_or_no</type></entry>
1432 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1436 <entry><literal>is_identity</literal></entry>
1437 <entry><type>yes_or_no</type></entry>
1438 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1442 <entry><literal>identity_generation</literal></entry>
1443 <entry><type>character_data</type></entry>
1444 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1448 <entry><literal>identity_start</literal></entry>
1449 <entry><type>character_data</type></entry>
1450 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1454 <entry><literal>identity_increment</literal></entry>
1455 <entry><type>character_data</type></entry>
1456 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1460 <entry><literal>identity_maximum</literal></entry>
1461 <entry><type>character_data</type></entry>
1462 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1466 <entry><literal>identity_minimum</literal></entry>
1467 <entry><type>character_data</type></entry>
1468 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1472 <entry><literal>identity_cycle</literal></entry>
1473 <entry><type>yes_or_no</type></entry>
1474 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1478 <entry><literal>is_generated</literal></entry>
1479 <entry><type>character_data</type></entry>
1480 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1484 <entry><literal>generation_expression</literal></entry>
1485 <entry><type>character_data</type></entry>
1486 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1490 <entry><literal>is_updatable</literal></entry>
1491 <entry><type>yes_or_no</type></entry>
1493 <literal>YES</literal> if the column is updatable,
1494 <literal>NO</literal> if not (Columns in base tables are always
1495 updatable, columns in views not necessarily)
1503 Since data types can be defined in a variety of ways in SQL, and
1504 <productname>PostgreSQL</productname> contains additional ways to
1505 define data types, their representation in the information schema
1506 can be somewhat difficult. The column <literal>data_type</literal>
1507 is supposed to identify the underlying built-in type of the column.
1508 In <productname>PostgreSQL</productname>, this means that the type
1509 is defined in the system catalog schema
1510 <literal>pg_catalog</literal>. This column might be useful if the
1511 application can handle the well-known built-in types specially (for
1512 example, format the numeric types differently or use the data in
1513 the precision columns). The columns <literal>udt_name</literal>,
1514 <literal>udt_schema</literal>, and <literal>udt_catalog</literal>
1515 always identify the underlying data type of the column, even if the
1516 column is based on a domain. (Since
1517 <productname>PostgreSQL</productname> treats built-in types like
1518 user-defined types, built-in types appear here as well. This is an
1519 extension of the SQL standard.) These columns should be used if an
1520 application wants to process data differently according to the
1521 type, because in that case it wouldn't matter if the column is
1522 really based on a domain. If the column is based on a domain, the
1523 identity of the domain is stored in the columns
1524 <literal>domain_name</literal>, <literal>domain_schema</literal>,
1525 and <literal>domain_catalog</literal>. If you want to pair up
1526 columns with their associated data types and treat domains as
1527 separate types, you could write <literal>coalesce(domain_name,
1528 udt_name)</literal>, etc.
1532 <sect1 id="infoschema-constraint-column-usage">
1533 <title><literal>constraint_column_usage</literal></title>
1536 The view <literal>constraint_column_usage</literal> identifies all
1537 columns in the current database that are used by some constraint.
1538 Only those columns are shown that are contained in a table owned by
1539 a currently enabled role. For a check constraint, this view
1540 identifies the columns that are used in the check expression. For
1541 a foreign key constraint, this view identifies the columns that the
1542 foreign key references. For a unique or primary key constraint,
1543 this view identifies the constrained columns.
1547 <title><literal>constraint_column_usage</literal> Columns</title>
1553 <entry>Data Type</entry>
1554 <entry>Description</entry>
1560 <entry><literal>table_catalog</literal></entry>
1561 <entry><type>sql_identifier</type></entry>
1563 Name of the database that contains the table that contains the
1564 column that is used by some constraint (always the current
1570 <entry><literal>table_schema</literal></entry>
1571 <entry><type>sql_identifier</type></entry>
1573 Name of the schema that contains the table that contains the
1574 column that is used by some constraint
1579 <entry><literal>table_name</literal></entry>
1580 <entry><type>sql_identifier</type></entry>
1582 Name of the table that contains the column that is used by some
1588 <entry><literal>column_name</literal></entry>
1589 <entry><type>sql_identifier</type></entry>
1591 Name of the column that is used by some constraint
1596 <entry><literal>constraint_catalog</literal></entry>
1597 <entry><type>sql_identifier</type></entry>
1598 <entry>Name of the database that contains the constraint (always the current database)</entry>
1602 <entry><literal>constraint_schema</literal></entry>
1603 <entry><type>sql_identifier</type></entry>
1604 <entry>Name of the schema that contains the constraint</entry>
1608 <entry><literal>constraint_name</literal></entry>
1609 <entry><type>sql_identifier</type></entry>
1610 <entry>Name of the constraint</entry>
1617 <sect1 id="infoschema-constraint-table-usage">
1618 <title><literal>constraint_table_usage</literal></title>
1621 The view <literal>constraint_table_usage</literal> identifies all
1622 tables in the current database that are used by some constraint and
1623 are owned by a currently enabled role. (This is different from the
1624 view <literal>table_constraints</literal>, which identifies all
1625 table constraints along with the table they are defined on.) For a
1626 foreign key constraint, this view identifies the table that the
1627 foreign key references. For a unique or primary key constraint,
1628 this view simply identifies the table the constraint belongs to.
1629 Check constraints and not-null constraints are not included in this
1634 <title><literal>constraint_table_usage</literal> Columns</title>
1640 <entry>Data Type</entry>
1641 <entry>Description</entry>
1647 <entry><literal>table_catalog</literal></entry>
1648 <entry><type>sql_identifier</type></entry>
1650 Name of the database that contains the table that is used by
1651 some constraint (always the current database)
1656 <entry><literal>table_schema</literal></entry>
1657 <entry><type>sql_identifier</type></entry>
1659 Name of the schema that contains the table that is used by some
1665 <entry><literal>table_name</literal></entry>
1666 <entry><type>sql_identifier</type></entry>
1667 <entry>Name of the table that is used by some constraint</entry>
1671 <entry><literal>constraint_catalog</literal></entry>
1672 <entry><type>sql_identifier</type></entry>
1673 <entry>Name of the database that contains the constraint (always the current database)</entry>
1677 <entry><literal>constraint_schema</literal></entry>
1678 <entry><type>sql_identifier</type></entry>
1679 <entry>Name of the schema that contains the constraint</entry>
1683 <entry><literal>constraint_name</literal></entry>
1684 <entry><type>sql_identifier</type></entry>
1685 <entry>Name of the constraint</entry>
1692 <sect1 id="infoschema-data-type-privileges">
1693 <title><literal>data_type_privileges</literal></title>
1696 The view <literal>data_type_privileges</literal> identifies all
1697 data type descriptors that the current user has access to, by way
1698 of being the owner of the described object or having some privilege
1699 for it. A data type descriptor is generated whenever a data type
1700 is used in the definition of a table column, a domain, or a
1701 function (as parameter or return type) and stores some information
1702 about how the data type is used in that instance (for example, the
1703 declared maximum length, if applicable). Each data type
1704 descriptor is assigned an arbitrary identifier that is unique
1705 among the data type descriptor identifiers assigned for one object
1706 (table, domain, function). This view is probably not useful for
1707 applications, but it is used to define some other views in the
1712 <title><literal>data_type_privileges</literal> Columns</title>
1718 <entry>Data Type</entry>
1719 <entry>Description</entry>
1725 <entry><literal>object_catalog</literal></entry>
1726 <entry><type>sql_identifier</type></entry>
1727 <entry>Name of the database that contains the described object (always the current database)</entry>
1731 <entry><literal>object_schema</literal></entry>
1732 <entry><type>sql_identifier</type></entry>
1733 <entry>Name of the schema that contains the described object</entry>
1737 <entry><literal>object_name</literal></entry>
1738 <entry><type>sql_identifier</type></entry>
1739 <entry>Name of the described object</entry>
1743 <entry><literal>object_type</literal></entry>
1744 <entry><type>character_data</type></entry>
1746 The type of the described object: one of
1747 <literal>TABLE</literal> (the data type descriptor pertains to
1748 a column of that table), <literal>DOMAIN</literal> (the data
1749 type descriptors pertains to that domain),
1750 <literal>ROUTINE</literal> (the data type descriptor pertains
1751 to a parameter or the return data type of that function).
1756 <entry><literal>dtd_identifier</literal></entry>
1757 <entry><type>sql_identifier</type></entry>
1759 The identifier of the data type descriptor, which is unique
1760 among the data type descriptors for that same object.
1768 <sect1 id="infoschema-domain-constraints">
1769 <title><literal>domain_constraints</literal></title>
1772 The view <literal>domain_constraints</literal> contains all
1773 constraints belonging to domains defined in the current database.
1777 <title><literal>domain_constraints</literal> Columns</title>
1783 <entry>Data Type</entry>
1784 <entry>Description</entry>
1790 <entry><literal>constraint_catalog</literal></entry>
1791 <entry><type>sql_identifier</type></entry>
1792 <entry>Name of the database that contains the constraint (always the current database)</entry>
1796 <entry><literal>constraint_schema</literal></entry>
1797 <entry><type>sql_identifier</type></entry>
1798 <entry>Name of the schema that contains the constraint</entry>
1802 <entry><literal>constraint_name</literal></entry>
1803 <entry><type>sql_identifier</type></entry>
1804 <entry>Name of the constraint</entry>
1808 <entry><literal>domain_catalog</literal></entry>
1809 <entry><type>sql_identifier</type></entry>
1810 <entry>Name of the database that contains the domain (always the current database)</entry>
1814 <entry><literal>domain_schema</literal></entry>
1815 <entry><type>sql_identifier</type></entry>
1816 <entry>Name of the schema that contains the domain</entry>
1820 <entry><literal>domain_name</literal></entry>
1821 <entry><type>sql_identifier</type></entry>
1822 <entry>Name of the domain</entry>
1826 <entry><literal>is_deferrable</literal></entry>
1827 <entry><type>yes_or_no</type></entry>
1828 <entry><literal>YES</literal> if the constraint is deferrable, <literal>NO</literal> if not</entry>
1832 <entry><literal>initially_deferred</literal></entry>
1833 <entry><type>yes_or_no</type></entry>
1834 <entry><literal>YES</literal> if the constraint is deferrable and initially deferred, <literal>NO</literal> if not</entry>
1841 <sect1 id="infoschema-domain-udt-usage">
1842 <title><literal>domain_udt_usage</literal></title>
1845 The view <literal>domain_udt_usage</literal> identifies all domains
1846 that are based on data types owned by a currently enabled role.
1847 Note that in <productname>PostgreSQL</productname>, built-in data
1848 types behave like user-defined types, so they are included here as
1853 <title><literal>domain_udt_usage</literal> Columns</title>
1859 <entry>Data Type</entry>
1860 <entry>Description</entry>
1866 <entry><literal>udt_catalog</literal></entry>
1867 <entry><type>sql_identifier</type></entry>
1868 <entry>Name of the database that the domain data type is defined in (always the current database)</entry>
1872 <entry><literal>udt_schema</literal></entry>
1873 <entry><type>sql_identifier</type></entry>
1874 <entry>Name of the schema that the domain data type is defined in</entry>
1878 <entry><literal>udt_name</literal></entry>
1879 <entry><type>sql_identifier</type></entry>
1880 <entry>Name of the domain data type</entry>
1884 <entry><literal>domain_catalog</literal></entry>
1885 <entry><type>sql_identifier</type></entry>
1886 <entry>Name of the database that contains the domain (always the current database)</entry>
1890 <entry><literal>domain_schema</literal></entry>
1891 <entry><type>sql_identifier</type></entry>
1892 <entry>Name of the schema that contains the domain</entry>
1896 <entry><literal>domain_name</literal></entry>
1897 <entry><type>sql_identifier</type></entry>
1898 <entry>Name of the domain</entry>
1905 <sect1 id="infoschema-domains">
1906 <title><literal>domains</literal></title>
1909 The view <literal>domains</literal> contains all domains defined in
1910 the current database.
1914 <title><literal>domains</literal> Columns</title>
1920 <entry>Data Type</entry>
1921 <entry>Description</entry>
1927 <entry><literal>domain_catalog</literal></entry>
1928 <entry><type>sql_identifier</type></entry>
1929 <entry>Name of the database that contains the domain (always the current database)</entry>
1933 <entry><literal>domain_schema</literal></entry>
1934 <entry><type>sql_identifier</type></entry>
1935 <entry>Name of the schema that contains the domain</entry>
1939 <entry><literal>domain_name</literal></entry>
1940 <entry><type>sql_identifier</type></entry>
1941 <entry>Name of the domain</entry>
1945 <entry><literal>data_type</literal></entry>
1946 <entry><type>character_data</type></entry>
1948 Data type of the domain, if it is a built-in type, or
1949 <literal>ARRAY</literal> if it is some array (in that case, see
1950 the view <literal>element_types</literal>), else
1951 <literal>USER-DEFINED</literal> (in that case, the type is
1952 identified in <literal>udt_name</literal> and associated
1958 <entry><literal>character_maximum_length</literal></entry>
1959 <entry><type>cardinal_number</type></entry>
1961 If the domain has a character or bit string type, the declared
1962 maximum length; null for all other data types or if no maximum
1963 length was declared.
1968 <entry><literal>character_octet_length</literal></entry>
1969 <entry><type>cardinal_number</type></entry>
1971 If the domain has a character type, the maximum possible length
1972 in octets (bytes) of a datum; null for all other data types.
1973 The maximum octet length depends on the declared character
1974 maximum length (see above) and the server encoding.
1979 <entry><literal>character_set_catalog</literal></entry>
1980 <entry><type>sql_identifier</type></entry>
1981 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1985 <entry><literal>character_set_schema</literal></entry>
1986 <entry><type>sql_identifier</type></entry>
1987 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1991 <entry><literal>character_set_name</literal></entry>
1992 <entry><type>sql_identifier</type></entry>
1993 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1997 <entry><literal>collation_catalog</literal></entry>
1998 <entry><type>sql_identifier</type></entry>
1999 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2003 <entry><literal>collation_schema</literal></entry>
2004 <entry><type>sql_identifier</type></entry>
2005 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2009 <entry><literal>collation_name</literal></entry>
2010 <entry><type>sql_identifier</type></entry>
2011 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2015 <entry><literal>numeric_precision</literal></entry>
2016 <entry><type>cardinal_number</type></entry>
2018 If the domain has a numeric type, this column contains the
2019 (declared or implicit) precision of the type for this domain.
2020 The precision indicates the number of significant digits. It
2021 can be expressed in decimal (base 10) or binary (base 2) terms,
2022 as specified in the column
2023 <literal>numeric_precision_radix</literal>. For all other data
2024 types, this column is null.
2029 <entry><literal>numeric_precision_radix</literal></entry>
2030 <entry><type>cardinal_number</type></entry>
2032 If the domain has a numeric type, this column indicates in
2033 which base the values in the columns
2034 <literal>numeric_precision</literal> and
2035 <literal>numeric_scale</literal> are expressed. The value is
2036 either 2 or 10. For all other data types, this column is null.
2041 <entry><literal>numeric_scale</literal></entry>
2042 <entry><type>cardinal_number</type></entry>
2044 If the domain has an exact numeric type, this column contains
2045 the (declared or implicit) scale of the type for this domain.
2046 The scale indicates the number of significant digits to the
2047 right of the decimal point. It can be expressed in decimal
2048 (base 10) or binary (base 2) terms, as specified in the column
2049 <literal>numeric_precision_radix</literal>. For all other data
2050 types, this column is null.
2055 <entry><literal>datetime_precision</literal></entry>
2056 <entry><type>cardinal_number</type></entry>
2058 If <literal>data_type</literal> identifies a date, time,
2059 timestamp, or interval type, this column contains the (declared
2060 or implicit) fractional seconds precision of the type for this
2061 domain, that is, the number of decimal digits maintained
2062 following the decimal point in the seconds value. For all
2063 other data types, this column is null.
2068 <entry><literal>interval_type</literal></entry>
2069 <entry><type>character_data</type></entry>
2070 <entry>Not yet implemented</entry>
2074 <entry><literal>interval_precision</literal></entry>
2075 <entry><type>character_data</type></entry>
2076 <entry>Not yet implemented</entry>
2080 <entry><literal>domain_default</literal></entry>
2081 <entry><type>character_data</type></entry>
2082 <entry>Default expression of the domain</entry>
2086 <entry><literal>udt_catalog</literal></entry>
2087 <entry><type>sql_identifier</type></entry>
2088 <entry>Name of the database that the domain data type is defined in (always the current database)</entry>
2092 <entry><literal>udt_schema</literal></entry>
2093 <entry><type>sql_identifier</type></entry>
2094 <entry>Name of the schema that the domain data type is defined in</entry>
2098 <entry><literal>udt_name</literal></entry>
2099 <entry><type>sql_identifier</type></entry>
2100 <entry>Name of the domain data type</entry>
2104 <entry><literal>scope_catalog</literal></entry>
2105 <entry><type>sql_identifier</type></entry>
2106 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2110 <entry><literal>scope_schema</literal></entry>
2111 <entry><type>sql_identifier</type></entry>
2112 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2116 <entry><literal>scope_name</literal></entry>
2117 <entry><type>sql_identifier</type></entry>
2118 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2122 <entry><literal>maximum_cardinality</literal></entry>
2123 <entry><type>cardinal_number</type></entry>
2124 <entry>Always null, because arrays always have unlimited maximum cardinality in <productname>PostgreSQL</></entry>
2128 <entry><literal>dtd_identifier</literal></entry>
2129 <entry><type>sql_identifier</type></entry>
2131 An identifier of the data type descriptor of the domain, unique
2132 among the data type descriptors pertaining to the domain (which
2133 is trivial, because a domain only contains one data type
2134 descriptor). This is mainly useful for joining with other
2135 instances of such identifiers. (The specific format of the
2136 identifier is not defined and not guaranteed to remain the same
2137 in future versions.)
2145 <sect1 id="infoschema-element-types">
2146 <title><literal>element_types</literal></title>
2149 The view <literal>element_types</literal> contains the data type
2150 descriptors of the elements of arrays. When a table column, composite-type attribute,
2151 domain, function parameter, or function return value is defined to
2152 be of an array type, the respective information schema view only
2153 contains <literal>ARRAY</literal> in the column
2154 <literal>data_type</literal>. To obtain information on the element
2155 type of the array, you can join the respective view with this view.
2156 For example, to show the columns of a table with data types and
2157 array element types, if applicable, you could do:
2159 SELECT c.column_name, c.data_type, e.data_type AS element_type
2160 FROM information_schema.columns c LEFT JOIN information_schema.element_types e
2161 ON ((c.table_catalog, c.table_schema, c.table_name, 'TABLE', c.dtd_identifier)
2162 = (e.object_catalog, e.object_schema, e.object_name, e.object_type, e.collection_type_identifier))
2163 WHERE c.table_schema = '...' AND c.table_name = '...'
2164 ORDER BY c.ordinal_position;
2166 This view only includes objects that the current user has access
2167 to, by way of being the owner or having some privilege.
2171 <title><literal>element_types</literal> Columns</title>
2177 <entry>Data Type</entry>
2178 <entry>Description</entry>
2184 <entry><literal>object_catalog</literal></entry>
2185 <entry><type>sql_identifier</type></entry>
2187 Name of the database that contains the object that uses the
2188 array being described (always the current database)
2193 <entry><literal>object_schema</literal></entry>
2194 <entry><type>sql_identifier</type></entry>
2196 Name of the schema that contains the object that uses the array
2202 <entry><literal>object_name</literal></entry>
2203 <entry><type>sql_identifier</type></entry>
2205 Name of the object that uses the array being described
2210 <entry><literal>object_type</literal></entry>
2211 <entry><type>character_data</type></entry>
2213 The type of the object that uses the array being described: one
2214 of <literal>TABLE</literal> (the array is used by a column of
2215 that table), <literal>USER-DEFINED TYPE</literal> (the array is
2216 used by an attribute of that composite type),
2217 <literal>DOMAIN</literal> (the array is used by that domain),
2218 <literal>ROUTINE</literal> (the array is used by a parameter or
2219 the return data type of that function).
2224 <entry><literal>collection_type_identifier</literal></entry>
2225 <entry><type>sql_identifier</type></entry>
2227 The identifier of the data type descriptor of the array being
2228 described. Use this to join with the
2229 <literal>dtd_identifier</literal> columns of other information
2235 <entry><literal>data_type</literal></entry>
2236 <entry><type>character_data</type></entry>
2238 Data type of the array elements, if it is a built-in type, else
2239 <literal>USER-DEFINED</literal> (in that case, the type is
2240 identified in <literal>udt_name</literal> and associated
2246 <entry><literal>character_maximum_length</literal></entry>
2247 <entry><type>cardinal_number</type></entry>
2248 <entry>Always null, since this information is not applied to array element data types in <productname>PostgreSQL</></entry>
2252 <entry><literal>character_octet_length</literal></entry>
2253 <entry><type>cardinal_number</type></entry>
2254 <entry>Always null, since this information is not applied to array element data types in <productname>PostgreSQL</></entry>
2258 <entry><literal>character_set_catalog</literal></entry>
2259 <entry><type>sql_identifier</type></entry>
2260 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2264 <entry><literal>character_set_schema</literal></entry>
2265 <entry><type>sql_identifier</type></entry>
2266 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2270 <entry><literal>character_set_name</literal></entry>
2271 <entry><type>sql_identifier</type></entry>
2272 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2276 <entry><literal>collation_catalog</literal></entry>
2277 <entry><type>sql_identifier</type></entry>
2278 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2282 <entry><literal>collation_schema</literal></entry>
2283 <entry><type>sql_identifier</type></entry>
2284 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2288 <entry><literal>collation_name</literal></entry>
2289 <entry><type>sql_identifier</type></entry>
2290 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2294 <entry><literal>numeric_precision</literal></entry>
2295 <entry><type>cardinal_number</type></entry>
2296 <entry>Always null, since this information is not applied to array element data types in <productname>PostgreSQL</></entry>
2300 <entry><literal>numeric_precision_radix</literal></entry>
2301 <entry><type>cardinal_number</type></entry>
2302 <entry>Always null, since this information is not applied to array element data types in <productname>PostgreSQL</></entry>
2306 <entry><literal>numeric_scale</literal></entry>
2307 <entry><type>cardinal_number</type></entry>
2308 <entry>Always null, since this information is not applied to array element data types in <productname>PostgreSQL</></entry>
2312 <entry><literal>datetime_precision</literal></entry>
2313 <entry><type>cardinal_number</type></entry>
2314 <entry>Always null, since this information is not applied to array element data types in <productname>PostgreSQL</></entry>
2318 <entry><literal>interval_type</literal></entry>
2319 <entry><type>character_data</type></entry>
2320 <entry>Always null, since this information is not applied to array element data types in <productname>PostgreSQL</></entry>
2324 <entry><literal>interval_precision</literal></entry>
2325 <entry><type>character_data</type></entry>
2326 <entry>Always null, since this information is not applied to array element data types in <productname>PostgreSQL</></entry>
2330 <entry><literal>domain_default</literal></entry>
2331 <entry><type>character_data</type></entry>
2332 <entry>Not yet implemented</entry>
2336 <entry><literal>udt_catalog</literal></entry>
2337 <entry><type>sql_identifier</type></entry>
2339 Name of the database that the data type of the elements is
2340 defined in (always the current database)
2345 <entry><literal>udt_schema</literal></entry>
2346 <entry><type>sql_identifier</type></entry>
2348 Name of the schema that the data type of the elements is
2354 <entry><literal>udt_name</literal></entry>
2355 <entry><type>sql_identifier</type></entry>
2357 Name of the data type of the elements
2362 <entry><literal>scope_catalog</literal></entry>
2363 <entry><type>sql_identifier</type></entry>
2364 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2368 <entry><literal>scope_schema</literal></entry>
2369 <entry><type>sql_identifier</type></entry>
2370 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2374 <entry><literal>scope_name</literal></entry>
2375 <entry><type>sql_identifier</type></entry>
2376 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2380 <entry><literal>maximum_cardinality</literal></entry>
2381 <entry><type>cardinal_number</type></entry>
2382 <entry>Always null, because arrays always have unlimited maximum cardinality in <productname>PostgreSQL</></entry>
2386 <entry><literal>dtd_identifier</literal></entry>
2387 <entry><type>sql_identifier</type></entry>
2389 An identifier of the data type descriptor of the element. This
2390 is currently not useful.
2398 <sect1 id="infoschema-enabled-roles">
2399 <title><literal>enabled_roles</literal></title>
2402 The view <literal>enabled_roles</literal> identifies the currently
2403 <quote>enabled roles</quote>. The enabled roles are recursively
2404 defined as the current user together with all roles that have been
2405 granted to the enabled roles with automatic inheritance. In other
2406 words, these are all roles that the current user has direct or
2407 indirect, automatically inheriting membership in.
2408 <indexterm><primary>enabled role</primary></indexterm>
2409 <indexterm><primary>role</primary><secondary>enabled</secondary></indexterm>
2413 For permission checking, the set of <quote>applicable roles</quote>
2414 is applied, which can be broader than the set of enabled roles. So
2415 generally, it is better to use the view
2416 <literal>applicable_roles</literal> instead of this one; see also
2421 <title><literal>enabled_roles</literal> Columns</title>
2427 <entry>Data Type</entry>
2428 <entry>Description</entry>
2434 <entry><literal>role_name</literal></entry>
2435 <entry><type>sql_identifier</type></entry>
2436 <entry>Name of a role</entry>
2443 <sect1 id="infoschema-foreign-data-wrapper-options">
2444 <title><literal>foreign_data_wrapper_options</literal></title>
2447 The view <literal>foreign_data_wrapper_options</literal> contains
2448 all the options defined for foreign-data wrappers in the current
2449 database. Only those foreign-data wrappers are shown that the
2450 current user has access to (by way of being the owner or having
2455 <title><literal>foreign_data_wrapper_options</literal> Columns</title>
2461 <entry>Data Type</entry>
2462 <entry>Description</entry>
2468 <entry><literal>foreign_data_wrapper_catalog</literal></entry>
2469 <entry><type>sql_identifier</type></entry>
2470 <entry>Name of the database that the foreign-data wrapper is defined in (always the current database)</entry>
2474 <entry><literal>foreign_data_wrapper_name</literal></entry>
2475 <entry><type>sql_identifier</type></entry>
2476 <entry>Name of the foreign-data wrapper</entry>
2480 <entry><literal>option_name</literal></entry>
2481 <entry><type>sql_identifier</type></entry>
2482 <entry>Name of an option</entry>
2486 <entry><literal>option_value</literal></entry>
2487 <entry><type>character_data</type></entry>
2488 <entry>Value of the option</entry>
2495 <sect1 id="infoschema-foreign-data-wrappers">
2496 <title><literal>foreign_data_wrappers</literal></title>
2499 The view <literal>foreign_data_wrappers</literal> contains all
2500 foreign-data wrappers defined in the current database. Only those
2501 foreign-data wrappers are shown that the current user has access to
2502 (by way of being the owner or having some privilege).
2506 <title><literal>foreign_data_wrappers</literal> Columns</title>
2512 <entry>Data Type</entry>
2513 <entry>Description</entry>
2519 <entry><literal>foreign_data_wrapper_catalog</literal></entry>
2520 <entry><type>sql_identifier</type></entry>
2521 <entry>Name of the database that contains the foreign-data
2522 wrapper (always the current database)</entry>
2526 <entry><literal>foreign_data_wrapper_name</literal></entry>
2527 <entry><type>sql_identifier</type></entry>
2528 <entry>Name of the foreign-data wrapper</entry>
2532 <entry><literal>authorization_identifier</literal></entry>
2533 <entry><type>sql_identifier</type></entry>
2534 <entry>Name of the owner of the foreign server</entry>
2538 <entry><literal>library_name</literal></entry>
2539 <entry><type>character_data</type></entry>
2540 <entry>File name of the library that implementing this foreign-data wrapper</entry>
2544 <entry><literal>foreign_data_wrapper_language</literal></entry>
2545 <entry><type>character_data</type></entry>
2546 <entry>Language used to implement this foreign-data wrapper</entry>
2553 <sect1 id="infoschema-foreign-server-options">
2554 <title><literal>foreign_server_options</literal></title>
2557 The view <literal>foreign_server_options</literal> contains all the
2558 options defined for foreign servers in the current database. Only
2559 those foreign servers are shown that the current user has access to
2560 (by way of being the owner or having some privilege).
2564 <title><literal>foreign_server_options</literal> Columns</title>
2570 <entry>Data Type</entry>
2571 <entry>Description</entry>
2577 <entry><literal>foreign_server_catalog</literal></entry>
2578 <entry><type>sql_identifier</type></entry>
2579 <entry>Name of the database that the foreign server is defined in (always the current database)</entry>
2583 <entry><literal>foreign_server_name</literal></entry>
2584 <entry><type>sql_identifier</type></entry>
2585 <entry>Name of the foreign server</entry>
2589 <entry><literal>option_name</literal></entry>
2590 <entry><type>sql_identifier</type></entry>
2591 <entry>Name of an option</entry>
2595 <entry><literal>option_value</literal></entry>
2596 <entry><type>character_data</type></entry>
2597 <entry>Value of the option</entry>
2604 <sect1 id="infoschema-foreign-servers">
2605 <title><literal>foreign_servers</literal></title>
2608 The view <literal>foreign_servers</literal> contains all foreign
2609 servers defined in the current database. Only those foreign
2610 servers are shown that the current user has access to (by way of
2611 being the owner or having some privilege).
2615 <title><literal>foreign_servers</literal> Columns</title>
2621 <entry>Data Type</entry>
2622 <entry>Description</entry>
2628 <entry><literal>foreign_server_catalog</literal></entry>
2629 <entry><type>sql_identifier</type></entry>
2630 <entry>Name of the database that the foreign server is defined in (always the current database)</entry>
2634 <entry><literal>foreign_server_name</literal></entry>
2635 <entry><type>sql_identifier</type></entry>
2636 <entry>Name of the foreign server</entry>
2640 <entry><literal>foreign_data_wrapper_catalog</literal></entry>
2641 <entry><type>sql_identifier</type></entry>
2642 <entry>Name of the database that contains the foreign-data
2643 wrapper used by the foreign server (always the current database)</entry>
2647 <entry><literal>foreign_data_wrapper_name</literal></entry>
2648 <entry><type>sql_identifier</type></entry>
2649 <entry>Name of the foreign-data wrapper used by the foreign server</entry>
2653 <entry><literal>foreign_server_type</literal></entry>
2654 <entry><type>character_data</type></entry>
2655 <entry>Foreign server type information, if specified upon creation</entry>
2659 <entry><literal>foreign_server_version</literal></entry>
2660 <entry><type>character_data</type></entry>
2661 <entry>Foreign server version information, if specified upon creation</entry>
2665 <entry><literal>authorization_identifier</literal></entry>
2666 <entry><type>sql_identifier</type></entry>
2667 <entry>Name of the owner of the foreign server</entry>
2674 <sect1 id="infoschema-foreign-table-options">
2675 <title><literal>foreign_table_options</literal></title>
2678 The view <literal>foreign_table_options</literal> contains all the
2679 options defined for foreign tables in the current database. Only
2680 those foreign tables are shown that the current user has access to
2681 (by way of being the owner or having some privilege).
2685 <title><literal>foreign_table_options</literal> Columns</title>
2691 <entry>Data Type</entry>
2692 <entry>Description</entry>
2698 <entry><literal>foreign_table_catalog</literal></entry>
2699 <entry><type>sql_identifier</type></entry>
2700 <entry>Name of the database that contains the foreign table (always the current database)</entry>
2704 <entry><literal>foreign_table_schema</literal></entry>
2705 <entry><type>sql_identifier</type></entry>
2706 <entry>Name of the schema that contains the foreign table</entry>
2710 <entry><literal>foreign_table_name</literal></entry>
2711 <entry><type>sql_identifier</type></entry>
2712 <entry>Name of the foreign table</entry>
2716 <entry><literal>foreign_server_catalog</literal></entry>
2717 <entry><type>sql_identifier</type></entry>
2718 <entry>Name of the database that the foreign server is defined in (always the current database)</entry>
2722 <entry><literal>foreign_server_name</literal></entry>
2723 <entry><type>sql_identifier</type></entry>
2724 <entry>Name of the foreign server</entry>
2728 <entry><literal>option_name</literal></entry>
2729 <entry><type>sql_identifier</type></entry>
2730 <entry>Name of an option</entry>
2734 <entry><literal>option_value</literal></entry>
2735 <entry><type>character_data</type></entry>
2736 <entry>Value of the option</entry>
2743 <sect1 id="infoschema-foreign-tables">
2744 <title><literal>foreign_tables</literal></title>
2747 The view <literal>foreign_tables</literal> contains all foreign
2748 tables defined in the current database. Only those foreign
2749 tables are shown that the current user has access to (by way of
2750 being the owner or having some privilege).
2754 <title><literal>foreign_tables</literal> Columns</title>
2760 <entry>Data Type</entry>
2761 <entry>Description</entry>
2767 <entry><literal>foreign_table_catalog</literal></entry>
2768 <entry><type>sql_identifier</type></entry>
2769 <entry>Name of the database that the foreign table is defined in (always the current database)</entry>
2773 <entry><literal>foreign_table_schema</literal></entry>
2774 <entry><type>sql_identifier</type></entry>
2775 <entry>Name of the schema that contains the foreign table</entry>
2779 <entry><literal>foreign_table_name</literal></entry>
2780 <entry><type>sql_identifier</type></entry>
2781 <entry>Name of the foreign table</entry>
2785 <entry><literal>foreign_server_catalog</literal></entry>
2786 <entry><type>sql_identifier</type></entry>
2787 <entry>Name of the database that the foreign server is defined in (always the current database)</entry>
2791 <entry><literal>foreign_server_name</literal></entry>
2792 <entry><type>sql_identifier</type></entry>
2793 <entry>Name of the foreign server</entry>
2800 <sect1 id="infoschema-key-column-usage">
2801 <title><literal>key_column_usage</literal></title>
2804 The view <literal>key_column_usage</literal> identifies all columns
2805 in the current database that are restricted by some unique, primary
2806 key, or foreign key constraint. Check constraints are not included
2807 in this view. Only those columns are shown that the current user
2808 has access to, by way of being the owner or having some privilege.
2812 <title><literal>key_column_usage</literal> Columns</title>
2818 <entry>Data Type</entry>
2819 <entry>Description</entry>
2825 <entry><literal>constraint_catalog</literal></entry>
2826 <entry><type>sql_identifier</type></entry>
2827 <entry>Name of the database that contains the constraint (always the current database)</entry>
2831 <entry><literal>constraint_schema</literal></entry>
2832 <entry><type>sql_identifier</type></entry>
2833 <entry>Name of the schema that contains the constraint</entry>
2837 <entry><literal>constraint_name</literal></entry>
2838 <entry><type>sql_identifier</type></entry>
2839 <entry>Name of the constraint</entry>
2843 <entry><literal>table_catalog</literal></entry>
2844 <entry><type>sql_identifier</type></entry>
2846 Name of the database that contains the table that contains the
2847 column that is restricted by this constraint (always the
2853 <entry><literal>table_schema</literal></entry>
2854 <entry><type>sql_identifier</type></entry>
2856 Name of the schema that contains the table that contains the
2857 column that is restricted by this constraint
2862 <entry><literal>table_name</literal></entry>
2863 <entry><type>sql_identifier</type></entry>
2865 Name of the table that contains the column that is restricted
2871 <entry><literal>column_name</literal></entry>
2872 <entry><type>sql_identifier</type></entry>
2874 Name of the column that is restricted by this constraint
2879 <entry><literal>ordinal_position</literal></entry>
2880 <entry><type>cardinal_number</type></entry>
2882 Ordinal position of the column within the constraint key (count
2888 <entry><literal>position_in_unique_constraint</literal></entry>
2889 <entry><type>cardinal_number</type></entry>
2891 For a foreign-key constraint, ordinal position of the referenced
2892 column within its unique constraint (count starts at 1);
2901 <sect1 id="infoschema-parameters">
2902 <title><literal>parameters</literal></title>
2905 The view <literal>parameters</literal> contains information about
2906 the parameters (arguments) of all functions in the current database.
2907 Only those functions are shown that the current user has access to
2908 (by way of being the owner or having some privilege).
2912 <title><literal>parameters</literal> Columns</title>
2918 <entry>Data Type</entry>
2919 <entry>Description</entry>
2925 <entry><literal>specific_catalog</literal></entry>
2926 <entry><type>sql_identifier</type></entry>
2927 <entry>Name of the database containing the function (always the current database)</entry>
2931 <entry><literal>specific_schema</literal></entry>
2932 <entry><type>sql_identifier</type></entry>
2933 <entry>Name of the schema containing the function</entry>
2937 <entry><literal>specific_name</literal></entry>
2938 <entry><type>sql_identifier</type></entry>
2940 The <quote>specific name</quote> of the function. See <xref
2941 linkend="infoschema-routines"> for more information.
2946 <entry><literal>ordinal_position</literal></entry>
2947 <entry><type>cardinal_number</type></entry>
2949 Ordinal position of the parameter in the argument list of the
2950 function (count starts at 1)
2955 <entry><literal>parameter_mode</literal></entry>
2956 <entry><type>character_data</type></entry>
2958 <literal>IN</literal> for input parameter,
2959 <literal>OUT</literal> for output parameter,
2960 and <literal>INOUT</literal> for input/output parameter.
2965 <entry><literal>is_result</literal></entry>
2966 <entry><type>yes_or_no</type></entry>
2967 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2971 <entry><literal>as_locator</literal></entry>
2972 <entry><type>yes_or_no</type></entry>
2973 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2977 <entry><literal>parameter_name</literal></entry>
2978 <entry><type>sql_identifier</type></entry>
2979 <entry>Name of the parameter, or null if the parameter has no name</entry>
2983 <entry><literal>data_type</literal></entry>
2984 <entry><type>character_data</type></entry>
2986 Data type of the parameter, if it is a built-in type, or
2987 <literal>ARRAY</literal> if it is some array (in that case, see
2988 the view <literal>element_types</literal>), else
2989 <literal>USER-DEFINED</literal> (in that case, the type is
2990 identified in <literal>udt_name</literal> and associated
2996 <entry><literal>character_maximum_length</literal></entry>
2997 <entry><type>cardinal_number</type></entry>
2998 <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</></entry>
3002 <entry><literal>character_octet_length</literal></entry>
3003 <entry><type>cardinal_number</type></entry>
3004 <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</></entry>
3008 <entry><literal>character_set_catalog</literal></entry>
3009 <entry><type>sql_identifier</type></entry>
3010 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3014 <entry><literal>character_set_schema</literal></entry>
3015 <entry><type>sql_identifier</type></entry>
3016 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3020 <entry><literal>character_set_name</literal></entry>
3021 <entry><type>sql_identifier</type></entry>
3022 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3026 <entry><literal>collation_catalog</literal></entry>
3027 <entry><type>sql_identifier</type></entry>
3028 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3032 <entry><literal>collation_schema</literal></entry>
3033 <entry><type>sql_identifier</type></entry>
3034 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3038 <entry><literal>collation_name</literal></entry>
3039 <entry><type>sql_identifier</type></entry>
3040 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3044 <entry><literal>numeric_precision</literal></entry>
3045 <entry><type>cardinal_number</type></entry>
3046 <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</></entry>
3050 <entry><literal>numeric_precision_radix</literal></entry>
3051 <entry><type>cardinal_number</type></entry>
3052 <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</></entry>
3056 <entry><literal>numeric_scale</literal></entry>
3057 <entry><type>cardinal_number</type></entry>
3058 <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</></entry>
3062 <entry><literal>datetime_precision</literal></entry>
3063 <entry><type>cardinal_number</type></entry>
3064 <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</></entry>
3068 <entry><literal>interval_type</literal></entry>
3069 <entry><type>character_data</type></entry>
3070 <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</></entry>
3074 <entry><literal>interval_precision</literal></entry>
3075 <entry><type>character_data</type></entry>
3076 <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</></entry>
3080 <entry><literal>udt_catalog</literal></entry>
3081 <entry><type>sql_identifier</type></entry>
3083 Name of the database that the data type of the parameter is
3084 defined in (always the current database)
3089 <entry><literal>udt_schema</literal></entry>
3090 <entry><type>sql_identifier</type></entry>
3092 Name of the schema that the data type of the parameter is
3098 <entry><literal>udt_name</literal></entry>
3099 <entry><type>sql_identifier</type></entry>
3101 Name of the data type of the parameter
3106 <entry><literal>scope_catalog</literal></entry>
3107 <entry><type>sql_identifier</type></entry>
3108 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3112 <entry><literal>scope_schema</literal></entry>
3113 <entry><type>sql_identifier</type></entry>
3114 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3118 <entry><literal>scope_name</literal></entry>
3119 <entry><type>sql_identifier</type></entry>
3120 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3124 <entry><literal>maximum_cardinality</literal></entry>
3125 <entry><type>cardinal_number</type></entry>
3126 <entry>Always null, because arrays always have unlimited maximum cardinality in <productname>PostgreSQL</></entry>
3130 <entry><literal>dtd_identifier</literal></entry>
3131 <entry><type>sql_identifier</type></entry>
3133 An identifier of the data type descriptor of the parameter,
3134 unique among the data type descriptors pertaining to the
3135 function. This is mainly useful for joining with other
3136 instances of such identifiers. (The specific format of the
3137 identifier is not defined and not guaranteed to remain the same
3138 in future versions.)
3146 <sect1 id="infoschema-referential-constraints">
3147 <title><literal>referential_constraints</literal></title>
3150 The view <literal>referential_constraints</literal> contains all
3151 referential (foreign key) constraints in the current database.
3152 Only those constraints are shown for which the current user has
3153 write access to the referencing table (by way of being the
3154 owner or having some privilege other than SELECT).
3158 <title><literal>referential_constraints</literal> Columns</title>
3164 <entry>Data Type</entry>
3165 <entry>Description</entry>
3171 <entry><literal>constraint_catalog</literal></entry>
3172 <entry><literal>sql_identifier</literal></entry>
3173 <entry>Name of the database containing the constraint (always the current database)</entry>
3177 <entry><literal>constraint_schema</literal></entry>
3178 <entry><literal>sql_identifier</literal></entry>
3179 <entry>Name of the schema containing the constraint</entry>
3183 <entry><literal>constraint_name</literal></entry>
3184 <entry><literal>sql_identifier</literal></entry>
3185 <entry>Name of the constraint</entry>
3189 <entry><literal>unique_constraint_catalog</literal></entry>
3190 <entry><literal>sql_identifier</literal></entry>
3192 Name of the database that contains the unique or primary key
3193 constraint that the foreign key constraint references (always
3194 the current database)
3199 <entry><literal>unique_constraint_schema</literal></entry>
3200 <entry><literal>sql_identifier</literal></entry>
3202 Name of the schema that contains the unique or primary key
3203 constraint that the foreign key constraint references
3208 <entry><literal>unique_constraint_name</literal></entry>
3209 <entry><literal>sql_identifier</literal></entry>
3211 Name of the unique or primary key constraint that the foreign
3212 key constraint references
3217 <entry><literal>match_option</literal></entry>
3218 <entry><literal>character_data</literal></entry>
3220 Match option of the foreign key constraint:
3221 <literal>FULL</literal>, <literal>PARTIAL</literal>, or
3222 <literal>NONE</literal>.
3227 <entry><literal>update_rule</literal></entry>
3228 <entry><literal>character_data</literal></entry>
3230 Update rule of the foreign key constraint:
3231 <literal>CASCADE</literal>, <literal>SET NULL</literal>,
3232 <literal>SET DEFAULT</literal>, <literal>RESTRICT</literal>, or
3233 <literal>NO ACTION</literal>.
3238 <entry><literal>delete_rule</literal></entry>
3239 <entry><literal>character_data</literal></entry>
3241 Delete rule of the foreign key constraint:
3242 <literal>CASCADE</literal>, <literal>SET NULL</literal>,
3243 <literal>SET DEFAULT</literal>, <literal>RESTRICT</literal>, or
3244 <literal>NO ACTION</literal>.
3253 <sect1 id="infoschema-role-column-grants">
3254 <title><literal>role_column_grants</literal></title>
3257 The view <literal>role_column_grants</literal> identifies all
3258 privileges granted on columns where the grantor or grantee is a
3259 currently enabled role. Further information can be found under
3260 <literal>column_privileges</literal>. The only effective
3261 difference between this view
3262 and <literal>column_privileges</literal> is that this view omits
3263 columns that have been made accessible to the current user by way
3264 of a grant to <literal>PUBLIC</literal>.
3268 <title><literal>role_column_grants</literal> Columns</title>
3274 <entry>Data Type</entry>
3275 <entry>Description</entry>
3281 <entry><literal>grantor</literal></entry>
3282 <entry><type>sql_identifier</type></entry>
3283 <entry>Name of the role that granted the privilege</entry>
3287 <entry><literal>grantee</literal></entry>
3288 <entry><type>sql_identifier</type></entry>
3289 <entry>Name of the role that the privilege was granted to</entry>
3293 <entry><literal>table_catalog</literal></entry>
3294 <entry><type>sql_identifier</type></entry>
3295 <entry>Name of the database that contains the table that contains the column (always the current database)</entry>
3299 <entry><literal>table_schema</literal></entry>
3300 <entry><type>sql_identifier</type></entry>
3301 <entry>Name of the schema that contains the table that contains the column</entry>
3305 <entry><literal>table_name</literal></entry>
3306 <entry><type>sql_identifier</type></entry>
3307 <entry>Name of the table that contains the column</entry>
3311 <entry><literal>column_name</literal></entry>
3312 <entry><type>sql_identifier</type></entry>
3313 <entry>Name of the column</entry>
3317 <entry><literal>privilege_type</literal></entry>
3318 <entry><type>character_data</type></entry>
3320 Type of the privilege: <literal>SELECT</literal>,
3321 <literal>INSERT</literal>, <literal>UPDATE</literal>, or
3322 <literal>REFERENCES</literal>
3327 <entry><literal>is_grantable</literal></entry>
3328 <entry><type>yes_or_no</type></entry>
3329 <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
3336 <sect1 id="infoschema-role-routine-grants">
3337 <title><literal>role_routine_grants</literal></title>
3340 The view <literal>role_routine_grants</literal> identifies all
3341 privileges granted on functions where the grantor or grantee is a
3342 currently enabled role. Further information can be found under
3343 <literal>routine_privileges</literal>. The only effective
3344 difference between this view
3345 and <literal>routine_privileges</literal> is that this view omits
3346 functions that have been made accessible to the current user by way
3347 of a grant to <literal>PUBLIC</literal>.
3351 <title><literal>role_routine_grants</literal> Columns</title>
3357 <entry>Data Type</entry>
3358 <entry>Description</entry>
3364 <entry><literal>grantor</literal></entry>
3365 <entry><type>sql_identifier</type></entry>
3366 <entry>Name of the role that granted the privilege</entry>
3370 <entry><literal>grantee</literal></entry>
3371 <entry><type>sql_identifier</type></entry>
3372 <entry>Name of the role that the privilege was granted to</entry>
3376 <entry><literal>specific_catalog</literal></entry>
3377 <entry><type>sql_identifier</type></entry>
3378 <entry>Name of the database containing the function (always the current database)</entry>
3382 <entry><literal>specific_schema</literal></entry>
3383 <entry><type>sql_identifier</type></entry>
3384 <entry>Name of the schema containing the function</entry>
3388 <entry><literal>specific_name</literal></entry>
3389 <entry><type>sql_identifier</type></entry>
3391 The <quote>specific name</quote> of the function. See <xref
3392 linkend="infoschema-routines"> for more information.
3397 <entry><literal>routine_catalog</literal></entry>
3398 <entry><type>sql_identifier</type></entry>
3399 <entry>Name of the database containing the function (always the current database)</entry>
3403 <entry><literal>routine_schema</literal></entry>
3404 <entry><type>sql_identifier</type></entry>
3405 <entry>Name of the schema containing the function</entry>
3409 <entry><literal>routine_name</literal></entry>
3410 <entry><type>sql_identifier</type></entry>
3411 <entry>Name of the function (might be duplicated in case of overloading)</entry>
3415 <entry><literal>privilege_type</literal></entry>
3416 <entry><type>character_data</type></entry>
3417 <entry>Always <literal>EXECUTE</literal> (the only privilege type for functions)</entry>
3421 <entry><literal>is_grantable</literal></entry>
3422 <entry><type>yes_or_no</type></entry>
3423 <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
3430 <sect1 id="infoschema-role-table-grants">
3431 <title><literal>role_table_grants</literal></title>
3434 The view <literal>role_table_grants</literal> identifies all
3435 privileges granted on tables or views where the grantor or grantee
3436 is a currently enabled role. Further information can be found
3437 under <literal>table_privileges</literal>. The only effective
3438 difference between this view
3439 and <literal>table_privileges</literal> is that this view omits
3440 tables that have been made accessible to the current user by way of
3441 a grant to <literal>PUBLIC</literal>.
3445 <title><literal>role_table_grants</literal> Columns</title>
3451 <entry>Data Type</entry>
3452 <entry>Description</entry>
3458 <entry><literal>grantor</literal></entry>
3459 <entry><type>sql_identifier</type></entry>
3460 <entry>Name of the role that granted the privilege</entry>
3464 <entry><literal>grantee</literal></entry>
3465 <entry><type>sql_identifier</type></entry>
3466 <entry>Name of the role that the privilege was granted to</entry>
3470 <entry><literal>table_catalog</literal></entry>
3471 <entry><type>sql_identifier</type></entry>
3472 <entry>Name of the database that contains the table (always the current database)</entry>
3476 <entry><literal>table_schema</literal></entry>
3477 <entry><type>sql_identifier</type></entry>
3478 <entry>Name of the schema that contains the table</entry>
3482 <entry><literal>table_name</literal></entry>
3483 <entry><type>sql_identifier</type></entry>
3484 <entry>Name of the table</entry>
3488 <entry><literal>privilege_type</literal></entry>
3489 <entry><type>character_data</type></entry>
3491 Type of the privilege: <literal>SELECT</literal>,
3492 <literal>INSERT</literal>, <literal>UPDATE</literal>,
3493 <literal>DELETE</literal>, <literal>TRUNCATE</literal>,
3494 <literal>REFERENCES</literal>, or <literal>TRIGGER</literal>
3499 <entry><literal>is_grantable</literal></entry>
3500 <entry><type>yes_or_no</type></entry>
3501 <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
3505 <entry><literal>with_hierarchy</literal></entry>
3506 <entry><type>yes_or_no</type></entry>
3507 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3514 <sect1 id="infoschema-role-udt-grants">
3515 <title><literal>role_udt_grants</literal></title>
3518 The view <literal>role_udt_grants</literal> is intended to identify
3519 <literal>USAGE</literal> privileges granted on user-defined types
3520 where the grantor or grantee is a currently enabled role. Further
3521 information can be found under
3522 <literal>udt_privileges</literal>. The only effective difference
3523 between this view and <literal>udt_privileges</literal> is that
3524 this view omits objects that have been made accessible to the
3525 current user by way of a grant to <literal>PUBLIC</literal>. Since
3526 data types do not have real privileges in PostgreSQL, but only an
3527 implicit grant to <literal>PUBLIC</literal>, this view is empty.
3531 <title><literal>role_udt_grants</literal> Columns</title>
3537 <entry>Data Type</entry>
3538 <entry>Description</entry>
3544 <entry><literal>grantor</literal></entry>
3545 <entry><type>sql_identifier</type></entry>
3546 <entry>The name of the role that granted the privilege</entry>
3550 <entry><literal>grantee</literal></entry>
3551 <entry><type>sql_identifier</type></entry>
3552 <entry>The name of the role that the privilege was granted to</entry>
3556 <entry><literal>udt_catalog</literal></entry>
3557 <entry><type>sql_identifier</type></entry>
3558 <entry>Name of the database containing the type (always the current database)</entry>
3562 <entry><literal>udt_schema</literal></entry>
3563 <entry><type>sql_identifier</type></entry>
3564 <entry>Name of the schema containing the type</entry>
3568 <entry><literal>udt_name</literal></entry>
3569 <entry><type>sql_identifier</type></entry>
3570 <entry>Name of the type</entry>
3574 <entry><literal>privilege_type</literal></entry>
3575 <entry><type>character_data</type></entry>
3576 <entry>Always <literal>TYPE USAGE</literal></entry>
3580 <entry><literal>is_grantable</literal></entry>
3581 <entry><type>yes_or_no</type></entry>
3582 <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
3589 <sect1 id="infoschema-role-usage-grants">
3590 <title><literal>role_usage_grants</literal></title>
3593 The view <literal>role_usage_grants</literal> identifies
3594 <literal>USAGE</literal> privileges granted on various kinds of
3595 objects where the grantor or grantee is a currently enabled role.
3596 Further information can be found under
3597 <literal>usage_privileges</literal>. The only effective difference
3598 between this view and <literal>usage_privileges</literal> is that
3599 this view omits objects that have been made accessible to the
3600 current user by way of a grant to <literal>PUBLIC</literal>.
3604 <title><literal>role_usage_grants</literal> Columns</title>
3610 <entry>Data Type</entry>
3611 <entry>Description</entry>
3617 <entry><literal>grantor</literal></entry>
3618 <entry><type>sql_identifier</type></entry>
3619 <entry>The name of the role that granted the privilege</entry>
3623 <entry><literal>grantee</literal></entry>
3624 <entry><type>sql_identifier</type></entry>
3625 <entry>The name of the role that the privilege was granted to</entry>
3629 <entry><literal>object_catalog</literal></entry>
3630 <entry><type>sql_identifier</type></entry>
3631 <entry>Name of the database containing the object (always the current database)</entry>
3635 <entry><literal>object_schema</literal></entry>
3636 <entry><type>sql_identifier</type></entry>
3637 <entry>Name of the schema containing the object, if applicable,
3638 else an empty string</entry>
3642 <entry><literal>object_name</literal></entry>
3643 <entry><type>sql_identifier</type></entry>
3644 <entry>Name of the object</entry>
3648 <entry><literal>object_type</literal></entry>
3649 <entry><type>character_data</type></entry>
3650 <entry><literal>COLLATION</literal> or <literal>DOMAIN</literal> or <literal>FOREIGN DATA WRAPPER</literal> or <literal>FOREIGN SERVER</literal></entry>
3654 <entry><literal>privilege_type</literal></entry>
3655 <entry><type>character_data</type></entry>
3656 <entry>Always <literal>USAGE</literal></entry>
3660 <entry><literal>is_grantable</literal></entry>
3661 <entry><type>yes_or_no</type></entry>
3662 <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
3669 <sect1 id="infoschema-routine-privileges">
3670 <title><literal>routine_privileges</literal></title>
3673 The view <literal>routine_privileges</literal> identifies all
3674 privileges granted on functions to a currently enabled role or by a
3675 currently enabled role. There is one row for each combination of function,
3676 grantor, and grantee.
3680 <title><literal>routine_privileges</literal> Columns</title>
3686 <entry>Data Type</entry>
3687 <entry>Description</entry>
3693 <entry><literal>grantor</literal></entry>
3694 <entry><type>sql_identifier</type></entry>
3695 <entry>Name of the role that granted the privilege</entry>
3699 <entry><literal>grantee</literal></entry>
3700 <entry><type>sql_identifier</type></entry>
3701 <entry>Name of the role that the privilege was granted to</entry>
3705 <entry><literal>specific_catalog</literal></entry>
3706 <entry><type>sql_identifier</type></entry>
3707 <entry>Name of the database containing the function (always the current database)</entry>
3711 <entry><literal>specific_schema</literal></entry>
3712 <entry><type>sql_identifier</type></entry>
3713 <entry>Name of the schema containing the function</entry>
3717 <entry><literal>specific_name</literal></entry>
3718 <entry><type>sql_identifier</type></entry>
3720 The <quote>specific name</quote> of the function. See <xref
3721 linkend="infoschema-routines"> for more information.
3726 <entry><literal>routine_catalog</literal></entry>
3727 <entry><type>sql_identifier</type></entry>
3728 <entry>Name of the database containing the function (always the current database)</entry>
3732 <entry><literal>routine_schema</literal></entry>
3733 <entry><type>sql_identifier</type></entry>
3734 <entry>Name of the schema containing the function</entry>
3738 <entry><literal>routine_name</literal></entry>
3739 <entry><type>sql_identifier</type></entry>
3740 <entry>Name of the function (might be duplicated in case of overloading)</entry>
3744 <entry><literal>privilege_type</literal></entry>
3745 <entry><type>character_data</type></entry>
3746 <entry>Always <literal>EXECUTE</literal> (the only privilege type for functions)</entry>
3750 <entry><literal>is_grantable</literal></entry>
3751 <entry><type>yes_or_no</type></entry>
3752 <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
3759 <sect1 id="infoschema-routines">
3760 <title><literal>routines</literal></title>
3763 The view <literal>routines</literal> contains all functions in the
3764 current database. Only those functions are shown that the current
3765 user has access to (by way of being the owner or having some
3770 <title><literal>routines</literal> Columns</title>
3776 <entry>Data Type</entry>
3777 <entry>Description</entry>
3783 <entry><literal>specific_catalog</literal></entry>
3784 <entry><type>sql_identifier</type></entry>
3785 <entry>Name of the database containing the function (always the current database)</entry>
3789 <entry><literal>specific_schema</literal></entry>
3790 <entry><type>sql_identifier</type></entry>
3791 <entry>Name of the schema containing the function</entry>
3795 <entry><literal>specific_name</literal></entry>
3796 <entry><type>sql_identifier</type></entry>
3798 The <quote>specific name</quote> of the function. This is a
3799 name that uniquely identifies the function in the schema, even
3800 if the real name of the function is overloaded. The format of
3801 the specific name is not defined, it should only be used to
3802 compare it to other instances of specific routine names.
3807 <entry><literal>routine_catalog</literal></entry>
3808 <entry><type>sql_identifier</type></entry>
3809 <entry>Name of the database containing the function (always the current database)</entry>
3813 <entry><literal>routine_schema</literal></entry>
3814 <entry><type>sql_identifier</type></entry>
3815 <entry>Name of the schema containing the function</entry>
3819 <entry><literal>routine_name</literal></entry>
3820 <entry><type>sql_identifier</type></entry>
3821 <entry>Name of the function (might be duplicated in case of overloading)</entry>
3825 <entry><literal>routine_type</literal></entry>
3826 <entry><type>character_data</type></entry>
3828 Always <literal>FUNCTION</literal> (In the future there might
3829 be other types of routines.)
3834 <entry><literal>module_catalog</literal></entry>
3835 <entry><type>sql_identifier</type></entry>
3836 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3840 <entry><literal>module_schema</literal></entry>
3841 <entry><type>sql_identifier</type></entry>
3842 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3846 <entry><literal>module_name</literal></entry>
3847 <entry><type>sql_identifier</type></entry>
3848 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3852 <entry><literal>udt_catalog</literal></entry>
3853 <entry><type>sql_identifier</type></entry>
3854 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3858 <entry><literal>udt_schema</literal></entry>
3859 <entry><type>sql_identifier</type></entry>
3860 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3864 <entry><literal>udt_name</literal></entry>
3865 <entry><type>sql_identifier</type></entry>
3866 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3870 <entry><literal>data_type</literal></entry>
3871 <entry><type>character_data</type></entry>
3873 Return data type of the function, if it is a built-in type, or
3874 <literal>ARRAY</literal> if it is some array (in that case, see
3875 the view <literal>element_types</literal>), else
3876 <literal>USER-DEFINED</literal> (in that case, the type is
3877 identified in <literal>type_udt_name</literal> and associated
3883 <entry><literal>character_maximum_length</literal></entry>
3884 <entry><type>cardinal_number</type></entry>
3885 <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
3889 <entry><literal>character_octet_length</literal></entry>
3890 <entry><type>cardinal_number</type></entry>
3891 <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
3895 <entry><literal>character_set_catalog</literal></entry>
3896 <entry><type>sql_identifier</type></entry>
3897 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3901 <entry><literal>character_set_schema</literal></entry>
3902 <entry><type>sql_identifier</type></entry>
3903 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3907 <entry><literal>character_set_name</literal></entry>
3908 <entry><type>sql_identifier</type></entry>
3909 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3913 <entry><literal>collation_catalog</literal></entry>
3914 <entry><type>sql_identifier</type></entry>
3915 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3919 <entry><literal>collation_schema</literal></entry>
3920 <entry><type>sql_identifier</type></entry>
3921 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3925 <entry><literal>collation_name</literal></entry>
3926 <entry><type>sql_identifier</type></entry>
3927 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3931 <entry><literal>numeric_precision</literal></entry>
3932 <entry><type>cardinal_number</type></entry>
3933 <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
3937 <entry><literal>numeric_precision_radix</literal></entry>
3938 <entry><type>cardinal_number</type></entry>
3939 <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
3943 <entry><literal>numeric_scale</literal></entry>
3944 <entry><type>cardinal_number</type></entry>
3945 <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
3949 <entry><literal>datetime_precision</literal></entry>
3950 <entry><type>cardinal_number</type></entry>
3951 <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
3955 <entry><literal>interval_type</literal></entry>
3956 <entry><type>character_data</type></entry>
3957 <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
3961 <entry><literal>interval_precision</literal></entry>
3962 <entry><type>character_data</type></entry>
3963 <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
3967 <entry><literal>type_udt_catalog</literal></entry>
3968 <entry><type>sql_identifier</type></entry>
3970 Name of the database that the return data type of the function
3971 is defined in (always the current database)
3976 <entry><literal>type_udt_schema</literal></entry>
3977 <entry><type>sql_identifier</type></entry>
3979 Name of the schema that the return data type of the function is
3985 <entry><literal>type_udt_name</literal></entry>
3986 <entry><type>sql_identifier</type></entry>
3988 Name of the return data type of the function
3993 <entry><literal>scope_catalog</literal></entry>
3994 <entry><type>sql_identifier</type></entry>
3995 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3999 <entry><literal>scope_schema</literal></entry>
4000 <entry><type>sql_identifier</type></entry>
4001 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4005 <entry><literal>scope_name</literal></entry>
4006 <entry><type>sql_identifier</type></entry>
4007 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4011 <entry><literal>maximum_cardinality</literal></entry>
4012 <entry><type>cardinal_number</type></entry>
4013 <entry>Always null, because arrays always have unlimited maximum cardinality in <productname>PostgreSQL</></entry>
4017 <entry><literal>dtd_identifier</literal></entry>
4018 <entry><type>sql_identifier</type></entry>
4020 An identifier of the data type descriptor of the return data
4021 type of this function, unique among the data type descriptors
4022 pertaining to the function. This is mainly useful for joining
4023 with other instances of such identifiers. (The specific format
4024 of the identifier is not defined and not guaranteed to remain
4025 the same in future versions.)
4030 <entry><literal>routine_body</literal></entry>
4031 <entry><type>character_data</type></entry>
4033 If the function is an SQL function, then
4034 <literal>SQL</literal>, else <literal>EXTERNAL</literal>.
4039 <entry><literal>routine_definition</literal></entry>
4040 <entry><type>character_data</type></entry>
4042 The source text of the function (null if the function is not
4043 owned by a currently enabled role). (According to the SQL
4044 standard, this column is only applicable if
4045 <literal>routine_body</literal> is <literal>SQL</literal>, but
4046 in <productname>PostgreSQL</productname> it will contain
4047 whatever source text was specified when the function was
4053 <entry><literal>external_name</literal></entry>
4054 <entry><type>character_data</type></entry>
4056 If this function is a C function, then the external name (link
4057 symbol) of the function; else null. (This works out to be the
4058 same value that is shown in
4059 <literal>routine_definition</literal>.)
4064 <entry><literal>external_language</literal></entry>
4065 <entry><type>character_data</type></entry>
4066 <entry>The language the function is written in</entry>
4070 <entry><literal>parameter_style</literal></entry>
4071 <entry><type>character_data</type></entry>
4073 Always <literal>GENERAL</literal> (The SQL standard defines
4074 other parameter styles, which are not available in <productname>PostgreSQL</>.)
4079 <entry><literal>is_deterministic</literal></entry>
4080 <entry><type>yes_or_no</type></entry>
4082 If the function is declared immutable (called deterministic in
4083 the SQL standard), then <literal>YES</literal>, else
4084 <literal>NO</literal>. (You cannot query the other volatility
4085 levels available in <productname>PostgreSQL</> through the information schema.)
4090 <entry><literal>sql_data_access</literal></entry>
4091 <entry><type>character_data</type></entry>
4093 Always <literal>MODIFIES</literal>, meaning that the function
4094 possibly modifies SQL data. This information is not useful for
4095 <productname>PostgreSQL</>.
4100 <entry><literal>is_null_call</literal></entry>
4101 <entry><type>yes_or_no</type></entry>
4103 If the function automatically returns null if any of its
4104 arguments are null, then <literal>YES</literal>, else
4105 <literal>NO</literal>.
4110 <entry><literal>sql_path</literal></entry>
4111 <entry><type>character_data</type></entry>
4112 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4116 <entry><literal>schema_level_routine</literal></entry>
4117 <entry><type>yes_or_no</type></entry>
4119 Always <literal>YES</literal> (The opposite would be a method
4120 of a user-defined type, which is a feature not available in
4121 <productname>PostgreSQL</>.)
4126 <entry><literal>max_dynamic_result_sets</literal></entry>
4127 <entry><type>cardinal_number</type></entry>
4128 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4132 <entry><literal>is_user_defined_cast</literal></entry>
4133 <entry><type>yes_or_no</type></entry>
4134 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4138 <entry><literal>is_implicitly_invocable</literal></entry>
4139 <entry><type>yes_or_no</type></entry>
4140 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4144 <entry><literal>security_type</literal></entry>
4145 <entry><type>character_data</type></entry>
4147 If the function runs with the privileges of the current user,
4148 then <literal>INVOKER</literal>, if the function runs with the
4149 privileges of the user who defined it, then
4150 <literal>DEFINER</literal>.
4155 <entry><literal>to_sql_specific_catalog</literal></entry>
4156 <entry><type>sql_identifier</type></entry>
4157 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4161 <entry><literal>to_sql_specific_schema</literal></entry>
4162 <entry><type>sql_identifier</type></entry>
4163 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4167 <entry><literal>to_sql_specific_name</literal></entry>
4168 <entry><type>sql_identifier</type></entry>
4169 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4173 <entry><literal>as_locator</literal></entry>
4174 <entry><type>yes_or_no</type></entry>
4175 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4179 <entry><literal>created</literal></entry>
4180 <entry><type>time_stamp</type></entry>
4181 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4185 <entry><literal>last_altered</literal></entry>
4186 <entry><type>time_stamp</type></entry>
4187 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4191 <entry><literal>new_savepoint_level</literal></entry>
4192 <entry><type>yes_or_no</type></entry>
4193 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4197 <entry><literal>is_udt_dependent</literal></entry>
4198 <entry><type>yes_or_no</type></entry>
4199 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4203 <entry><literal>result_cast_from_data_type</literal></entry>
4204 <entry><type>character_data</type></entry>
4205 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4209 <entry><literal>result_cast_as_locator</literal></entry>
4210 <entry><type>yes_or_no</type></entry>
4211 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4215 <entry><literal>result_cast_char_max_length</literal></entry>
4216 <entry><type>cardinal_number</type></entry>
4217 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4221 <entry><literal>result_cast_char_octet_length</literal></entry>
4222 <entry><type>character_data</type></entry>
4223 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4227 <entry><literal>result_cast_char_set_catalog</literal></entry>
4228 <entry><type>sql_identifier</type></entry>
4229 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4233 <entry><literal>result_cast_char_set_schema</literal></entry>
4234 <entry><type>sql_identifier</type></entry>
4235 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4239 <entry><literal>result_cast_char_set_name</literal></entry>
4240 <entry><type>sql_identifier</type></entry>
4241 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4245 <entry><literal>result_cast_collation_catalog</literal></entry>
4246 <entry><type>sql_identifier</type></entry>
4247 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4251 <entry><literal>result_cast_collation_schema</literal></entry>
4252 <entry><type>sql_identifier</type></entry>
4253 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4257 <entry><literal>result_cast_collation_name</literal></entry>
4258 <entry><type>sql_identifier</type></entry>
4259 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4263 <entry><literal>result_cast_numeric_precision</literal></entry>
4264 <entry><type>cardinal_number</type></entry>
4265 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4269 <entry><literal>result_cast_numeric_precision_radix</literal></entry>
4270 <entry><type>cardinal_number</type></entry>
4271 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4275 <entry><literal>result_cast_numeric_scale</literal></entry>
4276 <entry><type>cardinal_number</type></entry>
4277 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4281 <entry><literal>result_cast_datetime_precision</literal></entry>
4282 <entry><type>character_data</type></entry>
4283 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4287 <entry><literal>result_cast_interval_type</literal></entry>
4288 <entry><type>character_data</type></entry>
4289 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4293 <entry><literal>result_cast_interval_precision</literal></entry>
4294 <entry><type>character_data</type></entry>
4295 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4299 <entry><literal>result_cast_type_udt_catalog</literal></entry>
4300 <entry><type>sql_identifier</type></entry>
4301 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4305 <entry><literal>result_cast_type_udt_schema</literal></entry>
4306 <entry><type>sql_identifier</type></entry>
4307 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4311 <entry><literal>result_cast_type_udt_name</literal></entry>
4312 <entry><type>sql_identifier</type></entry>
4313 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4317 <entry><literal>result_cast_scope_catalog</literal></entry>
4318 <entry><type>sql_identifier</type></entry>
4319 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4323 <entry><literal>result_cast_scope_schema</literal></entry>
4324 <entry><type>sql_identifier</type></entry>
4325 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4329 <entry><literal>result_cast_scope_name</literal></entry>
4330 <entry><type>sql_identifier</type></entry>
4331 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4335 <entry><literal>result_cast_maximum_cardinality</literal></entry>
4336 <entry><type>cardinal_number</type></entry>
4337 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4341 <entry><literal>result_cast_dtd_identifier</literal></entry>
4342 <entry><type>sql_identifier</type></entry>
4343 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4350 <sect1 id="infoschema-schemata">
4351 <title><literal>schemata</literal></title>
4354 The view <literal>schemata</literal> contains all schemas in the
4355 current database that are owned by a currently enabled role.
4359 <title><literal>schemata</literal> Columns</title>
4365 <entry>Data Type</entry>
4366 <entry>Description</entry>
4372 <entry><literal>catalog_name</literal></entry>
4373 <entry><type>sql_identifier</type></entry>
4374 <entry>Name of the database that the schema is contained in (always the current database)</entry>
4378 <entry><literal>schema_name</literal></entry>
4379 <entry><type>sql_identifier</type></entry>
4380 <entry>Name of the schema</entry>
4384 <entry><literal>schema_owner</literal></entry>
4385 <entry><type>sql_identifier</type></entry>
4386 <entry>Name of the owner of the schema</entry>
4390 <entry><literal>default_character_set_catalog</literal></entry>
4391 <entry><type>sql_identifier</type></entry>
4392 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4396 <entry><literal>default_character_set_schema</literal></entry>
4397 <entry><type>sql_identifier</type></entry>
4398 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4402 <entry><literal>default_character_set_name</literal></entry>
4403 <entry><type>sql_identifier</type></entry>
4404 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4408 <entry><literal>sql_path</literal></entry>
4409 <entry><type>character_data</type></entry>
4410 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4417 <sect1 id="infoschema-sequences">
4418 <title><literal>sequences</literal></title>
4421 The view <literal>sequences</literal> contains all sequences
4422 defined in the current database. Only those sequences are shown
4423 that the current user has access to (by way of being the owner or
4424 having some privilege).
4428 <title><literal>sequences</literal> Columns</title>
4434 <entry>Data Type</entry>
4435 <entry>Description</entry>
4441 <entry><literal>sequence_catalog</literal></entry>
4442 <entry><type>sql_identifier</type></entry>
4443 <entry>Name of the database that contains the sequence (always the current database)</entry>
4447 <entry><literal>sequence_schema</literal></entry>
4448 <entry><type>sql_identifier</type></entry>
4449 <entry>Name of the schema that contains the sequence</entry>
4453 <entry><literal>sequence_name</literal></entry>
4454 <entry><type>sql_identifier</type></entry>
4455 <entry>Name of the sequence</entry>
4459 <entry><literal>data_type</literal></entry>
4460 <entry><type>character_data</type></entry>
4462 The data type of the sequence. In
4463 <productname>PostgreSQL</productname>, this is currently always
4464 <literal>bigint</literal>.
4469 <entry><literal>numeric_precision</literal></entry>
4470 <entry><type>cardinal_number</type></entry>
4472 This column contains the (declared or implicit) precision of
4473 the sequence data type (see above). The precision indicates
4474 the number of significant digits. It can be expressed in
4475 decimal (base 10) or binary (base 2) terms, as specified in the
4476 column <literal>numeric_precision_radix</literal>.
4481 <entry><literal>numeric_precision_radix</literal></entry>
4482 <entry><type>cardinal_number</type></entry>
4484 This column indicates in which base the values in the columns
4485 <literal>numeric_precision</literal> and
4486 <literal>numeric_scale</literal> are expressed. The value is
4492 <entry><literal>numeric_scale</literal></entry>
4493 <entry><type>cardinal_number</type></entry>
4495 This column contains the (declared or implicit) scale of the
4496 sequence data type (see above). The scale indicates the number
4497 of significant digits to the right of the decimal point. It
4498 can be expressed in decimal (base 10) or binary (base 2) terms,
4499 as specified in the column
4500 <literal>numeric_precision_radix</literal>.
4505 <entry><literal>start_value</literal></entry>
4506 <entry><type>character_data</type></entry>
4507 <entry>The start value of the sequence</entry>
4511 <entry><literal>minimum_value</literal></entry>
4512 <entry><type>character_data</type></entry>
4513 <entry>The minimum value of the sequence</entry>
4517 <entry><literal>maximum_value</literal></entry>
4518 <entry><type>character_data</type></entry>
4519 <entry>The maximum value of the sequence</entry>
4523 <entry><literal>increment</literal></entry>
4524 <entry><type>character_data</type></entry>
4525 <entry>The increment of the sequence</entry>
4529 <entry><literal>cycle_option</literal></entry>
4530 <entry><type>yes_or_no</type></entry>
4531 <entry><literal>YES</literal> if the sequence cycles, else <literal>NO</literal></entry>
4538 Note that in accordance with the SQL standard, the start, minimum,
4539 maximum, and increment values are returned as character strings.
4543 <sect1 id="infoschema-sql-features">
4544 <title><literal>sql_features</literal></title>
4547 The table <literal>sql_features</literal> contains information
4548 about which formal features defined in the SQL standard are
4549 supported by <productname>PostgreSQL</productname>. This is the
4550 same information that is presented in <xref linkend="features">.
4551 There you can also find some additional background information.
4555 <title><literal>sql_features</literal> Columns</title>
4561 <entry>Data Type</entry>
4562 <entry>Description</entry>
4568 <entry><literal>feature_id</literal></entry>
4569 <entry><type>character_data</type></entry>
4570 <entry>Identifier string of the feature</entry>
4574 <entry><literal>feature_name</literal></entry>
4575 <entry><type>character_data</type></entry>
4576 <entry>Descriptive name of the feature</entry>
4580 <entry><literal>sub_feature_id</literal></entry>
4581 <entry><type>character_data</type></entry>
4582 <entry>Identifier string of the subfeature, or a zero-length string if not a subfeature</entry>
4586 <entry><literal>sub_feature_name</literal></entry>
4587 <entry><type>character_data</type></entry>
4588 <entry>Descriptive name of the subfeature, or a zero-length string if not a subfeature</entry>
4592 <entry><literal>is_supported</literal></entry>
4593 <entry><type>yes_or_no</type></entry>
4595 <literal>YES</literal> if the feature is fully supported by the
4596 current version of <productname>PostgreSQL</>, <literal>NO</literal> if not
4601 <entry><literal>is_verified_by</literal></entry>
4602 <entry><type>character_data</type></entry>
4604 Always null, since the <productname>PostgreSQL</> development group does not
4605 perform formal testing of feature conformance
4610 <entry><literal>comments</literal></entry>
4611 <entry><type>character_data</type></entry>
4612 <entry>Possibly a comment about the supported status of the feature</entry>
4619 <sect1 id="infoschema-sql-implementation-info">
4620 <title><literal>sql_implementation_info</literal></title>
4623 The table <literal>sql_implementation_info</literal> contains
4624 information about various aspects that are left
4625 implementation-defined by the SQL standard. This information is
4626 primarily intended for use in the context of the ODBC interface;
4627 users of other interfaces will probably find this information to be
4628 of little use. For this reason, the individual implementation
4629 information items are not described here; you will find them in the
4630 description of the ODBC interface.
4634 <title><literal>sql_implementation_info</literal> Columns</title>
4640 <entry>Data Type</entry>
4641 <entry>Description</entry>
4647 <entry><literal>implementation_info_id</literal></entry>
4648 <entry><type>character_data</type></entry>
4649 <entry>Identifier string of the implementation information item</entry>
4653 <entry><literal>implementation_info_name</literal></entry>
4654 <entry><type>character_data</type></entry>
4655 <entry>Descriptive name of the implementation information item</entry>
4659 <entry><literal>integer_value</literal></entry>
4660 <entry><type>cardinal_number</type></entry>
4662 Value of the implementation information item, or null if the
4663 value is contained in the column
4664 <literal>character_value</literal>
4669 <entry><literal>character_value</literal></entry>
4670 <entry><type>character_data</type></entry>
4672 Value of the implementation information item, or null if the
4673 value is contained in the column
4674 <literal>integer_value</literal>
4679 <entry><literal>comments</literal></entry>
4680 <entry><type>character_data</type></entry>
4681 <entry>Possibly a comment pertaining to the implementation information item</entry>
4688 <sect1 id="infoschema-sql-languages">
4689 <title><literal>sql_languages</literal></title>
4692 The table <literal>sql_languages</literal> contains one row for
4693 each SQL language binding that is supported by
4694 <productname>PostgreSQL</productname>.
4695 <productname>PostgreSQL</productname> supports direct SQL and
4696 embedded SQL in C; that is all you will learn from this table.
4700 <title><literal>sql_languages</literal> Columns</title>
4706 <entry>Data Type</entry>
4707 <entry>Description</entry>
4713 <entry><literal>sql_language_source</literal></entry>
4714 <entry><type>character_data</type></entry>
4716 The name of the source of the language definition; always
4717 <literal>ISO 9075</literal>, that is, the SQL standard
4722 <entry><literal>sql_language_year</literal></entry>
4723 <entry><type>character_data</type></entry>
4725 The year the standard referenced in
4726 <literal>sql_language_source</literal> was approved; currently
4732 <entry><literal>sql_language_conformance</literal></entry>
4733 <entry><type>character_data</type></entry>
4735 The standard conformance level for the language binding. For
4736 ISO 9075:2003 this is always <literal>CORE</literal>.
4741 <entry><literal>sql_language_integrity</literal></entry>
4742 <entry><type>character_data</type></entry>
4743 <entry>Always null (This value is relevant to an earlier version of the SQL standard.)</entry>
4747 <entry><literal>sql_language_implementation</literal></entry>
4748 <entry><type>character_data</type></entry>
4749 <entry>Always null</entry>
4753 <entry><literal>sql_language_binding_style</literal></entry>
4754 <entry><type>character_data</type></entry>
4756 The language binding style, either <literal>DIRECT</literal> or
4757 <literal>EMBEDDED</literal>
4762 <entry><literal>sql_language_programming_language</literal></entry>
4763 <entry><type>character_data</type></entry>
4765 The programming language, if the binding style is
4766 <literal>EMBEDDED</literal>, else null. <productname>PostgreSQL</> only
4767 supports the language C.
4775 <sect1 id="infoschema-sql-packages">
4776 <title><literal>sql_packages</literal></title>
4779 The table <literal>sql_packages</literal> contains information
4780 about which feature packages defined in the SQL standard are
4781 supported by <productname>PostgreSQL</productname>. Refer to <xref
4782 linkend="features"> for background information on feature packages.
4786 <title><literal>sql_packages</literal> Columns</title>
4792 <entry>Data Type</entry>
4793 <entry>Description</entry>
4799 <entry><literal>feature_id</literal></entry>
4800 <entry><type>character_data</type></entry>
4801 <entry>Identifier string of the package</entry>
4805 <entry><literal>feature_name</literal></entry>
4806 <entry><type>character_data</type></entry>
4807 <entry>Descriptive name of the package</entry>
4811 <entry><literal>is_supported</literal></entry>
4812 <entry><type>yes_or_no</type></entry>
4814 <literal>YES</literal> if the package is fully supported by the
4815 current version of <productname>PostgreSQL</>, <literal>NO</literal> if not
4820 <entry><literal>is_verified_by</literal></entry>
4821 <entry><type>character_data</type></entry>
4823 Always null, since the <productname>PostgreSQL</> development group does not
4824 perform formal testing of feature conformance
4829 <entry><literal>comments</literal></entry>
4830 <entry><type>character_data</type></entry>
4831 <entry>Possibly a comment about the supported status of the package</entry>
4838 <sect1 id="infoschema-sql-parts">
4839 <title><literal>sql_parts</literal></title>
4842 The table <literal>sql_parts</literal> contains information about
4843 which of the several parts of the SQL standard are supported by
4844 <productname>PostgreSQL</productname>.
4848 <title><literal>sql_parts</literal> Columns</title>
4854 <entry>Data Type</entry>
4855 <entry>Description</entry>
4861 <entry><literal>feature_id</literal></entry>
4862 <entry><type>character_data</type></entry>
4863 <entry>An identifier string containing the number of the part</entry>
4867 <entry><literal>feature_name</literal></entry>
4868 <entry><type>character_data</type></entry>
4869 <entry>Descriptive name of the part</entry>
4873 <entry><literal>is_supported</literal></entry>
4874 <entry><type>yes_or_no</type></entry>
4876 <literal>YES</literal> if the part is fully supported by the
4877 current version of <productname>PostgreSQL</>,
4878 <literal>NO</literal> if not
4883 <entry><literal>is_verified_by</literal></entry>
4884 <entry><type>character_data</type></entry>
4886 Always null, since the <productname>PostgreSQL</> development group does not
4887 perform formal testing of feature conformance
4892 <entry><literal>comments</literal></entry>
4893 <entry><type>character_data</type></entry>
4894 <entry>Possibly a comment about the supported status of the part</entry>
4901 <sect1 id="infoschema-sql-sizing">
4902 <title><literal>sql_sizing</literal></title>
4905 The table <literal>sql_sizing</literal> contains information about
4906 various size limits and maximum values in
4907 <productname>PostgreSQL</productname>. This information is
4908 primarily intended for use in the context of the ODBC interface;
4909 users of other interfaces will probably find this information to be
4910 of little use. For this reason, the individual sizing items are
4911 not described here; you will find them in the description of the
4916 <title><literal>sql_sizing</literal> Columns</title>
4922 <entry>Data Type</entry>
4923 <entry>Description</entry>
4929 <entry><literal>sizing_id</literal></entry>
4930 <entry><type>cardinal_number</type></entry>
4931 <entry>Identifier of the sizing item</entry>
4935 <entry><literal>sizing_name</literal></entry>
4936 <entry><type>character_data</type></entry>
4937 <entry>Descriptive name of the sizing item</entry>
4941 <entry><literal>supported_value</literal></entry>
4942 <entry><type>cardinal_number</type></entry>
4944 Value of the sizing item, or 0 if the size is unlimited or
4945 cannot be determined, or null if the features for which the
4946 sizing item is applicable are not supported
4951 <entry><literal>comments</literal></entry>
4952 <entry><type>character_data</type></entry>
4953 <entry>Possibly a comment pertaining to the sizing item</entry>
4960 <sect1 id="infoschema-sql-sizing-profiles">
4961 <title><literal>sql_sizing_profiles</literal></title>
4964 The table <literal>sql_sizing_profiles</literal> contains
4965 information about the <literal>sql_sizing</literal> values that are
4966 required by various profiles of the SQL standard. <productname>PostgreSQL</> does
4967 not track any SQL profiles, so this table is empty.
4971 <title><literal>sql_sizing_profiles</literal> Columns</title>
4977 <entry>Data Type</entry>
4978 <entry>Description</entry>
4984 <entry><literal>sizing_id</literal></entry>
4985 <entry><type>cardinal_number</type></entry>
4986 <entry>Identifier of the sizing item</entry>
4990 <entry><literal>sizing_name</literal></entry>
4991 <entry><type>character_data</type></entry>
4992 <entry>Descriptive name of the sizing item</entry>
4996 <entry><literal>profile_id</literal></entry>
4997 <entry><type>character_data</type></entry>
4998 <entry>Identifier string of a profile</entry>
5002 <entry><literal>required_value</literal></entry>
5003 <entry><type>cardinal_number</type></entry>
5005 The value required by the SQL profile for the sizing item, or 0
5006 if the profile places no limit on the sizing item, or null if
5007 the profile does not require any of the features for which the
5008 sizing item is applicable
5013 <entry><literal>comments</literal></entry>
5014 <entry><type>character_data</type></entry>
5015 <entry>Possibly a comment pertaining to the sizing item within the profile</entry>
5022 <sect1 id="infoschema-table-constraints">
5023 <title><literal>table_constraints</literal></title>
5026 The view <literal>table_constraints</literal> contains all
5027 constraints belonging to tables that the current user owns or has
5028 some non-SELECT privilege on.
5032 <title><literal>table_constraints</literal> Columns</title>
5038 <entry>Data Type</entry>
5039 <entry>Description</entry>
5045 <entry><literal>constraint_catalog</literal></entry>
5046 <entry><type>sql_identifier</type></entry>
5047 <entry>Name of the database that contains the constraint (always the current database)</entry>
5051 <entry><literal>constraint_schema</literal></entry>
5052 <entry><type>sql_identifier</type></entry>
5053 <entry>Name of the schema that contains the constraint</entry>
5057 <entry><literal>constraint_name</literal></entry>
5058 <entry><type>sql_identifier</type></entry>
5059 <entry>Name of the constraint</entry>
5063 <entry><literal>table_catalog</literal></entry>
5064 <entry><type>sql_identifier</type></entry>
5065 <entry>Name of the database that contains the table (always the current database)</entry>
5069 <entry><literal>table_schema</literal></entry>
5070 <entry><type>sql_identifier</type></entry>
5071 <entry>Name of the schema that contains the table</entry>
5075 <entry><literal>table_name</literal></entry>
5076 <entry><type>sql_identifier</type></entry>
5077 <entry>Name of the table</entry>
5081 <entry><literal>constraint_type</literal></entry>
5082 <entry><type>character_data</type></entry>
5084 Type of the constraint: <literal>CHECK</literal>,
5085 <literal>FOREIGN KEY</literal>, <literal>PRIMARY KEY</literal>,
5086 or <literal>UNIQUE</literal>
5091 <entry><literal>is_deferrable</literal></entry>
5092 <entry><type>yes_or_no</type></entry>
5093 <entry><literal>YES</literal> if the constraint is deferrable, <literal>NO</literal> if not</entry>
5097 <entry><literal>initially_deferred</literal></entry>
5098 <entry><type>yes_or_no</type></entry>
5099 <entry><literal>YES</literal> if the constraint is deferrable and initially deferred, <literal>NO</literal> if not</entry>
5106 <sect1 id="infoschema-table-privileges">
5107 <title><literal>table_privileges</literal></title>
5110 The view <literal>table_privileges</literal> identifies all
5111 privileges granted on tables or views to a currently enabled role
5112 or by a currently enabled role. There is one row for each
5113 combination of table, grantor, and grantee.
5117 <title><literal>table_privileges</literal> Columns</title>
5123 <entry>Data Type</entry>
5124 <entry>Description</entry>
5130 <entry><literal>grantor</literal></entry>
5131 <entry><type>sql_identifier</type></entry>
5132 <entry>Name of the role that granted the privilege</entry>
5136 <entry><literal>grantee</literal></entry>
5137 <entry><type>sql_identifier</type></entry>
5138 <entry>Name of the role that the privilege was granted to</entry>
5142 <entry><literal>table_catalog</literal></entry>
5143 <entry><type>sql_identifier</type></entry>
5144 <entry>Name of the database that contains the table (always the current database)</entry>
5148 <entry><literal>table_schema</literal></entry>
5149 <entry><type>sql_identifier</type></entry>
5150 <entry>Name of the schema that contains the table</entry>
5154 <entry><literal>table_name</literal></entry>
5155 <entry><type>sql_identifier</type></entry>
5156 <entry>Name of the table</entry>
5160 <entry><literal>privilege_type</literal></entry>
5161 <entry><type>character_data</type></entry>
5163 Type of the privilege: <literal>SELECT</literal>,
5164 <literal>INSERT</literal>, <literal>UPDATE</literal>,
5165 <literal>DELETE</literal>, <literal>TRUNCATE</literal>,
5166 <literal>REFERENCES</literal>, or <literal>TRIGGER</literal>
5171 <entry><literal>is_grantable</literal></entry>
5172 <entry><type>yes_or_no</type></entry>
5173 <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
5177 <entry><literal>with_hierarchy</literal></entry>
5178 <entry><type>yes_or_no</type></entry>
5179 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5186 <sect1 id="infoschema-tables">
5187 <title><literal>tables</literal></title>
5190 The view <literal>tables</literal> contains all tables and views
5191 defined in the current database. Only those tables and views are
5192 shown that the current user has access to (by way of being the
5193 owner or having some privilege).
5197 <title><literal>tables</literal> Columns</title>
5203 <entry>Data Type</entry>
5204 <entry>Description</entry>
5210 <entry><literal>table_catalog</literal></entry>
5211 <entry><type>sql_identifier</type></entry>
5212 <entry>Name of the database that contains the table (always the current database)</entry>
5216 <entry><literal>table_schema</literal></entry>
5217 <entry><type>sql_identifier</type></entry>
5218 <entry>Name of the schema that contains the table</entry>
5222 <entry><literal>table_name</literal></entry>
5223 <entry><type>sql_identifier</type></entry>
5224 <entry>Name of the table</entry>
5228 <entry><literal>table_type</literal></entry>
5229 <entry><type>character_data</type></entry>
5231 Type of the table: <literal>BASE TABLE</literal> for a
5232 persistent base table (the normal table type),
5233 <literal>VIEW</literal> for a view, <literal>FOREIGN TABLE</literal>
5234 for a foreign table, or
5235 <literal>LOCAL TEMPORARY</literal> for a temporary table
5240 <entry><literal>self_referencing_column_name</literal></entry>
5241 <entry><type>sql_identifier</type></entry>
5242 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5246 <entry><literal>reference_generation</literal></entry>
5247 <entry><type>character_data</type></entry>
5248 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5252 <entry><literal>user_defined_type_catalog</literal></entry>
5253 <entry><type>sql_identifier</type></entry>
5255 If the table is a typed table, the name of the database that
5256 contains the underlying data type (always the current
5257 database), else null.
5262 <entry><literal>user_defined_type_schema</literal></entry>
5263 <entry><type>sql_identifier</type></entry>
5265 If the table is a typed table, the name of the schema that
5266 contains the underlying data type, else null.
5271 <entry><literal>user_defined_type_name</literal></entry>
5272 <entry><type>sql_identifier</type></entry>
5274 If the table is a typed table, the name of the underlying data
5280 <entry><literal>is_insertable_into</literal></entry>
5281 <entry><type>yes_or_no</type></entry>
5283 <literal>YES</literal> if the table is insertable into,
5284 <literal>NO</literal> if not (Base tables are always insertable
5285 into, views not necessarily.)
5290 <entry><literal>is_typed</literal></entry>
5291 <entry><type>yes_or_no</type></entry>
5292 <entry><literal>YES</literal> if the table is a typed table, <literal>NO</literal> if not</entry>
5296 <entry><literal>commit_action</literal></entry>
5297 <entry><type>character_data</type></entry>
5299 If the table is a temporary table, then
5300 <literal>PRESERVE</literal>, else null. (The SQL standard
5301 defines other commit actions for temporary tables, which are
5302 not supported by <productname>PostgreSQL</>.)
5310 <sect1 id="infoschema-triggered-update-columns">
5311 <title><literal>triggered_update_columns</literal></title>
5314 For triggers in the current database that specify a column list
5315 (like <literal>UPDATE OF column1, column2</literal>), the
5316 view <literal>triggered_update_columns</literal> identifies these
5317 columns. Triggers that do not specify a column list are not
5318 included in this view. Only those columns are shown that the
5319 current user owns or has some non-SELECT privilege on.
5323 <title><literal>triggered_update_columns</literal> Columns</title>
5329 <entry>Data Type</entry>
5330 <entry>Description</entry>
5336 <entry><literal>trigger_catalog</literal></entry>
5337 <entry><type>sql_identifier</type></entry>
5338 <entry>Name of the database that contains the trigger (always the current database)</entry>
5342 <entry><literal>trigger_schema</literal></entry>
5343 <entry><type>sql_identifier</type></entry>
5344 <entry>Name of the schema that contains the trigger</entry>
5348 <entry><literal>trigger_name</literal></entry>
5349 <entry><type>sql_identifier</type></entry>
5350 <entry>Name of the trigger</entry>
5354 <entry><literal>event_object_catalog</literal></entry>
5355 <entry><type>sql_identifier</type></entry>
5357 Name of the database that contains the table that the trigger
5358 is defined on (always the current database)
5363 <entry><literal>event_object_schema</literal></entry>
5364 <entry><type>sql_identifier</type></entry>
5365 <entry>Name of the schema that contains the table that the trigger is defined on</entry>
5369 <entry><literal>event_object_table</literal></entry>
5370 <entry><type>sql_identifier</type></entry>
5371 <entry>Name of the table that the trigger is defined on</entry>
5375 <entry><literal>event_object_column</literal></entry>
5376 <entry><type>sql_identifier</type></entry>
5377 <entry>Name of the column that the trigger is defined on</entry>
5384 <sect1 id="infoschema-triggers">
5385 <title><literal>triggers</literal></title>
5388 The view <literal>triggers</literal> contains all triggers defined
5389 in the current database on tables and views that the current user owns
5390 or has some non-SELECT privilege on.
5394 <title><literal>triggers</literal> Columns</title>
5400 <entry>Data Type</entry>
5401 <entry>Description</entry>
5407 <entry><literal>trigger_catalog</literal></entry>
5408 <entry><type>sql_identifier</type></entry>
5409 <entry>Name of the database that contains the trigger (always the current database)</entry>
5413 <entry><literal>trigger_schema</literal></entry>
5414 <entry><type>sql_identifier</type></entry>
5415 <entry>Name of the schema that contains the trigger</entry>
5419 <entry><literal>trigger_name</literal></entry>
5420 <entry><type>sql_identifier</type></entry>
5421 <entry>Name of the trigger</entry>
5425 <entry><literal>event_manipulation</literal></entry>
5426 <entry><type>character_data</type></entry>
5428 Event that fires the trigger (<literal>INSERT</literal>,
5429 <literal>UPDATE</literal>, or <literal>DELETE</literal>)
5434 <entry><literal>event_object_catalog</literal></entry>
5435 <entry><type>sql_identifier</type></entry>
5437 Name of the database that contains the table that the trigger
5438 is defined on (always the current database)
5443 <entry><literal>event_object_schema</literal></entry>
5444 <entry><type>sql_identifier</type></entry>
5445 <entry>Name of the schema that contains the table that the trigger is defined on</entry>
5449 <entry><literal>event_object_table</literal></entry>
5450 <entry><type>sql_identifier</type></entry>
5451 <entry>Name of the table that the trigger is defined on</entry>
5455 <entry><literal>action_order</literal></entry>
5456 <entry><type>cardinal_number</type></entry>
5457 <entry>Not yet implemented</entry>
5461 <entry><literal>action_condition</literal></entry>
5462 <entry><type>character_data</type></entry>
5464 <literal>WHEN</literal> condition of the trigger, null if none
5465 (also null if the table is not owned by a currently enabled
5471 <entry><literal>action_statement</literal></entry>
5472 <entry><type>character_data</type></entry>
5474 Statement that is executed by the trigger (currently always
5475 <literal>EXECUTE PROCEDURE
5476 <replaceable>function</replaceable>(...)</literal>)
5481 <entry><literal>action_orientation</literal></entry>
5482 <entry><type>character_data</type></entry>
5484 Identifies whether the trigger fires once for each processed
5485 row or once for each statement (<literal>ROW</literal> or
5486 <literal>STATEMENT</literal>)
5491 <entry><literal>action_timing</literal></entry>
5492 <entry><type>character_data</type></entry>
5494 Time at which the trigger fires (<literal>BEFORE</literal>,
5495 <literal>AFTER</literal>, or <literal>INSTEAD OF</literal>)
5500 <entry><literal>action_reference_old_table</literal></entry>
5501 <entry><type>sql_identifier</type></entry>
5502 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5506 <entry><literal>action_reference_new_table</literal></entry>
5507 <entry><type>sql_identifier</type></entry>
5508 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5512 <entry><literal>action_reference_old_row</literal></entry>
5513 <entry><type>sql_identifier</type></entry>
5514 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5518 <entry><literal>action_reference_new_row</literal></entry>
5519 <entry><type>sql_identifier</type></entry>
5520 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5524 <entry><literal>created</literal></entry>
5525 <entry><type>time_stamp</type></entry>
5526 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5533 Triggers in <productname>PostgreSQL</productname> have two
5534 incompatibilities with the SQL standard that affect the
5535 representation in the information schema. First, trigger names are
5536 local to each table in <productname>PostgreSQL</productname>, rather
5537 than being independent schema objects. Therefore there can be duplicate
5538 trigger names defined in one schema, so long as they belong to
5539 different tables. (<literal>trigger_catalog</literal> and
5540 <literal>trigger_schema</literal> are really the values pertaining
5541 to the table that the trigger is defined on.) Second, triggers can
5542 be defined to fire on multiple events in
5543 <productname>PostgreSQL</productname> (e.g., <literal>ON INSERT OR
5544 UPDATE</literal>), whereas the SQL standard only allows one. If a
5545 trigger is defined to fire on multiple events, it is represented as
5546 multiple rows in the information schema, one for each type of
5547 event. As a consequence of these two issues, the primary key of
5548 the view <literal>triggers</literal> is really
5549 <literal>(trigger_catalog, trigger_schema, event_object_table,
5550 trigger_name, event_manipulation)</literal> instead of
5551 <literal>(trigger_catalog, trigger_schema, trigger_name)</literal>,
5552 which is what the SQL standard specifies. Nonetheless, if you
5553 define your triggers in a manner that conforms with the SQL
5554 standard (trigger names unique in the schema and only one event
5555 type per trigger), this will not affect you.
5560 Prior to <productname>PostgreSQL</> 9.1, this view's columns
5561 <structfield>action_timing</structfield>,
5562 <structfield>action_reference_old_table</structfield>,
5563 <structfield>action_reference_new_table</structfield>,
5564 <structfield>action_reference_old_row</structfield>, and
5565 <structfield>action_reference_new_row</structfield>
5567 <structfield>condition_timing</structfield>,
5568 <structfield>condition_reference_old_table</structfield>,
5569 <structfield>condition_reference_new_table</structfield>,
5570 <structfield>condition_reference_old_row</structfield>, and
5571 <structfield>condition_reference_new_row</structfield>
5573 That was how they were named in the SQL:1999 standard.
5574 The new naming conforms to SQL:2003 and later.
5579 <sect1 id="infoschema-udt-privileges">
5580 <title><literal>udt_privileges</literal></title>
5583 The view <literal>udt_privileges</literal> is intended to identify
5584 <literal>USAGE</literal> privileges granted on user-defined types
5585 to a currently enabled role or by a currently enabled role. Since
5586 data types do not have real privileges
5587 in <productname>PostgreSQL</productname>, this view shows implicit
5588 non-grantable <literal>USAGE</literal> privileges granted by the
5589 owner to <literal>PUBLIC</literal> for all types, including
5590 built-in ones (except domains,
5591 see <xref linkend="infoschema-usage-privileges"> for that).
5595 <title><literal>udt_privileges</literal> Columns</title>
5601 <entry>Data Type</entry>
5602 <entry>Description</entry>
5608 <entry><literal>grantor</literal></entry>
5609 <entry><type>sql_identifier</type></entry>
5610 <entry>Name of the role that granted the privilege</entry>
5614 <entry><literal>grantee</literal></entry>
5615 <entry><type>sql_identifier</type></entry>
5616 <entry>Name of the role that the privilege was granted to</entry>
5620 <entry><literal>udt_catalog</literal></entry>
5621 <entry><type>sql_identifier</type></entry>
5622 <entry>Name of the database containing the type (always the current database)</entry>
5626 <entry><literal>udt_schema</literal></entry>
5627 <entry><type>sql_identifier</type></entry>
5628 <entry>Name of the schema containing the type</entry>
5632 <entry><literal>udt_name</literal></entry>
5633 <entry><type>sql_identifier</type></entry>
5634 <entry>Name of the type</entry>
5638 <entry><literal>privilege_type</literal></entry>
5639 <entry><type>character_data</type></entry>
5640 <entry>Always <literal>TYPE USAGE</literal></entry>
5644 <entry><literal>is_grantable</literal></entry>
5645 <entry><type>yes_or_no</type></entry>
5646 <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
5653 <sect1 id="infoschema-usage-privileges">
5654 <title><literal>usage_privileges</literal></title>
5657 The view <literal>usage_privileges</literal> identifies
5658 <literal>USAGE</literal> privileges granted on various kinds of
5659 objects to a currently enabled role or by a currently enabled role.
5660 In <productname>PostgreSQL</productname>, this currently applies to
5661 collations, domains, foreign-data wrappers, and foreign servers. There is one
5662 row for each combination of object, grantor, and grantee.
5666 Since collations and domains do not have real privileges
5667 in <productname>PostgreSQL</productname>, this view shows implicit
5668 non-grantable <literal>USAGE</literal> privileges granted by the
5669 owner to <literal>PUBLIC</literal> for all collations and domains. The other
5670 object types, however, show real privileges.
5674 <title><literal>usage_privileges</literal> Columns</title>
5680 <entry>Data Type</entry>
5681 <entry>Description</entry>
5687 <entry><literal>grantor</literal></entry>
5688 <entry><type>sql_identifier</type></entry>
5689 <entry>Name of the role that granted the privilege</entry>
5693 <entry><literal>grantee</literal></entry>
5694 <entry><type>sql_identifier</type></entry>
5695 <entry>Name of the role that the privilege was granted to</entry>
5699 <entry><literal>object_catalog</literal></entry>
5700 <entry><type>sql_identifier</type></entry>
5701 <entry>Name of the database containing the object (always the current database)</entry>
5705 <entry><literal>object_schema</literal></entry>
5706 <entry><type>sql_identifier</type></entry>
5707 <entry>Name of the schema containing the object, if applicable,
5708 else an empty string</entry>
5712 <entry><literal>object_name</literal></entry>
5713 <entry><type>sql_identifier</type></entry>
5714 <entry>Name of the object</entry>
5718 <entry><literal>object_type</literal></entry>
5719 <entry><type>character_data</type></entry>
5720 <entry><literal>COLLATION</literal> or <literal>DOMAIN</literal> or <literal>FOREIGN DATA WRAPPER</literal> or <literal>FOREIGN SERVER</literal></entry>
5724 <entry><literal>privilege_type</literal></entry>
5725 <entry><type>character_data</type></entry>
5726 <entry>Always <literal>USAGE</literal></entry>
5730 <entry><literal>is_grantable</literal></entry>
5731 <entry><type>yes_or_no</type></entry>
5732 <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
5739 <sect1 id="infoschema-user-defined-types">
5740 <title><literal>user_defined_types</literal></title>
5743 The view <literal>user_defined_types</literal> currently contains
5744 all composite types defined in the current database.
5748 SQL knows about two kinds of user-defined types: structured types
5749 (also known as composite types
5750 in <productname>PostgreSQL</productname>) and distinct types (not
5751 implemented in <productname>PostgreSQL</productname>). To be
5752 future-proof, use the
5753 column <literal>user_defined_type_category</literal> to
5754 differentiate between these. Other user-defined types such as base
5755 types and enums, which are <productname>PostgreSQL</productname>
5756 extensions, are not shown here. For domains,
5757 see <xref linkend="infoschema-domains"> instead.
5761 <title><literal>user_defined_types</literal> Columns</title>
5767 <entry>Data Type</entry>
5768 <entry>Description</entry>
5774 <entry><literal>user_defined_type_catalog</literal></entry>
5775 <entry><type>sql_identifier</type></entry>
5776 <entry>Name of the database that contains the type (always the current database)</entry>
5780 <entry><literal>user_defined_type_schema</literal></entry>
5781 <entry><type>sql_identifier</type></entry>
5782 <entry>Name of the schema that contains the type</entry>
5786 <entry><literal>user_defined_type_name</literal></entry>
5787 <entry><type>sql_identifier</type></entry>
5788 <entry>Name of the type</entry>
5792 <entry><literal>user_defined_type_category</literal></entry>
5793 <entry><type>character_data</type></entry>
5795 Currently always <literal>STRUCTURED</literal>
5800 <entry><literal>is_instantiable</literal></entry>
5801 <entry><type>yes_or_no</type></entry>
5802 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5806 <entry><literal>is_final</literal></entry>
5807 <entry><type>yes_or_no</type></entry>
5808 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5812 <entry><literal>ordering_form</literal></entry>
5813 <entry><type>character_data</type></entry>
5814 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5818 <entry><literal>ordering_category</literal></entry>
5819 <entry><type>character_data</type></entry>
5820 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5824 <entry><literal>ordering_routine_catalog</literal></entry>
5825 <entry><type>sql_identifier</type></entry>
5826 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5830 <entry><literal>ordering_routine_schema</literal></entry>
5831 <entry><type>sql_identifier</type></entry>
5832 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5836 <entry><literal>ordering_routine_name</literal></entry>
5837 <entry><type>sql_identifier</type></entry>
5838 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5842 <entry><literal>reference_type</literal></entry>
5843 <entry><type>character_data</type></entry>
5844 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5848 <entry><literal>data_type</literal></entry>
5849 <entry><type>character_data</type></entry>
5851 Always <literal>USER-DEFINED TYPE</literal> (for joining
5852 against <literal>object_type</literal> columns in other
5858 <entry><literal>character_maximum_length</literal></entry>
5859 <entry><type>cardinal_number</type></entry>
5860 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5864 <entry><literal>character_octet_length</literal></entry>
5865 <entry><type>cardinal_number</type></entry>
5866 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5870 <entry><literal>character_set_catalog</literal></entry>
5871 <entry><type>sql_identifier</type></entry>
5872 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5876 <entry><literal>character_set_schema</literal></entry>
5877 <entry><type>sql_identifier</type></entry>
5878 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5882 <entry><literal>character_set_name</literal></entry>
5883 <entry><type>sql_identifier</type></entry>
5884 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5888 <entry><literal>collation_catalog</literal></entry>
5889 <entry><type>sql_identifier</type></entry>
5890 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5894 <entry><literal>collation_schema</literal></entry>
5895 <entry><type>sql_identifier</type></entry>
5896 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5900 <entry><literal>collation_name</literal></entry>
5901 <entry><type>sql_identifier</type></entry>
5902 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5906 <entry><literal>numeric_precision</literal></entry>
5907 <entry><type>cardinal_number</type></entry>
5908 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5912 <entry><literal>numeric_precision_radix</literal></entry>
5913 <entry><type>cardinal_number</type></entry>
5914 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5918 <entry><literal>numeric_scale</literal></entry>
5919 <entry><type>cardinal_number</type></entry>
5920 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5924 <entry><literal>datetime_precision</literal></entry>
5925 <entry><type>cardinal_number</type></entry>
5926 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5930 <entry><literal>interval_type</literal></entry>
5931 <entry><type>character_data</type></entry>
5932 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5936 <entry><literal>interval_precision</literal></entry>
5937 <entry><type>character_data</type></entry>
5938 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5942 <entry><literal>source_dtd_identifier</literal></entry>
5943 <entry><type>sql_identifier</type></entry>
5944 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5948 <entry><literal>ref_dtd_identifier</literal></entry>
5949 <entry><type>sql_identifier</type></entry>
5950 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5957 <sect1 id="infoschema-user-mapping-options">
5958 <title><literal>user_mapping_options</literal></title>
5961 The view <literal>user_mapping_options</literal> contains all the
5962 options defined for user mappings in the current database. Only
5963 those user mappings are shown where the current user has access to
5964 the corresponding foreign server (by way of being the owner or
5965 having some privilege).
5969 <title><literal>user_mapping_options</literal> Columns</title>
5975 <entry>Data Type</entry>
5976 <entry>Description</entry>
5982 <entry><literal>authorization_identifier</literal></entry>
5983 <entry><type>sql_identifier</type></entry>
5984 <entry>Name of the user being mapped,
5985 or <literal>PUBLIC</literal> if the mapping is public</entry>
5989 <entry><literal>foreign_server_catalog</literal></entry>
5990 <entry><type>sql_identifier</type></entry>
5991 <entry>Name of the database that the foreign server used by this
5992 mapping is defined in (always the current database)</entry>
5996 <entry><literal>foreign_server_name</literal></entry>
5997 <entry><type>sql_identifier</type></entry>
5998 <entry>Name of the foreign server used by this mapping</entry>
6002 <entry><literal>option_name</literal></entry>
6003 <entry><type>sql_identifier</type></entry>
6004 <entry>Name of an option</entry>
6008 <entry><literal>option_value</literal></entry>
6009 <entry><type>character_data</type></entry>
6010 <entry>Value of the option. This column will show as null
6011 unless the current user is the user being mapped, or the mapping
6012 is for <literal>PUBLIC</literal> and the current user is the
6013 server owner, or the current user is a superuser. The intent is
6014 to protect password information stored as user mapping
6022 <sect1 id="infoschema-user-mappings">
6023 <title><literal>user_mappings</literal></title>
6026 The view <literal>user_mappings</literal> contains all user
6027 mappings defined in the current database. Only those user mappings
6028 are shown where the current user has access to the corresponding
6029 foreign server (by way of being the owner or having some
6034 <title><literal>user_mappings</literal> Columns</title>
6040 <entry>Data Type</entry>
6041 <entry>Description</entry>
6047 <entry><literal>authorization_identifier</literal></entry>
6048 <entry><type>sql_identifier</type></entry>
6049 <entry>Name of the user being mapped,
6050 or <literal>PUBLIC</literal> if the mapping is public</entry>
6054 <entry><literal>foreign_server_catalog</literal></entry>
6055 <entry><type>sql_identifier</type></entry>
6056 <entry>Name of the database that the foreign server used by this
6057 mapping is defined in (always the current database)</entry>
6061 <entry><literal>foreign_server_name</literal></entry>
6062 <entry><type>sql_identifier</type></entry>
6063 <entry>Name of the foreign server used by this mapping</entry>
6070 <sect1 id="infoschema-view-column-usage">
6071 <title><literal>view_column_usage</literal></title>
6074 The view <literal>view_column_usage</literal> identifies all
6075 columns that are used in the query expression of a view (the
6076 <command>SELECT</command> statement that defines the view). A
6077 column is only included if the table that contains the column is
6078 owned by a currently enabled role.
6083 Columns of system tables are not included. This should be fixed
6089 <title><literal>view_column_usage</literal> Columns</title>
6095 <entry>Data Type</entry>
6096 <entry>Description</entry>
6102 <entry><literal>view_catalog</literal></entry>
6103 <entry><type>sql_identifier</type></entry>
6104 <entry>Name of the database that contains the view (always the current database)</entry>
6108 <entry><literal>view_schema</literal></entry>
6109 <entry><type>sql_identifier</type></entry>
6110 <entry>Name of the schema that contains the view</entry>
6114 <entry><literal>view_name</literal></entry>
6115 <entry><type>sql_identifier</type></entry>
6116 <entry>Name of the view</entry>
6120 <entry><literal>table_catalog</literal></entry>
6121 <entry><type>sql_identifier</type></entry>
6123 Name of the database that contains the table that contains the
6124 column that is used by the view (always the current database)
6129 <entry><literal>table_schema</literal></entry>
6130 <entry><type>sql_identifier</type></entry>
6132 Name of the schema that contains the table that contains the
6133 column that is used by the view
6138 <entry><literal>table_name</literal></entry>
6139 <entry><type>sql_identifier</type></entry>
6141 Name of the table that contains the column that is used by the
6147 <entry><literal>column_name</literal></entry>
6148 <entry><type>sql_identifier</type></entry>
6149 <entry>Name of the column that is used by the view</entry>
6156 <sect1 id="infoschema-view-routine-usage">
6157 <title><literal>view_routine_usage</literal></title>
6160 The view <literal>view_routine_usage</literal> identifies all
6161 routines (functions and procedures) that are used in the query
6162 expression of a view (the <command>SELECT</command> statement that
6163 defines the view). A routine is only included if that routine is
6164 owned by a currently enabled role.
6168 <title><literal>view_routine_usage</literal> Columns</title>
6174 <entry>Data Type</entry>
6175 <entry>Description</entry>
6181 <entry><literal>table_catalog</literal></entry>
6182 <entry><literal>sql_identifier</literal></entry>
6183 <entry>Name of the database containing the view (always the current database)</entry>
6187 <entry><literal>table_schema</literal></entry>
6188 <entry><literal>sql_identifier</literal></entry>
6189 <entry>Name of the schema containing the view</entry>
6193 <entry><literal>table_name</literal></entry>
6194 <entry><literal>sql_identifier</literal></entry>
6195 <entry>Name of the view</entry>
6199 <entry><literal>specific_catalog</literal></entry>
6200 <entry><literal>sql_identifier</literal></entry>
6201 <entry>Name of the database containing the function (always the current database)</entry>
6205 <entry><literal>specific_schema</literal></entry>
6206 <entry><literal>sql_identifier</literal></entry>
6207 <entry>Name of the schema containing the function</entry>
6211 <entry><literal>specific_name</literal></entry>
6212 <entry><literal>sql_identifier</literal></entry>
6214 The <quote>specific name</quote> of the function. See <xref
6215 linkend="infoschema-routines"> for more information.
6223 <sect1 id="infoschema-view-table-usage">
6224 <title><literal>view_table_usage</literal></title>
6227 The view <literal>view_table_usage</literal> identifies all tables
6228 that are used in the query expression of a view (the
6229 <command>SELECT</command> statement that defines the view). A
6230 table is only included if that table is owned by a currently
6236 System tables are not included. This should be fixed sometime.
6241 <title><literal>view_table_usage</literal> Columns</title>
6247 <entry>Data Type</entry>
6248 <entry>Description</entry>
6254 <entry><literal>view_catalog</literal></entry>
6255 <entry><type>sql_identifier</type></entry>
6256 <entry>Name of the database that contains the view (always the current database)</entry>
6260 <entry><literal>view_schema</literal></entry>
6261 <entry><type>sql_identifier</type></entry>
6262 <entry>Name of the schema that contains the view</entry>
6266 <entry><literal>view_name</literal></entry>
6267 <entry><type>sql_identifier</type></entry>
6268 <entry>Name of the view</entry>
6272 <entry><literal>table_catalog</literal></entry>
6273 <entry><type>sql_identifier</type></entry>
6275 Name of the database that contains the table that is
6276 used by the view (always the current database)
6281 <entry><literal>table_schema</literal></entry>
6282 <entry><type>sql_identifier</type></entry>
6284 Name of the schema that contains the table that is used by the
6290 <entry><literal>table_name</literal></entry>
6291 <entry><type>sql_identifier</type></entry>
6293 Name of the table that is used by the view
6301 <sect1 id="infoschema-views">
6302 <title><literal>views</literal></title>
6305 The view <literal>views</literal> contains all views defined in the
6306 current database. Only those views are shown that the current user
6307 has access to (by way of being the owner or having some privilege).
6311 <title><literal>views</literal> Columns</title>
6317 <entry>Data Type</entry>
6318 <entry>Description</entry>
6324 <entry><literal>table_catalog</literal></entry>
6325 <entry><type>sql_identifier</type></entry>
6326 <entry>Name of the database that contains the view (always the current database)</entry>
6330 <entry><literal>table_schema</literal></entry>
6331 <entry><type>sql_identifier</type></entry>
6332 <entry>Name of the schema that contains the view</entry>
6336 <entry><literal>table_name</literal></entry>
6337 <entry><type>sql_identifier</type></entry>
6338 <entry>Name of the view</entry>
6342 <entry><literal>view_definition</literal></entry>
6343 <entry><type>character_data</type></entry>
6345 Query expression defining the view (null if the view is not
6346 owned by a currently enabled role)
6351 <entry><literal>check_option</literal></entry>
6352 <entry><type>character_data</type></entry>
6353 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
6357 <entry><literal>is_updatable</literal></entry>
6358 <entry><type>yes_or_no</type></entry>
6360 <literal>YES</literal> if the view is updatable (allows
6361 <command>UPDATE</command> and <command>DELETE</command>),
6362 <literal>NO</literal> if not
6367 <entry><literal>is_insertable_into</literal></entry>
6368 <entry><type>yes_or_no</type></entry>
6370 <literal>YES</literal> if the view is insertable into (allows
6371 <command>INSERT</command>), <literal>NO</literal> if not
6376 <entry><literal>is_trigger_updatable</literal></entry>
6377 <entry><type>yes_or_no</type></entry>
6379 <literal>YES</> if the view has an <literal>INSTEAD OF</>
6380 <command>UPDATE</> trigger defined on it, <literal>NO</> if not
6385 <entry><literal>is_trigger_deletable</literal></entry>
6386 <entry><type>yes_or_no</type></entry>
6388 <literal>YES</> if the view has an <literal>INSTEAD OF</>
6389 <command>DELETE</> trigger defined on it, <literal>NO</> if not
6394 <entry><literal>is_trigger_insertable_into</literal></entry>
6395 <entry><type>yes_or_no</type></entry>
6397 <literal>YES</> if the view has an <literal>INSTEAD OF</>
6398 <command>INSERT</> trigger defined on it, <literal>NO</> if not