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 like
38 <literal>referential_constraints</>, <literal>check_constraints</>,
39 <literal>domain_constraints</>, and
40 <literal>check_constraint_routine_usage</>. Some other views have
41 similar issues but contain the table name to help distinguish
42 duplicate rows, e.g. <literal>table_constraints</>,
43 <literal>constraint_table_usage</>, <literal>constraint_column_usage</>.
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-applicability">
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,
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.dtd_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>DOMAIN</literal> (the array is used by
2216 that domain), <literal>ROUTINE</literal> (the array is used by
2217 a parameter or the return data type of that function).
2222 <entry><literal>dtd_identifier</literal></entry>
2223 <entry><type>sql_identifier</type></entry>
2225 The identifier of the data type descriptor of the array being
2231 <entry><literal>data_type</literal></entry>
2232 <entry><type>character_data</type></entry>
2234 Data type of the array elements, if it is a built-in type, else
2235 <literal>USER-DEFINED</literal> (in that case, the type is
2236 identified in <literal>udt_name</literal> and associated
2242 <entry><literal>character_maximum_length</literal></entry>
2243 <entry><type>cardinal_number</type></entry>
2244 <entry>Always null, since this information is not applied to array element data types in <productname>PostgreSQL</></entry>
2248 <entry><literal>character_octet_length</literal></entry>
2249 <entry><type>cardinal_number</type></entry>
2250 <entry>Always null, since this information is not applied to array element data types in <productname>PostgreSQL</></entry>
2254 <entry><literal>character_set_catalog</literal></entry>
2255 <entry><type>sql_identifier</type></entry>
2256 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2260 <entry><literal>character_set_schema</literal></entry>
2261 <entry><type>sql_identifier</type></entry>
2262 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2266 <entry><literal>character_set_name</literal></entry>
2267 <entry><type>sql_identifier</type></entry>
2268 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2272 <entry><literal>collation_catalog</literal></entry>
2273 <entry><type>sql_identifier</type></entry>
2274 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2278 <entry><literal>collation_schema</literal></entry>
2279 <entry><type>sql_identifier</type></entry>
2280 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2284 <entry><literal>collation_name</literal></entry>
2285 <entry><type>sql_identifier</type></entry>
2286 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2290 <entry><literal>numeric_precision</literal></entry>
2291 <entry><type>cardinal_number</type></entry>
2292 <entry>Always null, since this information is not applied to array element data types in <productname>PostgreSQL</></entry>
2296 <entry><literal>numeric_precision_radix</literal></entry>
2297 <entry><type>cardinal_number</type></entry>
2298 <entry>Always null, since this information is not applied to array element data types in <productname>PostgreSQL</></entry>
2302 <entry><literal>numeric_scale</literal></entry>
2303 <entry><type>cardinal_number</type></entry>
2304 <entry>Always null, since this information is not applied to array element data types in <productname>PostgreSQL</></entry>
2308 <entry><literal>datetime_precision</literal></entry>
2309 <entry><type>cardinal_number</type></entry>
2310 <entry>Always null, since this information is not applied to array element data types in <productname>PostgreSQL</></entry>
2314 <entry><literal>interval_type</literal></entry>
2315 <entry><type>character_data</type></entry>
2316 <entry>Always null, since this information is not applied to array element data types in <productname>PostgreSQL</></entry>
2320 <entry><literal>interval_precision</literal></entry>
2321 <entry><type>character_data</type></entry>
2322 <entry>Always null, since this information is not applied to array element data types in <productname>PostgreSQL</></entry>
2326 <entry><literal>domain_default</literal></entry>
2327 <entry><type>character_data</type></entry>
2328 <entry>Not yet implemented</entry>
2332 <entry><literal>udt_catalog</literal></entry>
2333 <entry><type>sql_identifier</type></entry>
2335 Name of the database that the data type of the elements is
2336 defined in (always the current database)
2341 <entry><literal>udt_schema</literal></entry>
2342 <entry><type>sql_identifier</type></entry>
2344 Name of the schema that the data type of the elements is
2350 <entry><literal>udt_name</literal></entry>
2351 <entry><type>sql_identifier</type></entry>
2353 Name of the data type of the elements
2358 <entry><literal>scope_catalog</literal></entry>
2359 <entry><type>sql_identifier</type></entry>
2360 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2364 <entry><literal>scope_schema</literal></entry>
2365 <entry><type>sql_identifier</type></entry>
2366 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2370 <entry><literal>scope_name</literal></entry>
2371 <entry><type>sql_identifier</type></entry>
2372 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2376 <entry><literal>maximum_cardinality</literal></entry>
2377 <entry><type>cardinal_number</type></entry>
2378 <entry>Always null, because arrays always have unlimited maximum cardinality in <productname>PostgreSQL</></entry>
2386 <sect1 id="infoschema-enabled-roles">
2387 <title><literal>enabled_roles</literal></title>
2390 The view <literal>enabled_roles</literal> identifies the currently
2391 <quote>enabled roles</quote>. The enabled roles are recursively
2392 defined as the current user together with all roles that have been
2393 granted to the enabled roles with automatic inheritance. In other
2394 words, these are all roles that the current user has direct or
2395 indirect, automatically inheriting membership in.
2396 <indexterm><primary>enabled role</primary></indexterm>
2397 <indexterm><primary>role</primary><secondary>enabled</secondary></indexterm>
2401 For permission checking, the set of <quote>applicable roles</quote>
2402 is applied, which can be broader than the set of enabled roles. So
2403 generally, it is better to use the view
2404 <literal>applicable_roles</literal> instead of this one; see also
2409 <title><literal>enabled_roles</literal> Columns</title>
2415 <entry>Data Type</entry>
2416 <entry>Description</entry>
2422 <entry><literal>role_name</literal></entry>
2423 <entry><type>sql_identifier</type></entry>
2424 <entry>Name of a role</entry>
2431 <sect1 id="infoschema-foreign-data-wrapper-options">
2432 <title><literal>foreign_data_wrapper_options</literal></title>
2435 The view <literal>foreign_data_wrapper_options</literal> contains
2436 all the options defined for foreign-data wrappers in the current
2437 database. Only those foreign-data wrappers are shown that the
2438 current user has access to (by way of being the owner or having
2443 <title><literal>foreign_data_wrapper_options</literal> Columns</title>
2449 <entry>Data Type</entry>
2450 <entry>Description</entry>
2456 <entry><literal>foreign_data_wrapper_catalog</literal></entry>
2457 <entry><type>sql_identifier</type></entry>
2458 <entry>Name of the database that the foreign-data wrapper is defined in (always the current database)</entry>
2462 <entry><literal>foreign_data_wrapper_name</literal></entry>
2463 <entry><type>sql_identifier</type></entry>
2464 <entry>Name of the foreign-data wrapper</entry>
2468 <entry><literal>option_name</literal></entry>
2469 <entry><type>sql_identifier</type></entry>
2470 <entry>Name of an option</entry>
2474 <entry><literal>option_value</literal></entry>
2475 <entry><type>character_data</type></entry>
2476 <entry>Value of the option</entry>
2483 <sect1 id="infoschema-foreign-data-wrappers">
2484 <title><literal>foreign_data_wrappers</literal></title>
2487 The view <literal>foreign_data_wrappers</literal> contains all
2488 foreign-data wrappers defined in the current database. Only those
2489 foreign-data wrappers are shown that the current user has access to
2490 (by way of being the owner or having some privilege).
2494 <title><literal>foreign_data_wrappers</literal> Columns</title>
2500 <entry>Data Type</entry>
2501 <entry>Description</entry>
2507 <entry><literal>foreign_data_wrapper_catalog</literal></entry>
2508 <entry><type>sql_identifier</type></entry>
2509 <entry>Name of the database that contains the foreign-data
2510 wrapper (always the current database)</entry>
2514 <entry><literal>foreign_data_wrapper_name</literal></entry>
2515 <entry><type>sql_identifier</type></entry>
2516 <entry>Name of the foreign-data wrapper</entry>
2520 <entry><literal>authorization_identifier</literal></entry>
2521 <entry><type>sql_identifier</type></entry>
2522 <entry>Name of the owner of the foreign server</entry>
2526 <entry><literal>library_name</literal></entry>
2527 <entry><type>character_data</type></entry>
2528 <entry>File name of the library that implementing this foreign-data wrapper</entry>
2532 <entry><literal>foreign_data_wrapper_language</literal></entry>
2533 <entry><type>character_data</type></entry>
2534 <entry>Language used to implement this foreign-data wrapper</entry>
2541 <sect1 id="infoschema-foreign-server-options">
2542 <title><literal>foreign_server_options</literal></title>
2545 The view <literal>foreign_server_options</literal> contains all the
2546 options defined for foreign servers in the current database. Only
2547 those foreign servers are shown that the current user has access to
2548 (by way of being the owner or having some privilege).
2552 <title><literal>foreign_server_options</literal> Columns</title>
2558 <entry>Data Type</entry>
2559 <entry>Description</entry>
2565 <entry><literal>foreign_server_catalog</literal></entry>
2566 <entry><type>sql_identifier</type></entry>
2567 <entry>Name of the database that the foreign server is defined in (always the current database)</entry>
2571 <entry><literal>foreign_server_name</literal></entry>
2572 <entry><type>sql_identifier</type></entry>
2573 <entry>Name of the foreign server</entry>
2577 <entry><literal>option_name</literal></entry>
2578 <entry><type>sql_identifier</type></entry>
2579 <entry>Name of an option</entry>
2583 <entry><literal>option_value</literal></entry>
2584 <entry><type>character_data</type></entry>
2585 <entry>Value of the option</entry>
2592 <sect1 id="infoschema-foreign-servers">
2593 <title><literal>foreign_servers</literal></title>
2596 The view <literal>foreign_servers</literal> contains all foreign
2597 servers defined in the current database. Only those foreign
2598 servers are shown that the current user has access to (by way of
2599 being the owner or having some privilege).
2603 <title><literal>foreign_servers</literal> Columns</title>
2609 <entry>Data Type</entry>
2610 <entry>Description</entry>
2616 <entry><literal>foreign_server_catalog</literal></entry>
2617 <entry><type>sql_identifier</type></entry>
2618 <entry>Name of the database that the foreign server is defined in (always the current database)</entry>
2622 <entry><literal>foreign_server_name</literal></entry>
2623 <entry><type>sql_identifier</type></entry>
2624 <entry>Name of the foreign server</entry>
2628 <entry><literal>foreign_data_wrapper_catalog</literal></entry>
2629 <entry><type>sql_identifier</type></entry>
2630 <entry>Name of the database that contains the foreign-data
2631 wrapper used by the foreign server (always the current database)</entry>
2635 <entry><literal>foreign_data_wrapper_name</literal></entry>
2636 <entry><type>sql_identifier</type></entry>
2637 <entry>Name of the foreign-data wrapper used by the foreign server</entry>
2641 <entry><literal>foreign_server_type</literal></entry>
2642 <entry><type>character_data</type></entry>
2643 <entry>Foreign server type information, if specified upon creation</entry>
2647 <entry><literal>foreign_server_version</literal></entry>
2648 <entry><type>character_data</type></entry>
2649 <entry>Foreign server version information, if specified upon creation</entry>
2653 <entry><literal>authorization_identifier</literal></entry>
2654 <entry><type>sql_identifier</type></entry>
2655 <entry>Name of the owner of the foreign server</entry>
2662 <sect1 id="infoschema-foreign-table-options">
2663 <title><literal>foreign_table_options</literal></title>
2666 The view <literal>foreign_table_options</literal> contains all the
2667 options defined for foreign tables in the current database. Only
2668 those foreign tables are shown that the current user has access to
2669 (by way of being the owner or having some privilege).
2673 <title><literal>foreign_table_options</literal> Columns</title>
2679 <entry>Data Type</entry>
2680 <entry>Description</entry>
2686 <entry><literal>foreign_table_catalog</literal></entry>
2687 <entry><type>sql_identifier</type></entry>
2688 <entry>Name of the database that contains the foreign table (always the current database)</entry>
2692 <entry><literal>foreign_table_schema</literal></entry>
2693 <entry><type>sql_identifier</type></entry>
2694 <entry>Name of the schema that contains the foreign table</entry>
2698 <entry><literal>foreign_table_name</literal></entry>
2699 <entry><type>sql_identifier</type></entry>
2700 <entry>Name of the foreign table</entry>
2704 <entry><literal>foreign_server_catalog</literal></entry>
2705 <entry><type>sql_identifier</type></entry>
2706 <entry>Name of the database that the foreign server is defined in (always the current database)</entry>
2710 <entry><literal>foreign_server_name</literal></entry>
2711 <entry><type>sql_identifier</type></entry>
2712 <entry>Name of the foreign server</entry>
2716 <entry><literal>option_name</literal></entry>
2717 <entry><type>sql_identifier</type></entry>
2718 <entry>Name of an option</entry>
2722 <entry><literal>option_value</literal></entry>
2723 <entry><type>character_data</type></entry>
2724 <entry>Value of the option</entry>
2731 <sect1 id="infoschema-foreign-tables">
2732 <title><literal>foreign_tables</literal></title>
2735 The view <literal>foreign_tables</literal> contains all foreign
2736 tables defined in the current database. Only those foreign
2737 tables are shown that the current user has access to (by way of
2738 being the owner or having some privilege).
2742 <title><literal>foreign_tables</literal> Columns</title>
2748 <entry>Data Type</entry>
2749 <entry>Description</entry>
2755 <entry><literal>foreign_table_catalog</literal></entry>
2756 <entry><type>sql_identifier</type></entry>
2757 <entry>Name of the database that the foreign table is defined in (always the current database)</entry>
2761 <entry><literal>foreign_table_schema</literal></entry>
2762 <entry><type>sql_identifier</type></entry>
2763 <entry>Name of the schema that contains the foreign table</entry>
2767 <entry><literal>foreign_table_name</literal></entry>
2768 <entry><type>sql_identifier</type></entry>
2769 <entry>Name of the foreign table</entry>
2773 <entry><literal>foreign_server_catalog</literal></entry>
2774 <entry><type>sql_identifier</type></entry>
2775 <entry>Name of the database that the foreign server is defined in (always the current database)</entry>
2779 <entry><literal>foreign_server_name</literal></entry>
2780 <entry><type>sql_identifier</type></entry>
2781 <entry>Name of the foreign server</entry>
2788 <sect1 id="infoschema-key-column-usage">
2789 <title><literal>key_column_usage</literal></title>
2792 The view <literal>key_column_usage</literal> identifies all columns
2793 in the current database that are restricted by some unique, primary
2794 key, or foreign key constraint. Check constraints are not included
2795 in this view. Only those columns are shown that the current user
2796 has access to, by way of being the owner or having some privilege.
2800 <title><literal>key_column_usage</literal> Columns</title>
2806 <entry>Data Type</entry>
2807 <entry>Description</entry>
2813 <entry><literal>constraint_catalog</literal></entry>
2814 <entry><type>sql_identifier</type></entry>
2815 <entry>Name of the database that contains the constraint (always the current database)</entry>
2819 <entry><literal>constraint_schema</literal></entry>
2820 <entry><type>sql_identifier</type></entry>
2821 <entry>Name of the schema that contains the constraint</entry>
2825 <entry><literal>constraint_name</literal></entry>
2826 <entry><type>sql_identifier</type></entry>
2827 <entry>Name of the constraint</entry>
2831 <entry><literal>table_catalog</literal></entry>
2832 <entry><type>sql_identifier</type></entry>
2834 Name of the database that contains the table that contains the
2835 column that is restricted by this constraint (always the
2841 <entry><literal>table_schema</literal></entry>
2842 <entry><type>sql_identifier</type></entry>
2844 Name of the schema that contains the table that contains the
2845 column that is restricted by this constraint
2850 <entry><literal>table_name</literal></entry>
2851 <entry><type>sql_identifier</type></entry>
2853 Name of the table that contains the column that is restricted
2859 <entry><literal>column_name</literal></entry>
2860 <entry><type>sql_identifier</type></entry>
2862 Name of the column that is restricted by this constraint
2867 <entry><literal>ordinal_position</literal></entry>
2868 <entry><type>cardinal_number</type></entry>
2870 Ordinal position of the column within the constraint key (count
2876 <entry><literal>position_in_unique_constraint</literal></entry>
2877 <entry><type>cardinal_number</type></entry>
2879 For a foreign-key constraint, ordinal position of the referenced
2880 column within its unique constraint (count starts at 1);
2889 <sect1 id="infoschema-parameters">
2890 <title><literal>parameters</literal></title>
2893 The view <literal>parameters</literal> contains information about
2894 the parameters (arguments) of all functions in the current database.
2895 Only those functions are shown that the current user has access to
2896 (by way of being the owner or having some privilege).
2900 <title><literal>parameters</literal> Columns</title>
2906 <entry>Data Type</entry>
2907 <entry>Description</entry>
2913 <entry><literal>specific_catalog</literal></entry>
2914 <entry><type>sql_identifier</type></entry>
2915 <entry>Name of the database containing the function (always the current database)</entry>
2919 <entry><literal>specific_schema</literal></entry>
2920 <entry><type>sql_identifier</type></entry>
2921 <entry>Name of the schema containing the function</entry>
2925 <entry><literal>specific_name</literal></entry>
2926 <entry><type>sql_identifier</type></entry>
2928 The <quote>specific name</quote> of the function. See <xref
2929 linkend="infoschema-routines"> for more information.
2934 <entry><literal>ordinal_position</literal></entry>
2935 <entry><type>cardinal_number</type></entry>
2937 Ordinal position of the parameter in the argument list of the
2938 function (count starts at 1)
2943 <entry><literal>parameter_mode</literal></entry>
2944 <entry><type>character_data</type></entry>
2946 <literal>IN</literal> for input parameter,
2947 <literal>OUT</literal> for output parameter,
2948 and <literal>INOUT</literal> for input/output parameter.
2953 <entry><literal>is_result</literal></entry>
2954 <entry><type>yes_or_no</type></entry>
2955 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2959 <entry><literal>as_locator</literal></entry>
2960 <entry><type>yes_or_no</type></entry>
2961 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2965 <entry><literal>parameter_name</literal></entry>
2966 <entry><type>sql_identifier</type></entry>
2967 <entry>Name of the parameter, or null if the parameter has no name</entry>
2971 <entry><literal>data_type</literal></entry>
2972 <entry><type>character_data</type></entry>
2974 Data type of the parameter, if it is a built-in type, or
2975 <literal>ARRAY</literal> if it is some array (in that case, see
2976 the view <literal>element_types</literal>), else
2977 <literal>USER-DEFINED</literal> (in that case, the type is
2978 identified in <literal>udt_name</literal> and associated
2984 <entry><literal>character_maximum_length</literal></entry>
2985 <entry><type>cardinal_number</type></entry>
2986 <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</></entry>
2990 <entry><literal>character_octet_length</literal></entry>
2991 <entry><type>cardinal_number</type></entry>
2992 <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</></entry>
2996 <entry><literal>character_set_catalog</literal></entry>
2997 <entry><type>sql_identifier</type></entry>
2998 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3002 <entry><literal>character_set_schema</literal></entry>
3003 <entry><type>sql_identifier</type></entry>
3004 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3008 <entry><literal>character_set_name</literal></entry>
3009 <entry><type>sql_identifier</type></entry>
3010 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3014 <entry><literal>collation_catalog</literal></entry>
3015 <entry><type>sql_identifier</type></entry>
3016 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3020 <entry><literal>collation_schema</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_name</literal></entry>
3027 <entry><type>sql_identifier</type></entry>
3028 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3032 <entry><literal>numeric_precision</literal></entry>
3033 <entry><type>cardinal_number</type></entry>
3034 <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</></entry>
3038 <entry><literal>numeric_precision_radix</literal></entry>
3039 <entry><type>cardinal_number</type></entry>
3040 <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</></entry>
3044 <entry><literal>numeric_scale</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>datetime_precision</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>interval_type</literal></entry>
3057 <entry><type>character_data</type></entry>
3058 <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</></entry>
3062 <entry><literal>interval_precision</literal></entry>
3063 <entry><type>character_data</type></entry>
3064 <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</></entry>
3068 <entry><literal>udt_catalog</literal></entry>
3069 <entry><type>sql_identifier</type></entry>
3071 Name of the database that the data type of the parameter is
3072 defined in (always the current database)
3077 <entry><literal>udt_schema</literal></entry>
3078 <entry><type>sql_identifier</type></entry>
3080 Name of the schema that the data type of the parameter is
3086 <entry><literal>udt_name</literal></entry>
3087 <entry><type>sql_identifier</type></entry>
3089 Name of the data type of the parameter
3094 <entry><literal>scope_catalog</literal></entry>
3095 <entry><type>sql_identifier</type></entry>
3096 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3100 <entry><literal>scope_schema</literal></entry>
3101 <entry><type>sql_identifier</type></entry>
3102 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3106 <entry><literal>scope_name</literal></entry>
3107 <entry><type>sql_identifier</type></entry>
3108 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3112 <entry><literal>maximum_cardinality</literal></entry>
3113 <entry><type>cardinal_number</type></entry>
3114 <entry>Always null, because arrays always have unlimited maximum cardinality in <productname>PostgreSQL</></entry>
3118 <entry><literal>dtd_identifier</literal></entry>
3119 <entry><type>sql_identifier</type></entry>
3121 An identifier of the data type descriptor of the parameter,
3122 unique among the data type descriptors pertaining to the
3123 function. This is mainly useful for joining with other
3124 instances of such identifiers. (The specific format of the
3125 identifier is not defined and not guaranteed to remain the same
3126 in future versions.)
3134 <sect1 id="infoschema-referential-constraints">
3135 <title><literal>referential_constraints</literal></title>
3138 The view <literal>referential_constraints</literal> contains all
3139 referential (foreign key) constraints in the current database.
3140 Only those constraints are shown for which the current user has
3141 write access to the referencing table (by way of being the
3142 owner or having some privilege other than SELECT).
3146 <title><literal>referential_constraints</literal> Columns</title>
3152 <entry>Data Type</entry>
3153 <entry>Description</entry>
3159 <entry><literal>constraint_catalog</literal></entry>
3160 <entry><literal>sql_identifier</literal></entry>
3161 <entry>Name of the database containing the constraint (always the current database)</entry>
3165 <entry><literal>constraint_schema</literal></entry>
3166 <entry><literal>sql_identifier</literal></entry>
3167 <entry>Name of the schema containing the constraint</entry>
3171 <entry><literal>constraint_name</literal></entry>
3172 <entry><literal>sql_identifier</literal></entry>
3173 <entry>Name of the constraint</entry>
3177 <entry><literal>unique_constraint_catalog</literal></entry>
3178 <entry><literal>sql_identifier</literal></entry>
3180 Name of the database that contains the unique or primary key
3181 constraint that the foreign key constraint references (always
3182 the current database)
3187 <entry><literal>unique_constraint_schema</literal></entry>
3188 <entry><literal>sql_identifier</literal></entry>
3190 Name of the schema that contains the unique or primary key
3191 constraint that the foreign key constraint references
3196 <entry><literal>unique_constraint_name</literal></entry>
3197 <entry><literal>sql_identifier</literal></entry>
3199 Name of the unique or primary key constraint that the foreign
3200 key constraint references
3205 <entry><literal>match_option</literal></entry>
3206 <entry><literal>character_data</literal></entry>
3208 Match option of the foreign key constraint:
3209 <literal>FULL</literal>, <literal>PARTIAL</literal>, or
3210 <literal>NONE</literal>.
3215 <entry><literal>update_rule</literal></entry>
3216 <entry><literal>character_data</literal></entry>
3218 Update rule of the foreign key constraint:
3219 <literal>CASCADE</literal>, <literal>SET NULL</literal>,
3220 <literal>SET DEFAULT</literal>, <literal>RESTRICT</literal>, or
3221 <literal>NO ACTION</literal>.
3226 <entry><literal>delete_rule</literal></entry>
3227 <entry><literal>character_data</literal></entry>
3229 Delete rule of the foreign key constraint:
3230 <literal>CASCADE</literal>, <literal>SET NULL</literal>,
3231 <literal>SET DEFAULT</literal>, <literal>RESTRICT</literal>, or
3232 <literal>NO ACTION</literal>.
3241 <sect1 id="infoschema-role-column-grants">
3242 <title><literal>role_column_grants</literal></title>
3245 The view <literal>role_column_grants</literal> identifies all
3246 privileges granted on columns where the grantor or grantee is a
3247 currently enabled role. Further information can be found under
3248 <literal>column_privileges</literal>. The only effective
3249 difference between this view
3250 and <literal>column_privileges</literal> is that this view omits
3251 columns that have been made accessible to the current user by way
3252 of a grant to public.
3256 <title><literal>role_column_grants</literal> Columns</title>
3262 <entry>Data Type</entry>
3263 <entry>Description</entry>
3269 <entry><literal>grantor</literal></entry>
3270 <entry><type>sql_identifier</type></entry>
3271 <entry>Name of the role that granted the privilege</entry>
3275 <entry><literal>grantee</literal></entry>
3276 <entry><type>sql_identifier</type></entry>
3277 <entry>Name of the role that the privilege was granted to</entry>
3281 <entry><literal>table_catalog</literal></entry>
3282 <entry><type>sql_identifier</type></entry>
3283 <entry>Name of the database that contains the table that contains the column (always the current database)</entry>
3287 <entry><literal>table_schema</literal></entry>
3288 <entry><type>sql_identifier</type></entry>
3289 <entry>Name of the schema that contains the table that contains the column</entry>
3293 <entry><literal>table_name</literal></entry>
3294 <entry><type>sql_identifier</type></entry>
3295 <entry>Name of the table that contains the column</entry>
3299 <entry><literal>column_name</literal></entry>
3300 <entry><type>sql_identifier</type></entry>
3301 <entry>Name of the column</entry>
3305 <entry><literal>privilege_type</literal></entry>
3306 <entry><type>character_data</type></entry>
3308 Type of the privilege: <literal>SELECT</literal>,
3309 <literal>INSERT</literal>, <literal>UPDATE</literal>, or
3310 <literal>REFERENCES</literal>
3315 <entry><literal>is_grantable</literal></entry>
3316 <entry><type>yes_or_no</type></entry>
3317 <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
3324 <sect1 id="infoschema-role-routine-grants">
3325 <title><literal>role_routine_grants</literal></title>
3328 The view <literal>role_routine_grants</literal> identifies all
3329 privileges granted on functions where the grantor or grantee is a
3330 currently enabled role. Further information can be found under
3331 <literal>routine_privileges</literal>. The only effective
3332 difference between this view
3333 and <literal>routine_privileges</literal> is that this view omits
3334 functions that have been made accessible to the current user by way
3335 of a grant to public.
3339 <title><literal>role_routine_grants</literal> Columns</title>
3345 <entry>Data Type</entry>
3346 <entry>Description</entry>
3352 <entry><literal>grantor</literal></entry>
3353 <entry><type>sql_identifier</type></entry>
3354 <entry>Name of the role that granted the privilege</entry>
3358 <entry><literal>grantee</literal></entry>
3359 <entry><type>sql_identifier</type></entry>
3360 <entry>Name of the role that the privilege was granted to</entry>
3364 <entry><literal>specific_catalog</literal></entry>
3365 <entry><type>sql_identifier</type></entry>
3366 <entry>Name of the database containing the function (always the current database)</entry>
3370 <entry><literal>specific_schema</literal></entry>
3371 <entry><type>sql_identifier</type></entry>
3372 <entry>Name of the schema containing the function</entry>
3376 <entry><literal>specific_name</literal></entry>
3377 <entry><type>sql_identifier</type></entry>
3379 The <quote>specific name</quote> of the function. See <xref
3380 linkend="infoschema-routines"> for more information.
3385 <entry><literal>routine_catalog</literal></entry>
3386 <entry><type>sql_identifier</type></entry>
3387 <entry>Name of the database containing the function (always the current database)</entry>
3391 <entry><literal>routine_schema</literal></entry>
3392 <entry><type>sql_identifier</type></entry>
3393 <entry>Name of the schema containing the function</entry>
3397 <entry><literal>routine_name</literal></entry>
3398 <entry><type>sql_identifier</type></entry>
3399 <entry>Name of the function (might be duplicated in case of overloading)</entry>
3403 <entry><literal>privilege_type</literal></entry>
3404 <entry><type>character_data</type></entry>
3405 <entry>Always <literal>EXECUTE</literal> (the only privilege type for functions)</entry>
3409 <entry><literal>is_grantable</literal></entry>
3410 <entry><type>yes_or_no</type></entry>
3411 <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
3418 <sect1 id="infoschema-role-table-grants">
3419 <title><literal>role_table_grants</literal></title>
3422 The view <literal>role_table_grants</literal> identifies all
3423 privileges granted on tables or views where the grantor or grantee
3424 is a currently enabled role. Further information can be found
3425 under <literal>table_privileges</literal>. The only effective
3426 difference between this view
3427 and <literal>table_privileges</literal> is that this view omits
3428 tables that have been made accessible to the current user by way of
3433 <title><literal>role_table_grants</literal> Columns</title>
3439 <entry>Data Type</entry>
3440 <entry>Description</entry>
3446 <entry><literal>grantor</literal></entry>
3447 <entry><type>sql_identifier</type></entry>
3448 <entry>Name of the role that granted the privilege</entry>
3452 <entry><literal>grantee</literal></entry>
3453 <entry><type>sql_identifier</type></entry>
3454 <entry>Name of the role that the privilege was granted to</entry>
3458 <entry><literal>table_catalog</literal></entry>
3459 <entry><type>sql_identifier</type></entry>
3460 <entry>Name of the database that contains the table (always the current database)</entry>
3464 <entry><literal>table_schema</literal></entry>
3465 <entry><type>sql_identifier</type></entry>
3466 <entry>Name of the schema that contains the table</entry>
3470 <entry><literal>table_name</literal></entry>
3471 <entry><type>sql_identifier</type></entry>
3472 <entry>Name of the table</entry>
3476 <entry><literal>privilege_type</literal></entry>
3477 <entry><type>character_data</type></entry>
3479 Type of the privilege: <literal>SELECT</literal>,
3480 <literal>INSERT</literal>, <literal>UPDATE</literal>,
3481 <literal>DELETE</literal>, <literal>TRUNCATE</literal>,
3482 <literal>REFERENCES</literal>, or <literal>TRIGGER</literal>
3487 <entry><literal>is_grantable</literal></entry>
3488 <entry><type>yes_or_no</type></entry>
3489 <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
3493 <entry><literal>with_hierarchy</literal></entry>
3494 <entry><type>yes_or_no</type></entry>
3495 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3502 <sect1 id="infoschema-role-usage-grants">
3503 <title><literal>role_usage_grants</literal></title>
3506 The view <literal>role_usage_grants</literal> identifies
3507 <literal>USAGE</literal> privileges granted on various kinds of
3508 objects where the grantor or grantee is a currently enabled role.
3509 Further information can be found under
3510 <literal>usage_privileges</literal>. The only effective difference
3511 between this view and <literal>usage_privileges</literal> is that
3512 this view omits objects that have been made accessible to the
3513 current user by way of a grant to public.
3517 <title><literal>role_usage_grants</literal> Columns</title>
3523 <entry>Data Type</entry>
3524 <entry>Description</entry>
3530 <entry><literal>grantor</literal></entry>
3531 <entry><type>sql_identifier</type></entry>
3532 <entry>The name of the role that granted the privilege</entry>
3536 <entry><literal>grantee</literal></entry>
3537 <entry><type>sql_identifier</type></entry>
3538 <entry>The name of the role that the privilege was granted to</entry>
3542 <entry><literal>object_catalog</literal></entry>
3543 <entry><type>sql_identifier</type></entry>
3544 <entry>Name of the database containing the object (always the current database)</entry>
3548 <entry><literal>object_schema</literal></entry>
3549 <entry><type>sql_identifier</type></entry>
3550 <entry>Name of the schema containing the object, if applicable,
3551 else an empty string</entry>
3555 <entry><literal>object_name</literal></entry>
3556 <entry><type>sql_identifier</type></entry>
3557 <entry>Name of the object</entry>
3561 <entry><literal>object_type</literal></entry>
3562 <entry><type>character_data</type></entry>
3563 <entry><literal>DOMAIN</literal> or <literal>FOREIGN DATA WRAPPER</literal> or <literal>FOREIGN SERVER</literal></entry>
3567 <entry><literal>privilege_type</literal></entry>
3568 <entry><type>character_data</type></entry>
3569 <entry>Always <literal>USAGE</literal></entry>
3573 <entry><literal>is_grantable</literal></entry>
3574 <entry><type>yes_or_no</type></entry>
3575 <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
3582 <sect1 id="infoschema-routine-privileges">
3583 <title><literal>routine_privileges</literal></title>
3586 The view <literal>routine_privileges</literal> identifies all
3587 privileges granted on functions to a currently enabled role or by a
3588 currently enabled role. There is one row for each combination of function,
3589 grantor, and grantee.
3593 <title><literal>routine_privileges</literal> Columns</title>
3599 <entry>Data Type</entry>
3600 <entry>Description</entry>
3606 <entry><literal>grantor</literal></entry>
3607 <entry><type>sql_identifier</type></entry>
3608 <entry>Name of the role that granted the privilege</entry>
3612 <entry><literal>grantee</literal></entry>
3613 <entry><type>sql_identifier</type></entry>
3614 <entry>Name of the role that the privilege was granted to</entry>
3618 <entry><literal>specific_catalog</literal></entry>
3619 <entry><type>sql_identifier</type></entry>
3620 <entry>Name of the database containing the function (always the current database)</entry>
3624 <entry><literal>specific_schema</literal></entry>
3625 <entry><type>sql_identifier</type></entry>
3626 <entry>Name of the schema containing the function</entry>
3630 <entry><literal>specific_name</literal></entry>
3631 <entry><type>sql_identifier</type></entry>
3633 The <quote>specific name</quote> of the function. See <xref
3634 linkend="infoschema-routines"> for more information.
3639 <entry><literal>routine_catalog</literal></entry>
3640 <entry><type>sql_identifier</type></entry>
3641 <entry>Name of the database containing the function (always the current database)</entry>
3645 <entry><literal>routine_schema</literal></entry>
3646 <entry><type>sql_identifier</type></entry>
3647 <entry>Name of the schema containing the function</entry>
3651 <entry><literal>routine_name</literal></entry>
3652 <entry><type>sql_identifier</type></entry>
3653 <entry>Name of the function (might be duplicated in case of overloading)</entry>
3657 <entry><literal>privilege_type</literal></entry>
3658 <entry><type>character_data</type></entry>
3659 <entry>Always <literal>EXECUTE</literal> (the only privilege type for functions)</entry>
3663 <entry><literal>is_grantable</literal></entry>
3664 <entry><type>yes_or_no</type></entry>
3665 <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
3672 <sect1 id="infoschema-routines">
3673 <title><literal>routines</literal></title>
3676 The view <literal>routines</literal> contains all functions in the
3677 current database. Only those functions are shown that the current
3678 user has access to (by way of being the owner or having some
3683 <title><literal>routines</literal> Columns</title>
3689 <entry>Data Type</entry>
3690 <entry>Description</entry>
3696 <entry><literal>specific_catalog</literal></entry>
3697 <entry><type>sql_identifier</type></entry>
3698 <entry>Name of the database containing the function (always the current database)</entry>
3702 <entry><literal>specific_schema</literal></entry>
3703 <entry><type>sql_identifier</type></entry>
3704 <entry>Name of the schema containing the function</entry>
3708 <entry><literal>specific_name</literal></entry>
3709 <entry><type>sql_identifier</type></entry>
3711 The <quote>specific name</quote> of the function. This is a
3712 name that uniquely identifies the function in the schema, even
3713 if the real name of the function is overloaded. The format of
3714 the specific name is not defined, it should only be used to
3715 compare it to other instances of specific routine names.
3720 <entry><literal>routine_catalog</literal></entry>
3721 <entry><type>sql_identifier</type></entry>
3722 <entry>Name of the database containing the function (always the current database)</entry>
3726 <entry><literal>routine_schema</literal></entry>
3727 <entry><type>sql_identifier</type></entry>
3728 <entry>Name of the schema containing the function</entry>
3732 <entry><literal>routine_name</literal></entry>
3733 <entry><type>sql_identifier</type></entry>
3734 <entry>Name of the function (might be duplicated in case of overloading)</entry>
3738 <entry><literal>routine_type</literal></entry>
3739 <entry><type>character_data</type></entry>
3741 Always <literal>FUNCTION</literal> (In the future there might
3742 be other types of routines.)
3747 <entry><literal>module_catalog</literal></entry>
3748 <entry><type>sql_identifier</type></entry>
3749 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3753 <entry><literal>module_schema</literal></entry>
3754 <entry><type>sql_identifier</type></entry>
3755 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3759 <entry><literal>module_name</literal></entry>
3760 <entry><type>sql_identifier</type></entry>
3761 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3765 <entry><literal>udt_catalog</literal></entry>
3766 <entry><type>sql_identifier</type></entry>
3767 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3771 <entry><literal>udt_schema</literal></entry>
3772 <entry><type>sql_identifier</type></entry>
3773 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3777 <entry><literal>udt_name</literal></entry>
3778 <entry><type>sql_identifier</type></entry>
3779 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3783 <entry><literal>data_type</literal></entry>
3784 <entry><type>character_data</type></entry>
3786 Return data type of the function, if it is a built-in type, or
3787 <literal>ARRAY</literal> if it is some array (in that case, see
3788 the view <literal>element_types</literal>), else
3789 <literal>USER-DEFINED</literal> (in that case, the type is
3790 identified in <literal>type_udt_name</literal> and associated
3796 <entry><literal>character_maximum_length</literal></entry>
3797 <entry><type>cardinal_number</type></entry>
3798 <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
3802 <entry><literal>character_octet_length</literal></entry>
3803 <entry><type>cardinal_number</type></entry>
3804 <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
3808 <entry><literal>character_set_catalog</literal></entry>
3809 <entry><type>sql_identifier</type></entry>
3810 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3814 <entry><literal>character_set_schema</literal></entry>
3815 <entry><type>sql_identifier</type></entry>
3816 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3820 <entry><literal>character_set_name</literal></entry>
3821 <entry><type>sql_identifier</type></entry>
3822 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3826 <entry><literal>collation_catalog</literal></entry>
3827 <entry><type>sql_identifier</type></entry>
3828 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3832 <entry><literal>collation_schema</literal></entry>
3833 <entry><type>sql_identifier</type></entry>
3834 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3838 <entry><literal>collation_name</literal></entry>
3839 <entry><type>sql_identifier</type></entry>
3840 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3844 <entry><literal>numeric_precision</literal></entry>
3845 <entry><type>cardinal_number</type></entry>
3846 <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
3850 <entry><literal>numeric_precision_radix</literal></entry>
3851 <entry><type>cardinal_number</type></entry>
3852 <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
3856 <entry><literal>numeric_scale</literal></entry>
3857 <entry><type>cardinal_number</type></entry>
3858 <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
3862 <entry><literal>datetime_precision</literal></entry>
3863 <entry><type>cardinal_number</type></entry>
3864 <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
3868 <entry><literal>interval_type</literal></entry>
3869 <entry><type>character_data</type></entry>
3870 <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
3874 <entry><literal>interval_precision</literal></entry>
3875 <entry><type>character_data</type></entry>
3876 <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
3880 <entry><literal>type_udt_catalog</literal></entry>
3881 <entry><type>sql_identifier</type></entry>
3883 Name of the database that the return data type of the function
3884 is defined in (always the current database)
3889 <entry><literal>type_udt_schema</literal></entry>
3890 <entry><type>sql_identifier</type></entry>
3892 Name of the schema that the return data type of the function is
3898 <entry><literal>type_udt_name</literal></entry>
3899 <entry><type>sql_identifier</type></entry>
3901 Name of the return data type of the function
3906 <entry><literal>scope_catalog</literal></entry>
3907 <entry><type>sql_identifier</type></entry>
3908 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3912 <entry><literal>scope_schema</literal></entry>
3913 <entry><type>sql_identifier</type></entry>
3914 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3918 <entry><literal>scope_name</literal></entry>
3919 <entry><type>sql_identifier</type></entry>
3920 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3924 <entry><literal>maximum_cardinality</literal></entry>
3925 <entry><type>cardinal_number</type></entry>
3926 <entry>Always null, because arrays always have unlimited maximum cardinality in <productname>PostgreSQL</></entry>
3930 <entry><literal>dtd_identifier</literal></entry>
3931 <entry><type>sql_identifier</type></entry>
3933 An identifier of the data type descriptor of the return data
3934 type of this function, unique among the data type descriptors
3935 pertaining to the function. This is mainly useful for joining
3936 with other instances of such identifiers. (The specific format
3937 of the identifier is not defined and not guaranteed to remain
3938 the same in future versions.)
3943 <entry><literal>routine_body</literal></entry>
3944 <entry><type>character_data</type></entry>
3946 If the function is an SQL function, then
3947 <literal>SQL</literal>, else <literal>EXTERNAL</literal>.
3952 <entry><literal>routine_definition</literal></entry>
3953 <entry><type>character_data</type></entry>
3955 The source text of the function (null if the function is not
3956 owned by a currently enabled role). (According to the SQL
3957 standard, this column is only applicable if
3958 <literal>routine_body</literal> is <literal>SQL</literal>, but
3959 in <productname>PostgreSQL</productname> it will contain
3960 whatever source text was specified when the function was
3966 <entry><literal>external_name</literal></entry>
3967 <entry><type>character_data</type></entry>
3969 If this function is a C function, then the external name (link
3970 symbol) of the function; else null. (This works out to be the
3971 same value that is shown in
3972 <literal>routine_definition</literal>.)
3977 <entry><literal>external_language</literal></entry>
3978 <entry><type>character_data</type></entry>
3979 <entry>The language the function is written in</entry>
3983 <entry><literal>parameter_style</literal></entry>
3984 <entry><type>character_data</type></entry>
3986 Always <literal>GENERAL</literal> (The SQL standard defines
3987 other parameter styles, which are not available in <productname>PostgreSQL</>.)
3992 <entry><literal>is_deterministic</literal></entry>
3993 <entry><type>yes_or_no</type></entry>
3995 If the function is declared immutable (called deterministic in
3996 the SQL standard), then <literal>YES</literal>, else
3997 <literal>NO</literal>. (You cannot query the other volatility
3998 levels available in <productname>PostgreSQL</> through the information schema.)
4003 <entry><literal>sql_data_access</literal></entry>
4004 <entry><type>character_data</type></entry>
4006 Always <literal>MODIFIES</literal>, meaning that the function
4007 possibly modifies SQL data. This information is not useful for
4008 <productname>PostgreSQL</>.
4013 <entry><literal>is_null_call</literal></entry>
4014 <entry><type>yes_or_no</type></entry>
4016 If the function automatically returns null if any of its
4017 arguments are null, then <literal>YES</literal>, else
4018 <literal>NO</literal>.
4023 <entry><literal>sql_path</literal></entry>
4024 <entry><type>character_data</type></entry>
4025 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4029 <entry><literal>schema_level_routine</literal></entry>
4030 <entry><type>yes_or_no</type></entry>
4032 Always <literal>YES</literal> (The opposite would be a method
4033 of a user-defined type, which is a feature not available in
4034 <productname>PostgreSQL</>.)
4039 <entry><literal>max_dynamic_result_sets</literal></entry>
4040 <entry><type>cardinal_number</type></entry>
4041 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4045 <entry><literal>is_user_defined_cast</literal></entry>
4046 <entry><type>yes_or_no</type></entry>
4047 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4051 <entry><literal>is_implicitly_invocable</literal></entry>
4052 <entry><type>yes_or_no</type></entry>
4053 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4057 <entry><literal>security_type</literal></entry>
4058 <entry><type>character_data</type></entry>
4060 If the function runs with the privileges of the current user,
4061 then <literal>INVOKER</literal>, if the function runs with the
4062 privileges of the user who defined it, then
4063 <literal>DEFINER</literal>.
4068 <entry><literal>to_sql_specific_catalog</literal></entry>
4069 <entry><type>sql_identifier</type></entry>
4070 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4074 <entry><literal>to_sql_specific_schema</literal></entry>
4075 <entry><type>sql_identifier</type></entry>
4076 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4080 <entry><literal>to_sql_specific_name</literal></entry>
4081 <entry><type>sql_identifier</type></entry>
4082 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4086 <entry><literal>as_locator</literal></entry>
4087 <entry><type>yes_or_no</type></entry>
4088 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4092 <entry><literal>created</literal></entry>
4093 <entry><type>time_stamp</type></entry>
4094 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4098 <entry><literal>last_altered</literal></entry>
4099 <entry><type>time_stamp</type></entry>
4100 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4104 <entry><literal>new_savepoint_level</literal></entry>
4105 <entry><type>yes_or_no</type></entry>
4106 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4110 <entry><literal>is_udt_dependent</literal></entry>
4111 <entry><type>yes_or_no</type></entry>
4112 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4116 <entry><literal>result_cast_from_data_type</literal></entry>
4117 <entry><type>character_data</type></entry>
4118 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4122 <entry><literal>result_cast_as_locator</literal></entry>
4123 <entry><type>yes_or_no</type></entry>
4124 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4128 <entry><literal>result_cast_char_max_length</literal></entry>
4129 <entry><type>cardinal_number</type></entry>
4130 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4134 <entry><literal>result_cast_char_octet_length</literal></entry>
4135 <entry><type>character_data</type></entry>
4136 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4140 <entry><literal>result_cast_char_set_catalog</literal></entry>
4141 <entry><type>sql_identifier</type></entry>
4142 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4146 <entry><literal>result_cast_char_set_schema</literal></entry>
4147 <entry><type>sql_identifier</type></entry>
4148 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4152 <entry><literal>result_cast_char_set_name</literal></entry>
4153 <entry><type>sql_identifier</type></entry>
4154 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4158 <entry><literal>result_cast_collation_catalog</literal></entry>
4159 <entry><type>sql_identifier</type></entry>
4160 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4164 <entry><literal>result_cast_collation_schema</literal></entry>
4165 <entry><type>sql_identifier</type></entry>
4166 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4170 <entry><literal>result_cast_collation_name</literal></entry>
4171 <entry><type>sql_identifier</type></entry>
4172 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4176 <entry><literal>result_cast_numeric_precision</literal></entry>
4177 <entry><type>cardinal_number</type></entry>
4178 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4182 <entry><literal>result_cast_numeric_precision_radix</literal></entry>
4183 <entry><type>cardinal_number</type></entry>
4184 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4188 <entry><literal>result_cast_numeric_scale</literal></entry>
4189 <entry><type>cardinal_number</type></entry>
4190 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4194 <entry><literal>result_cast_datetime_precision</literal></entry>
4195 <entry><type>character_data</type></entry>
4196 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4200 <entry><literal>result_cast_interval_type</literal></entry>
4201 <entry><type>character_data</type></entry>
4202 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4206 <entry><literal>result_cast_interval_precision</literal></entry>
4207 <entry><type>character_data</type></entry>
4208 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4212 <entry><literal>result_cast_type_udt_catalog</literal></entry>
4213 <entry><type>sql_identifier</type></entry>
4214 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4218 <entry><literal>result_cast_type_udt_schema</literal></entry>
4219 <entry><type>sql_identifier</type></entry>
4220 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4224 <entry><literal>result_cast_type_udt_name</literal></entry>
4225 <entry><type>sql_identifier</type></entry>
4226 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4230 <entry><literal>result_cast_scope_catalog</literal></entry>
4231 <entry><type>sql_identifier</type></entry>
4232 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4236 <entry><literal>result_cast_scope_schema</literal></entry>
4237 <entry><type>sql_identifier</type></entry>
4238 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4242 <entry><literal>result_cast_scope_name</literal></entry>
4243 <entry><type>sql_identifier</type></entry>
4244 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4248 <entry><literal>result_cast_maximum_cardinality</literal></entry>
4249 <entry><type>cardinal_number</type></entry>
4250 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4254 <entry><literal>result_cast_dtd_identifier</literal></entry>
4255 <entry><type>sql_identifier</type></entry>
4256 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4263 <sect1 id="infoschema-schemata">
4264 <title><literal>schemata</literal></title>
4267 The view <literal>schemata</literal> contains all schemas in the
4268 current database that are owned by a currently enabled role.
4272 <title><literal>schemata</literal> Columns</title>
4278 <entry>Data Type</entry>
4279 <entry>Description</entry>
4285 <entry><literal>catalog_name</literal></entry>
4286 <entry><type>sql_identifier</type></entry>
4287 <entry>Name of the database that the schema is contained in (always the current database)</entry>
4291 <entry><literal>schema_name</literal></entry>
4292 <entry><type>sql_identifier</type></entry>
4293 <entry>Name of the schema</entry>
4297 <entry><literal>schema_owner</literal></entry>
4298 <entry><type>sql_identifier</type></entry>
4299 <entry>Name of the owner of the schema</entry>
4303 <entry><literal>default_character_set_catalog</literal></entry>
4304 <entry><type>sql_identifier</type></entry>
4305 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4309 <entry><literal>default_character_set_schema</literal></entry>
4310 <entry><type>sql_identifier</type></entry>
4311 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4315 <entry><literal>default_character_set_name</literal></entry>
4316 <entry><type>sql_identifier</type></entry>
4317 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4321 <entry><literal>sql_path</literal></entry>
4322 <entry><type>character_data</type></entry>
4323 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4330 <sect1 id="infoschema-sequences">
4331 <title><literal>sequences</literal></title>
4334 The view <literal>sequences</literal> contains all sequences
4335 defined in the current database. Only those sequences are shown
4336 that the current user has access to (by way of being the owner or
4337 having some privilege).
4341 <title><literal>sequences</literal> Columns</title>
4347 <entry>Data Type</entry>
4348 <entry>Description</entry>
4354 <entry><literal>sequence_catalog</literal></entry>
4355 <entry><type>sql_identifier</type></entry>
4356 <entry>Name of the database that contains the sequence (always the current database)</entry>
4360 <entry><literal>sequence_schema</literal></entry>
4361 <entry><type>sql_identifier</type></entry>
4362 <entry>Name of the schema that contains the sequence</entry>
4366 <entry><literal>sequence_name</literal></entry>
4367 <entry><type>sql_identifier</type></entry>
4368 <entry>Name of the sequence</entry>
4372 <entry><literal>data_type</literal></entry>
4373 <entry><type>character_data</type></entry>
4375 The data type of the sequence. In
4376 <productname>PostgreSQL</productname>, this is currently always
4377 <literal>bigint</literal>.
4382 <entry><literal>numeric_precision</literal></entry>
4383 <entry><type>cardinal_number</type></entry>
4385 This column contains the (declared or implicit) precision of
4386 the sequence data type (see above). The precision indicates
4387 the number of significant digits. It can be expressed in
4388 decimal (base 10) or binary (base 2) terms, as specified in the
4389 column <literal>numeric_precision_radix</literal>.
4394 <entry><literal>numeric_precision_radix</literal></entry>
4395 <entry><type>cardinal_number</type></entry>
4397 This column indicates in which base the values in the columns
4398 <literal>numeric_precision</literal> and
4399 <literal>numeric_scale</literal> are expressed. The value is
4405 <entry><literal>numeric_scale</literal></entry>
4406 <entry><type>cardinal_number</type></entry>
4408 This column contains the (declared or implicit) scale of the
4409 sequence data type (see above). The scale indicates the number
4410 of significant digits to the right of the decimal point. It
4411 can be expressed in decimal (base 10) or binary (base 2) terms,
4412 as specified in the column
4413 <literal>numeric_precision_radix</literal>.
4418 <entry><literal>start_value</literal></entry>
4419 <entry><type>character_data</type></entry>
4420 <entry>The start value of the sequence</entry>
4424 <entry><literal>minimum_value</literal></entry>
4425 <entry><type>character_data</type></entry>
4426 <entry>The minimum value of the sequence</entry>
4430 <entry><literal>maximum_value</literal></entry>
4431 <entry><type>character_data</type></entry>
4432 <entry>The maximum value of the sequence</entry>
4436 <entry><literal>increment</literal></entry>
4437 <entry><type>character_data</type></entry>
4438 <entry>The increment of the sequence</entry>
4442 <entry><literal>cycle_option</literal></entry>
4443 <entry><type>yes_or_no</type></entry>
4444 <entry><literal>YES</literal> if the sequence cycles, else <literal>NO</literal></entry>
4451 Note that in accordance with the SQL standard, the start, minimum,
4452 maximum, and increment values are returned as character strings.
4456 <sect1 id="infoschema-sql-features">
4457 <title><literal>sql_features</literal></title>
4460 The table <literal>sql_features</literal> contains information
4461 about which formal features defined in the SQL standard are
4462 supported by <productname>PostgreSQL</productname>. This is the
4463 same information that is presented in <xref linkend="features">.
4464 There you can also find some additional background information.
4468 <title><literal>sql_features</literal> Columns</title>
4474 <entry>Data Type</entry>
4475 <entry>Description</entry>
4481 <entry><literal>feature_id</literal></entry>
4482 <entry><type>character_data</type></entry>
4483 <entry>Identifier string of the feature</entry>
4487 <entry><literal>feature_name</literal></entry>
4488 <entry><type>character_data</type></entry>
4489 <entry>Descriptive name of the feature</entry>
4493 <entry><literal>sub_feature_id</literal></entry>
4494 <entry><type>character_data</type></entry>
4495 <entry>Identifier string of the subfeature, or a zero-length string if not a subfeature</entry>
4499 <entry><literal>sub_feature_name</literal></entry>
4500 <entry><type>character_data</type></entry>
4501 <entry>Descriptive name of the subfeature, or a zero-length string if not a subfeature</entry>
4505 <entry><literal>is_supported</literal></entry>
4506 <entry><type>yes_or_no</type></entry>
4508 <literal>YES</literal> if the feature is fully supported by the
4509 current version of <productname>PostgreSQL</>, <literal>NO</literal> if not
4514 <entry><literal>is_verified_by</literal></entry>
4515 <entry><type>character_data</type></entry>
4517 Always null, since the <productname>PostgreSQL</> development group does not
4518 perform formal testing of feature conformance
4523 <entry><literal>comments</literal></entry>
4524 <entry><type>character_data</type></entry>
4525 <entry>Possibly a comment about the supported status of the feature</entry>
4532 <sect1 id="infoschema-sql-implementation-info">
4533 <title><literal>sql_implementation_info</literal></title>
4536 The table <literal>sql_implementation_info</literal> contains
4537 information about various aspects that are left
4538 implementation-defined by the SQL standard. This information is
4539 primarily intended for use in the context of the ODBC interface;
4540 users of other interfaces will probably find this information to be
4541 of little use. For this reason, the individual implementation
4542 information items are not described here; you will find them in the
4543 description of the ODBC interface.
4547 <title><literal>sql_implementation_info</literal> Columns</title>
4553 <entry>Data Type</entry>
4554 <entry>Description</entry>
4560 <entry><literal>implementation_info_id</literal></entry>
4561 <entry><type>character_data</type></entry>
4562 <entry>Identifier string of the implementation information item</entry>
4566 <entry><literal>implementation_info_name</literal></entry>
4567 <entry><type>character_data</type></entry>
4568 <entry>Descriptive name of the implementation information item</entry>
4572 <entry><literal>integer_value</literal></entry>
4573 <entry><type>cardinal_number</type></entry>
4575 Value of the implementation information item, or null if the
4576 value is contained in the column
4577 <literal>character_value</literal>
4582 <entry><literal>character_value</literal></entry>
4583 <entry><type>character_data</type></entry>
4585 Value of the implementation information item, or null if the
4586 value is contained in the column
4587 <literal>integer_value</literal>
4592 <entry><literal>comments</literal></entry>
4593 <entry><type>character_data</type></entry>
4594 <entry>Possibly a comment pertaining to the implementation information item</entry>
4601 <sect1 id="infoschema-sql-languages">
4602 <title><literal>sql_languages</literal></title>
4605 The table <literal>sql_languages</literal> contains one row for
4606 each SQL language binding that is supported by
4607 <productname>PostgreSQL</productname>.
4608 <productname>PostgreSQL</productname> supports direct SQL and
4609 embedded SQL in C; that is all you will learn from this table.
4613 <title><literal>sql_languages</literal> Columns</title>
4619 <entry>Data Type</entry>
4620 <entry>Description</entry>
4626 <entry><literal>sql_language_source</literal></entry>
4627 <entry><type>character_data</type></entry>
4629 The name of the source of the language definition; always
4630 <literal>ISO 9075</literal>, that is, the SQL standard
4635 <entry><literal>sql_language_year</literal></entry>
4636 <entry><type>character_data</type></entry>
4638 The year the standard referenced in
4639 <literal>sql_language_source</literal> was approved; currently
4645 <entry><literal>sql_language_conformance</literal></entry>
4646 <entry><type>character_data</type></entry>
4648 The standard conformance level for the language binding. For
4649 ISO 9075:2003 this is always <literal>CORE</literal>.
4654 <entry><literal>sql_language_integrity</literal></entry>
4655 <entry><type>character_data</type></entry>
4656 <entry>Always null (This value is relevant to an earlier version of the SQL standard.)</entry>
4660 <entry><literal>sql_language_implementation</literal></entry>
4661 <entry><type>character_data</type></entry>
4662 <entry>Always null</entry>
4666 <entry><literal>sql_language_binding_style</literal></entry>
4667 <entry><type>character_data</type></entry>
4669 The language binding style, either <literal>DIRECT</literal> or
4670 <literal>EMBEDDED</literal>
4675 <entry><literal>sql_language_programming_language</literal></entry>
4676 <entry><type>character_data</type></entry>
4678 The programming language, if the binding style is
4679 <literal>EMBEDDED</literal>, else null. <productname>PostgreSQL</> only
4680 supports the language C.
4688 <sect1 id="infoschema-sql-packages">
4689 <title><literal>sql_packages</literal></title>
4692 The table <literal>sql_packages</literal> contains information
4693 about which feature packages defined in the SQL standard are
4694 supported by <productname>PostgreSQL</productname>. Refer to <xref
4695 linkend="features"> for background information on feature packages.
4699 <title><literal>sql_packages</literal> Columns</title>
4705 <entry>Data Type</entry>
4706 <entry>Description</entry>
4712 <entry><literal>feature_id</literal></entry>
4713 <entry><type>character_data</type></entry>
4714 <entry>Identifier string of the package</entry>
4718 <entry><literal>feature_name</literal></entry>
4719 <entry><type>character_data</type></entry>
4720 <entry>Descriptive name of the package</entry>
4724 <entry><literal>is_supported</literal></entry>
4725 <entry><type>yes_or_no</type></entry>
4727 <literal>YES</literal> if the package is fully supported by the
4728 current version of <productname>PostgreSQL</>, <literal>NO</literal> if not
4733 <entry><literal>is_verified_by</literal></entry>
4734 <entry><type>character_data</type></entry>
4736 Always null, since the <productname>PostgreSQL</> development group does not
4737 perform formal testing of feature conformance
4742 <entry><literal>comments</literal></entry>
4743 <entry><type>character_data</type></entry>
4744 <entry>Possibly a comment about the supported status of the package</entry>
4751 <sect1 id="infoschema-sql-parts">
4752 <title><literal>sql_parts</literal></title>
4755 The table <literal>sql_parts</literal> contains information about
4756 which of the several parts of the SQL standard are supported by
4757 <productname>PostgreSQL</productname>.
4761 <title><literal>sql_parts</literal> Columns</title>
4767 <entry>Data Type</entry>
4768 <entry>Description</entry>
4774 <entry><literal>feature_id</literal></entry>
4775 <entry><type>character_data</type></entry>
4776 <entry>An identifier string containing the number of the part</entry>
4780 <entry><literal>feature_name</literal></entry>
4781 <entry><type>character_data</type></entry>
4782 <entry>Descriptive name of the part</entry>
4786 <entry><literal>is_supported</literal></entry>
4787 <entry><type>yes_or_no</type></entry>
4789 <literal>YES</literal> if the part is fully supported by the
4790 current version of <productname>PostgreSQL</>,
4791 <literal>NO</literal> if not
4796 <entry><literal>is_verified_by</literal></entry>
4797 <entry><type>character_data</type></entry>
4799 Always null, since the <productname>PostgreSQL</> development group does not
4800 perform formal testing of feature conformance
4805 <entry><literal>comments</literal></entry>
4806 <entry><type>character_data</type></entry>
4807 <entry>Possibly a comment about the supported status of the part</entry>
4814 <sect1 id="infoschema-sql-sizing">
4815 <title><literal>sql_sizing</literal></title>
4818 The table <literal>sql_sizing</literal> contains information about
4819 various size limits and maximum values in
4820 <productname>PostgreSQL</productname>. This information is
4821 primarily intended for use in the context of the ODBC interface;
4822 users of other interfaces will probably find this information to be
4823 of little use. For this reason, the individual sizing items are
4824 not described here; you will find them in the description of the
4829 <title><literal>sql_sizing</literal> Columns</title>
4835 <entry>Data Type</entry>
4836 <entry>Description</entry>
4842 <entry><literal>sizing_id</literal></entry>
4843 <entry><type>cardinal_number</type></entry>
4844 <entry>Identifier of the sizing item</entry>
4848 <entry><literal>sizing_name</literal></entry>
4849 <entry><type>character_data</type></entry>
4850 <entry>Descriptive name of the sizing item</entry>
4854 <entry><literal>supported_value</literal></entry>
4855 <entry><type>cardinal_number</type></entry>
4857 Value of the sizing item, or 0 if the size is unlimited or
4858 cannot be determined, or null if the features for which the
4859 sizing item is applicable are not supported
4864 <entry><literal>comments</literal></entry>
4865 <entry><type>character_data</type></entry>
4866 <entry>Possibly a comment pertaining to the sizing item</entry>
4873 <sect1 id="infoschema-sql-sizing-profiles">
4874 <title><literal>sql_sizing_profiles</literal></title>
4877 The table <literal>sql_sizing_profiles</literal> contains
4878 information about the <literal>sql_sizing</literal> values that are
4879 required by various profiles of the SQL standard. <productname>PostgreSQL</> does
4880 not track any SQL profiles, so this table is empty.
4884 <title><literal>sql_sizing_profiles</literal> Columns</title>
4890 <entry>Data Type</entry>
4891 <entry>Description</entry>
4897 <entry><literal>sizing_id</literal></entry>
4898 <entry><type>cardinal_number</type></entry>
4899 <entry>Identifier of the sizing item</entry>
4903 <entry><literal>sizing_name</literal></entry>
4904 <entry><type>character_data</type></entry>
4905 <entry>Descriptive name of the sizing item</entry>
4909 <entry><literal>profile_id</literal></entry>
4910 <entry><type>character_data</type></entry>
4911 <entry>Identifier string of a profile</entry>
4915 <entry><literal>required_value</literal></entry>
4916 <entry><type>cardinal_number</type></entry>
4918 The value required by the SQL profile for the sizing item, or 0
4919 if the profile places no limit on the sizing item, or null if
4920 the profile does not require any of the features for which the
4921 sizing item is applicable
4926 <entry><literal>comments</literal></entry>
4927 <entry><type>character_data</type></entry>
4928 <entry>Possibly a comment pertaining to the sizing item within the profile</entry>
4935 <sect1 id="infoschema-table-constraints">
4936 <title><literal>table_constraints</literal></title>
4939 The view <literal>table_constraints</literal> contains all
4940 constraints belonging to tables that the current user owns or has
4941 some non-SELECT privilege on.
4945 <title><literal>table_constraints</literal> Columns</title>
4951 <entry>Data Type</entry>
4952 <entry>Description</entry>
4958 <entry><literal>constraint_catalog</literal></entry>
4959 <entry><type>sql_identifier</type></entry>
4960 <entry>Name of the database that contains the constraint (always the current database)</entry>
4964 <entry><literal>constraint_schema</literal></entry>
4965 <entry><type>sql_identifier</type></entry>
4966 <entry>Name of the schema that contains the constraint</entry>
4970 <entry><literal>constraint_name</literal></entry>
4971 <entry><type>sql_identifier</type></entry>
4972 <entry>Name of the constraint</entry>
4976 <entry><literal>table_catalog</literal></entry>
4977 <entry><type>sql_identifier</type></entry>
4978 <entry>Name of the database that contains the table (always the current database)</entry>
4982 <entry><literal>table_schema</literal></entry>
4983 <entry><type>sql_identifier</type></entry>
4984 <entry>Name of the schema that contains the table</entry>
4988 <entry><literal>table_name</literal></entry>
4989 <entry><type>sql_identifier</type></entry>
4990 <entry>Name of the table</entry>
4994 <entry><literal>constraint_type</literal></entry>
4995 <entry><type>character_data</type></entry>
4997 Type of the constraint: <literal>CHECK</literal>,
4998 <literal>FOREIGN KEY</literal>, <literal>PRIMARY KEY</literal>,
4999 or <literal>UNIQUE</literal>
5004 <entry><literal>is_deferrable</literal></entry>
5005 <entry><type>yes_or_no</type></entry>
5006 <entry><literal>YES</literal> if the constraint is deferrable, <literal>NO</literal> if not</entry>
5010 <entry><literal>initially_deferred</literal></entry>
5011 <entry><type>yes_or_no</type></entry>
5012 <entry><literal>YES</literal> if the constraint is deferrable and initially deferred, <literal>NO</literal> if not</entry>
5019 <sect1 id="infoschema-table-privileges">
5020 <title><literal>table_privileges</literal></title>
5023 The view <literal>table_privileges</literal> identifies all
5024 privileges granted on tables or views to a currently enabled role
5025 or by a currently enabled role. There is one row for each
5026 combination of table, grantor, and grantee.
5030 <title><literal>table_privileges</literal> Columns</title>
5036 <entry>Data Type</entry>
5037 <entry>Description</entry>
5043 <entry><literal>grantor</literal></entry>
5044 <entry><type>sql_identifier</type></entry>
5045 <entry>Name of the role that granted the privilege</entry>
5049 <entry><literal>grantee</literal></entry>
5050 <entry><type>sql_identifier</type></entry>
5051 <entry>Name of the role that the privilege was granted to</entry>
5055 <entry><literal>table_catalog</literal></entry>
5056 <entry><type>sql_identifier</type></entry>
5057 <entry>Name of the database that contains the table (always the current database)</entry>
5061 <entry><literal>table_schema</literal></entry>
5062 <entry><type>sql_identifier</type></entry>
5063 <entry>Name of the schema that contains the table</entry>
5067 <entry><literal>table_name</literal></entry>
5068 <entry><type>sql_identifier</type></entry>
5069 <entry>Name of the table</entry>
5073 <entry><literal>privilege_type</literal></entry>
5074 <entry><type>character_data</type></entry>
5076 Type of the privilege: <literal>SELECT</literal>,
5077 <literal>INSERT</literal>, <literal>UPDATE</literal>,
5078 <literal>DELETE</literal>, <literal>TRUNCATE</literal>,
5079 <literal>REFERENCES</literal>, or <literal>TRIGGER</literal>
5084 <entry><literal>is_grantable</literal></entry>
5085 <entry><type>yes_or_no</type></entry>
5086 <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
5090 <entry><literal>with_hierarchy</literal></entry>
5091 <entry><type>yes_or_no</type></entry>
5092 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5099 <sect1 id="infoschema-tables">
5100 <title><literal>tables</literal></title>
5103 The view <literal>tables</literal> contains all tables and views
5104 defined in the current database. Only those tables and views are
5105 shown that the current user has access to (by way of being the
5106 owner or having some privilege).
5110 <title><literal>tables</literal> Columns</title>
5116 <entry>Data Type</entry>
5117 <entry>Description</entry>
5123 <entry><literal>table_catalog</literal></entry>
5124 <entry><type>sql_identifier</type></entry>
5125 <entry>Name of the database that contains the table (always the current database)</entry>
5129 <entry><literal>table_schema</literal></entry>
5130 <entry><type>sql_identifier</type></entry>
5131 <entry>Name of the schema that contains the table</entry>
5135 <entry><literal>table_name</literal></entry>
5136 <entry><type>sql_identifier</type></entry>
5137 <entry>Name of the table</entry>
5141 <entry><literal>table_type</literal></entry>
5142 <entry><type>character_data</type></entry>
5144 Type of the table: <literal>BASE TABLE</literal> for a
5145 persistent base table (the normal table type),
5146 <literal>VIEW</literal> for a view, <literal>FOREIGN TABLE</literal>
5147 for a foreign table, or
5148 <literal>LOCAL TEMPORARY</literal> for a temporary table
5153 <entry><literal>self_referencing_column_name</literal></entry>
5154 <entry><type>sql_identifier</type></entry>
5155 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5159 <entry><literal>reference_generation</literal></entry>
5160 <entry><type>character_data</type></entry>
5161 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5165 <entry><literal>user_defined_type_catalog</literal></entry>
5166 <entry><type>sql_identifier</type></entry>
5168 If the table is a typed table, the name of the database that
5169 contains the underlying data type (always the current
5170 database), else null.
5175 <entry><literal>user_defined_type_schema</literal></entry>
5176 <entry><type>sql_identifier</type></entry>
5178 If the table is a typed table, the name of the schema that
5179 contains the underlying data type, else null.
5184 <entry><literal>user_defined_type_name</literal></entry>
5185 <entry><type>sql_identifier</type></entry>
5187 If the table is a typed table, the name of the underlying data
5193 <entry><literal>is_insertable_into</literal></entry>
5194 <entry><type>yes_or_no</type></entry>
5196 <literal>YES</literal> if the table is insertable into,
5197 <literal>NO</literal> if not (Base tables are always insertable
5198 into, views not necessarily.)
5203 <entry><literal>is_typed</literal></entry>
5204 <entry><type>yes_or_no</type></entry>
5205 <entry><literal>YES</literal> if the table is a typed table, <literal>NO</literal> if not</entry>
5209 <entry><literal>commit_action</literal></entry>
5210 <entry><type>character_data</type></entry>
5212 If the table is a temporary table, then
5213 <literal>PRESERVE</literal>, else null. (The SQL standard
5214 defines other commit actions for temporary tables, which are
5215 not supported by <productname>PostgreSQL</>.)
5223 <sect1 id="infoschema-triggered-update-columns">
5224 <title><literal>triggered_update_columns</literal></title>
5227 For triggers in the current database that specify a column list
5228 (like <literal>UPDATE OF column1, column2</literal>), the
5229 view <literal>triggered_update_columns</literal> identifies these
5230 columns. Triggers that do not specify a column list are not
5231 included in this view. Only those columns are shown that the
5232 current user owns or has some non-SELECT privilege on.
5236 <title><literal>triggered_update_columns</literal> Columns</title>
5242 <entry>Data Type</entry>
5243 <entry>Description</entry>
5249 <entry><literal>trigger_catalog</literal></entry>
5250 <entry><type>sql_identifier</type></entry>
5251 <entry>Name of the database that contains the trigger (always the current database)</entry>
5255 <entry><literal>trigger_schema</literal></entry>
5256 <entry><type>sql_identifier</type></entry>
5257 <entry>Name of the schema that contains the trigger</entry>
5261 <entry><literal>trigger_name</literal></entry>
5262 <entry><type>sql_identifier</type></entry>
5263 <entry>Name of the trigger</entry>
5267 <entry><literal>event_object_catalog</literal></entry>
5268 <entry><type>sql_identifier</type></entry>
5270 Name of the database that contains the table that the trigger
5271 is defined on (always the current database)
5276 <entry><literal>event_object_schema</literal></entry>
5277 <entry><type>sql_identifier</type></entry>
5278 <entry>Name of the schema that contains the table that the trigger is defined on</entry>
5282 <entry><literal>event_object_table</literal></entry>
5283 <entry><type>sql_identifier</type></entry>
5284 <entry>Name of the table that the trigger is defined on</entry>
5288 <entry><literal>event_object_column</literal></entry>
5289 <entry><type>sql_identifier</type></entry>
5290 <entry>Name of the column that the trigger is defined on</entry>
5297 <sect1 id="infoschema-triggers">
5298 <title><literal>triggers</literal></title>
5301 The view <literal>triggers</literal> contains all triggers defined
5302 in the current database on tables and views that the current user owns
5303 or has some non-SELECT privilege on.
5307 <title><literal>triggers</literal> Columns</title>
5313 <entry>Data Type</entry>
5314 <entry>Description</entry>
5320 <entry><literal>trigger_catalog</literal></entry>
5321 <entry><type>sql_identifier</type></entry>
5322 <entry>Name of the database that contains the trigger (always the current database)</entry>
5326 <entry><literal>trigger_schema</literal></entry>
5327 <entry><type>sql_identifier</type></entry>
5328 <entry>Name of the schema that contains the trigger</entry>
5332 <entry><literal>trigger_name</literal></entry>
5333 <entry><type>sql_identifier</type></entry>
5334 <entry>Name of the trigger</entry>
5338 <entry><literal>event_manipulation</literal></entry>
5339 <entry><type>character_data</type></entry>
5341 Event that fires the trigger (<literal>INSERT</literal>,
5342 <literal>UPDATE</literal>, or <literal>DELETE</literal>)
5347 <entry><literal>event_object_catalog</literal></entry>
5348 <entry><type>sql_identifier</type></entry>
5350 Name of the database that contains the table that the trigger
5351 is defined on (always the current database)
5356 <entry><literal>event_object_schema</literal></entry>
5357 <entry><type>sql_identifier</type></entry>
5358 <entry>Name of the schema that contains the table that the trigger is defined on</entry>
5362 <entry><literal>event_object_table</literal></entry>
5363 <entry><type>sql_identifier</type></entry>
5364 <entry>Name of the table that the trigger is defined on</entry>
5368 <entry><literal>action_order</literal></entry>
5369 <entry><type>cardinal_number</type></entry>
5370 <entry>Not yet implemented</entry>
5374 <entry><literal>action_condition</literal></entry>
5375 <entry><type>character_data</type></entry>
5377 <literal>WHEN</literal> condition of the trigger, null if none
5378 (also null if the table is not owned by a currently enabled
5384 <entry><literal>action_statement</literal></entry>
5385 <entry><type>character_data</type></entry>
5387 Statement that is executed by the trigger (currently always
5388 <literal>EXECUTE PROCEDURE
5389 <replaceable>function</replaceable>(...)</literal>)
5394 <entry><literal>action_orientation</literal></entry>
5395 <entry><type>character_data</type></entry>
5397 Identifies whether the trigger fires once for each processed
5398 row or once for each statement (<literal>ROW</literal> or
5399 <literal>STATEMENT</literal>)
5404 <entry><literal>action_timing</literal></entry>
5405 <entry><type>character_data</type></entry>
5407 Time at which the trigger fires (<literal>BEFORE</literal>,
5408 <literal>AFTER</literal>, or <literal>INSTEAD OF</literal>)
5413 <entry><literal>action_reference_old_table</literal></entry>
5414 <entry><type>sql_identifier</type></entry>
5415 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5419 <entry><literal>action_reference_new_table</literal></entry>
5420 <entry><type>sql_identifier</type></entry>
5421 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5425 <entry><literal>action_reference_old_row</literal></entry>
5426 <entry><type>sql_identifier</type></entry>
5427 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5431 <entry><literal>action_reference_new_row</literal></entry>
5432 <entry><type>sql_identifier</type></entry>
5433 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5437 <entry><literal>created</literal></entry>
5438 <entry><type>time_stamp</type></entry>
5439 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5446 Triggers in <productname>PostgreSQL</productname> have two
5447 incompatibilities with the SQL standard that affect the
5448 representation in the information schema. First, trigger names are
5449 local to each table in <productname>PostgreSQL</productname>, rather
5450 than being independent schema objects. Therefore there can be duplicate
5451 trigger names defined in one schema, so long as they belong to
5452 different tables. (<literal>trigger_catalog</literal> and
5453 <literal>trigger_schema</literal> are really the values pertaining
5454 to the table that the trigger is defined on.) Second, triggers can
5455 be defined to fire on multiple events in
5456 <productname>PostgreSQL</productname> (e.g., <literal>ON INSERT OR
5457 UPDATE</literal>), whereas the SQL standard only allows one. If a
5458 trigger is defined to fire on multiple events, it is represented as
5459 multiple rows in the information schema, one for each type of
5460 event. As a consequence of these two issues, the primary key of
5461 the view <literal>triggers</literal> is really
5462 <literal>(trigger_catalog, trigger_schema, event_object_table,
5463 trigger_name, event_manipulation)</literal> instead of
5464 <literal>(trigger_catalog, trigger_schema, trigger_name)</literal>,
5465 which is what the SQL standard specifies. Nonetheless, if you
5466 define your triggers in a manner that conforms with the SQL
5467 standard (trigger names unique in the schema and only one event
5468 type per trigger), this will not affect you.
5473 Prior to <productname>PostgreSQL</> 9.1, this view's columns
5474 <structfield>action_timing</structfield>,
5475 <structfield>action_reference_old_table</structfield>,
5476 <structfield>action_reference_new_table</structfield>,
5477 <structfield>action_reference_old_row</structfield>, and
5478 <structfield>action_reference_new_row</structfield>
5480 <structfield>condition_timing</structfield>,
5481 <structfield>condition_reference_old_table</structfield>,
5482 <structfield>condition_reference_new_table</structfield>,
5483 <structfield>condition_reference_old_row</structfield>, and
5484 <structfield>condition_reference_new_row</structfield>
5486 That was how they were named in the SQL:1999 standard.
5487 The new naming conforms to SQL:2003 and later.
5492 <sect1 id="infoschema-usage-privileges">
5493 <title><literal>usage_privileges</literal></title>
5496 The view <literal>usage_privileges</literal> identifies
5497 <literal>USAGE</literal> privileges granted on various kinds of
5498 objects to a currently enabled role or by a currently enabled role.
5499 In <productname>PostgreSQL</productname>, this currently applies to
5500 domains, foreign-data wrappers, and foreign servers. There is one
5501 row for each combination of object, grantor, and grantee.
5505 Since domains do not have real privileges
5506 in <productname>PostgreSQL</productname>, this view shows implicit
5507 non-grantable <literal>USAGE</literal> privileges granted by the
5508 owner to <literal>PUBLIC</literal> for all domains. The other
5509 object types, however, show real privileges.
5513 <title><literal>usage_privileges</literal> Columns</title>
5519 <entry>Data Type</entry>
5520 <entry>Description</entry>
5526 <entry><literal>grantor</literal></entry>
5527 <entry><type>sql_identifier</type></entry>
5528 <entry>Name of the role that granted the privilege</entry>
5532 <entry><literal>grantee</literal></entry>
5533 <entry><type>sql_identifier</type></entry>
5534 <entry>Name of the role that the privilege was granted to</entry>
5538 <entry><literal>object_catalog</literal></entry>
5539 <entry><type>sql_identifier</type></entry>
5540 <entry>Name of the database containing the object (always the current database)</entry>
5544 <entry><literal>object_schema</literal></entry>
5545 <entry><type>sql_identifier</type></entry>
5546 <entry>Name of the schema containing the object, if applicable,
5547 else an empty string</entry>
5551 <entry><literal>object_name</literal></entry>
5552 <entry><type>sql_identifier</type></entry>
5553 <entry>Name of the object</entry>
5557 <entry><literal>object_type</literal></entry>
5558 <entry><type>character_data</type></entry>
5559 <entry><literal>DOMAIN</literal> or <literal>FOREIGN DATA WRAPPER</literal> or <literal>FOREIGN SERVER</literal></entry>
5563 <entry><literal>privilege_type</literal></entry>
5564 <entry><type>character_data</type></entry>
5565 <entry>Always <literal>USAGE</literal></entry>
5569 <entry><literal>is_grantable</literal></entry>
5570 <entry><type>yes_or_no</type></entry>
5571 <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
5578 <sect1 id="infoschema-user-mapping-options">
5579 <title><literal>user_mapping_options</literal></title>
5582 The view <literal>user_mapping_options</literal> contains all the
5583 options defined for user mappings in the current database. Only
5584 those user mappings are shown where the current user has access to
5585 the corresponding foreign server (by way of being the owner or
5586 having some privilege).
5590 <title><literal>user_mapping_options</literal> Columns</title>
5596 <entry>Data Type</entry>
5597 <entry>Description</entry>
5603 <entry><literal>authorization_identifier</literal></entry>
5604 <entry><type>sql_identifier</type></entry>
5605 <entry>Name of the user being mapped,
5606 or <literal>PUBLIC</literal> if the mapping is public</entry>
5610 <entry><literal>foreign_server_catalog</literal></entry>
5611 <entry><type>sql_identifier</type></entry>
5612 <entry>Name of the database that the foreign server used by this
5613 mapping is defined in (always the current database)</entry>
5617 <entry><literal>foreign_server_name</literal></entry>
5618 <entry><type>sql_identifier</type></entry>
5619 <entry>Name of the foreign server used by this mapping</entry>
5623 <entry><literal>option_name</literal></entry>
5624 <entry><type>sql_identifier</type></entry>
5625 <entry>Name of an option</entry>
5629 <entry><literal>option_value</literal></entry>
5630 <entry><type>character_data</type></entry>
5631 <entry>Value of the option. This column will show as null
5632 unless the current user is the user being mapped, or the mapping
5633 is for <literal>PUBLIC</literal> and the current user is the
5634 server owner, or the current user is a superuser. The intent is
5635 to protect password information stored as user mapping
5643 <sect1 id="infoschema-user-mappings">
5644 <title><literal>user_mappings</literal></title>
5647 The view <literal>user_mappings</literal> contains all user
5648 mappings defined in the current database. Only those user mappings
5649 are shown where the current user has access to the corresponding
5650 foreign server (by way of being the owner or having some
5655 <title><literal>user_mappings</literal> Columns</title>
5661 <entry>Data Type</entry>
5662 <entry>Description</entry>
5668 <entry><literal>authorization_identifier</literal></entry>
5669 <entry><type>sql_identifier</type></entry>
5670 <entry>Name of the user being mapped,
5671 or <literal>PUBLIC</literal> if the mapping is public</entry>
5675 <entry><literal>foreign_server_catalog</literal></entry>
5676 <entry><type>sql_identifier</type></entry>
5677 <entry>Name of the database that the foreign server used by this
5678 mapping is defined in (always the current database)</entry>
5682 <entry><literal>foreign_server_name</literal></entry>
5683 <entry><type>sql_identifier</type></entry>
5684 <entry>Name of the foreign server used by this mapping</entry>
5691 <sect1 id="infoschema-view-column-usage">
5692 <title><literal>view_column_usage</literal></title>
5695 The view <literal>view_column_usage</literal> identifies all
5696 columns that are used in the query expression of a view (the
5697 <command>SELECT</command> statement that defines the view). A
5698 column is only included if the table that contains the column is
5699 owned by a currently enabled role.
5704 Columns of system tables are not included. This should be fixed
5710 <title><literal>view_column_usage</literal> Columns</title>
5716 <entry>Data Type</entry>
5717 <entry>Description</entry>
5723 <entry><literal>view_catalog</literal></entry>
5724 <entry><type>sql_identifier</type></entry>
5725 <entry>Name of the database that contains the view (always the current database)</entry>
5729 <entry><literal>view_schema</literal></entry>
5730 <entry><type>sql_identifier</type></entry>
5731 <entry>Name of the schema that contains the view</entry>
5735 <entry><literal>view_name</literal></entry>
5736 <entry><type>sql_identifier</type></entry>
5737 <entry>Name of the view</entry>
5741 <entry><literal>table_catalog</literal></entry>
5742 <entry><type>sql_identifier</type></entry>
5744 Name of the database that contains the table that contains the
5745 column that is used by the view (always the current database)
5750 <entry><literal>table_schema</literal></entry>
5751 <entry><type>sql_identifier</type></entry>
5753 Name of the schema that contains the table that contains the
5754 column that is used by the view
5759 <entry><literal>table_name</literal></entry>
5760 <entry><type>sql_identifier</type></entry>
5762 Name of the table that contains the column that is used by the
5768 <entry><literal>column_name</literal></entry>
5769 <entry><type>sql_identifier</type></entry>
5770 <entry>Name of the column that is used by the view</entry>
5777 <sect1 id="infoschema-view-routine-usage">
5778 <title><literal>view_routine_usage</literal></title>
5781 The view <literal>view_routine_usage</literal> identifies all
5782 routines (functions and procedures) that are used in the query
5783 expression of a view (the <command>SELECT</command> statement that
5784 defines the view). A routine is only included if that routine is
5785 owned by a currently enabled role.
5789 <title><literal>view_routine_usage</literal> Columns</title>
5795 <entry>Data Type</entry>
5796 <entry>Description</entry>
5802 <entry><literal>table_catalog</literal></entry>
5803 <entry><literal>sql_identifier</literal></entry>
5804 <entry>Name of the database containing the view (always the current database)</entry>
5808 <entry><literal>table_schema</literal></entry>
5809 <entry><literal>sql_identifier</literal></entry>
5810 <entry>Name of the schema containing the view</entry>
5814 <entry><literal>table_name</literal></entry>
5815 <entry><literal>sql_identifier</literal></entry>
5816 <entry>Name of the view</entry>
5820 <entry><literal>specific_catalog</literal></entry>
5821 <entry><literal>sql_identifier</literal></entry>
5822 <entry>Name of the database containing the function (always the current database)</entry>
5826 <entry><literal>specific_schema</literal></entry>
5827 <entry><literal>sql_identifier</literal></entry>
5828 <entry>Name of the schema containing the function</entry>
5832 <entry><literal>specific_name</literal></entry>
5833 <entry><literal>sql_identifier</literal></entry>
5835 The <quote>specific name</quote> of the function. See <xref
5836 linkend="infoschema-routines"> for more information.
5844 <sect1 id="infoschema-view-table-usage">
5845 <title><literal>view_table_usage</literal></title>
5848 The view <literal>view_table_usage</literal> identifies all tables
5849 that are used in the query expression of a view (the
5850 <command>SELECT</command> statement that defines the view). A
5851 table is only included if that table is owned by a currently
5857 System tables are not included. This should be fixed sometime.
5862 <title><literal>view_table_usage</literal> Columns</title>
5868 <entry>Data Type</entry>
5869 <entry>Description</entry>
5875 <entry><literal>view_catalog</literal></entry>
5876 <entry><type>sql_identifier</type></entry>
5877 <entry>Name of the database that contains the view (always the current database)</entry>
5881 <entry><literal>view_schema</literal></entry>
5882 <entry><type>sql_identifier</type></entry>
5883 <entry>Name of the schema that contains the view</entry>
5887 <entry><literal>view_name</literal></entry>
5888 <entry><type>sql_identifier</type></entry>
5889 <entry>Name of the view</entry>
5893 <entry><literal>table_catalog</literal></entry>
5894 <entry><type>sql_identifier</type></entry>
5896 Name of the database that contains the table that is
5897 used by the view (always the current database)
5902 <entry><literal>table_schema</literal></entry>
5903 <entry><type>sql_identifier</type></entry>
5905 Name of the schema that contains the table that is used by the
5911 <entry><literal>table_name</literal></entry>
5912 <entry><type>sql_identifier</type></entry>
5914 Name of the table that is used by the view
5922 <sect1 id="infoschema-views">
5923 <title><literal>views</literal></title>
5926 The view <literal>views</literal> contains all views defined in the
5927 current database. Only those views are shown that the current user
5928 has access to (by way of being the owner or having some privilege).
5932 <title><literal>views</literal> Columns</title>
5938 <entry>Data Type</entry>
5939 <entry>Description</entry>
5945 <entry><literal>table_catalog</literal></entry>
5946 <entry><type>sql_identifier</type></entry>
5947 <entry>Name of the database that contains the view (always the current database)</entry>
5951 <entry><literal>table_schema</literal></entry>
5952 <entry><type>sql_identifier</type></entry>
5953 <entry>Name of the schema that contains the view</entry>
5957 <entry><literal>table_name</literal></entry>
5958 <entry><type>sql_identifier</type></entry>
5959 <entry>Name of the view</entry>
5963 <entry><literal>view_definition</literal></entry>
5964 <entry><type>character_data</type></entry>
5966 Query expression defining the view (null if the view is not
5967 owned by a currently enabled role)
5972 <entry><literal>check_option</literal></entry>
5973 <entry><type>character_data</type></entry>
5974 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5978 <entry><literal>is_updatable</literal></entry>
5979 <entry><type>yes_or_no</type></entry>
5981 <literal>YES</literal> if the view is updatable (allows
5982 <command>UPDATE</command> and <command>DELETE</command>),
5983 <literal>NO</literal> if not
5988 <entry><literal>is_insertable_into</literal></entry>
5989 <entry><type>yes_or_no</type></entry>
5991 <literal>YES</literal> if the view is insertable into (allows
5992 <command>INSERT</command>), <literal>NO</literal> if not
5997 <entry><literal>is_trigger_updatable</literal></entry>
5998 <entry><type>yes_or_no</type></entry>
6000 <literal>YES</> if the view has an <literal>INSTEAD OF</>
6001 <command>UPDATE</> trigger defined on it, <literal>NO</> if not
6006 <entry><literal>is_trigger_deletable</literal></entry>
6007 <entry><type>yes_or_no</type></entry>
6009 <literal>YES</> if the view has an <literal>INSTEAD OF</>
6010 <command>DELETE</> trigger defined on it, <literal>NO</> if not
6015 <entry><literal>is_trigger_insertable_into</literal></entry>
6016 <entry><type>yes_or_no</type></entry>
6018 <literal>YES</> if the view has an <literal>INSTEAD OF</>
6019 <command>INSERT</> trigger defined on it, <literal>NO</> if not