1 <!-- doc/src/sgml/information_schema.sgml -->
3 <chapter id="information-schema">
4 <title>The Information Schema</title>
6 <indexterm zone="information-schema">
7 <primary>information schema</primary>
11 The information schema consists of a set of views that contain
12 information about the objects defined in the current database. The
13 information schema is defined in the SQL standard and can therefore
14 be expected to be portable and remain stable — unlike the system
15 catalogs, which are specific to
16 <productname>PostgreSQL</productname> and are modelled after
17 implementation concerns. The information schema views do not,
18 however, contain information about
19 <productname>PostgreSQL</productname>-specific features; to inquire
20 about those you need to query the system catalogs or other
21 <productname>PostgreSQL</productname>-specific views.
26 When querying the database for constraint information, it is possible
27 for a standard-compliant query that expects to return one row to
28 return several. This is because the SQL standard requires constraint
29 names to be unique within a schema, but
30 <productname>PostgreSQL</productname> does not enforce this
31 restriction. <productname>PostgreSQL</productname>
32 automatically-generated constraint names avoid duplicates in the
33 same schema, but users can specify such duplicate names.
37 This problem can appear when querying information schema views such
38 as <literal>check_constraint_routine_usage</>,
39 <literal>check_constraints</>, <literal>domain_constraints</>, and
40 <literal>referential_constraints</>. Some other views have similar
41 issues but contain the table name to help distinguish duplicate
42 rows, e.g., <literal>constraint_column_usage</>,
43 <literal>constraint_table_usage</>, <literal>table_constraints</>.
48 <sect1 id="infoschema-schema">
49 <title>The Schema</title>
52 The information schema itself is a schema named
53 <literal>information_schema</literal>. This schema automatically
54 exists in all databases. The owner of this schema is the initial
55 database user in the cluster, and that user naturally has all the
56 privileges on this schema, including the ability to drop it (but
57 the space savings achieved by that are minuscule).
61 By default, the information schema is not in the schema search
62 path, so you need to access all objects in it through qualified
63 names. Since the names of some of the objects in the information
64 schema are generic names that might occur in user applications, you
65 should be careful if you want to put the information schema in the
70 <sect1 id="infoschema-datatypes">
71 <title>Data Types</title>
74 The columns of the information schema views use special data types
75 that are defined in the information schema. These are defined as
76 simple domains over ordinary built-in types. You should not use
77 these types for work outside the information schema, but your
78 applications must be prepared for them if they select from the
87 <term><type>cardinal_number</type></term>
90 A nonnegative integer.
96 <term><type>character_data</type></term>
99 A character string (without specific maximum length).
105 <term><type>sql_identifier</type></term>
108 A character string. This type is used for SQL identifiers, the
109 type <type>character_data</type> is used for any other kind of
116 <term><type>time_stamp</type></term>
119 A domain over the type <type>timestamp with time zone</type>
125 <term><type>yes_or_no</type></term>
128 A character string domain that contains
129 either <literal>YES</literal> or <literal>NO</literal>. This
130 is used to represent Boolean (true/false) data in the
131 information schema. (The information schema was invented
132 before the type <type>boolean</type> was added to the SQL
133 standard, so this convention is necessary to keep the
134 information schema backward compatible.)
140 Every column in the information schema has one of these five types.
144 <sect1 id="infoschema-information-schema-catalog-name">
145 <title><literal>information_schema_catalog_name</literal></title>
148 <literal>information_schema_catalog_name</literal> is a table that
149 always contains one row and one column containing the name of the
150 current database (current catalog, in SQL terminology).
154 <title><literal>information_schema_catalog_name</literal> Columns</title>
160 <entry>Data Type</entry>
161 <entry>Description</entry>
167 <entry><literal>catalog_name</literal></entry>
168 <entry><type>sql_identifier</type></entry>
169 <entry>Name of the database that contains this information schema</entry>
176 <sect1 id="infoschema-administrable-role-authorizations">
177 <title><literal>administrable_role_authorizations</literal></title>
180 The view <literal>administrable_role_authorizations</literal>
181 identifies all roles that the current user has the admin option
186 <title><literal>administrable_role_authorizations</literal> Columns</title>
192 <entry>Data Type</entry>
193 <entry>Description</entry>
199 <entry><literal>grantee</literal></entry>
200 <entry><type>sql_identifier</type></entry>
202 Name of the role to which this role membership was granted (can
203 be the current user, or a different role in case of nested role
209 <entry><literal>role_name</literal></entry>
210 <entry><type>sql_identifier</type></entry>
211 <entry>Name of a role</entry>
215 <entry><literal>is_grantable</literal></entry>
216 <entry><type>yes_or_no</type></entry>
217 <entry>Always <literal>YES</literal></entry>
224 <sect1 id="infoschema-applicable-roles">
225 <title><literal>applicable_roles</literal></title>
228 The view <literal>applicable_roles</literal> identifies all roles
229 whose privileges the current user can use. This means there is
230 some chain of role grants from the current user to the role in
231 question. The current user itself is also an applicable role. The
232 set of applicable roles is generally used for permission checking.
233 <indexterm><primary>applicable role</primary></indexterm>
234 <indexterm><primary>role</primary><secondary>applicable</secondary></indexterm>
238 <title><literal>applicable_roles</literal> Columns</title>
244 <entry>Data Type</entry>
245 <entry>Description</entry>
251 <entry><literal>grantee</literal></entry>
252 <entry><type>sql_identifier</type></entry>
254 Name of the role to which this role membership was granted (can
255 be the current user, or a different role in case of nested role
261 <entry><literal>role_name</literal></entry>
262 <entry><type>sql_identifier</type></entry>
263 <entry>Name of a role</entry>
267 <entry><literal>is_grantable</literal></entry>
268 <entry><type>yes_or_no</type></entry>
270 <literal>YES</literal> if the grantee has the admin option on
271 the role, <literal>NO</literal> if not
279 <sect1 id="infoschema-attributes">
280 <title><literal>attributes</literal></title>
283 The view <literal>attributes</literal> contains information about
284 the attributes of composite data types defined in the database.
285 (Note that the view does not give information about table columns,
286 which are sometimes called attributes in PostgreSQL contexts.)
290 <title><literal>attributes</literal> Columns</title>
296 <entry>Data Type</entry>
297 <entry>Description</entry>
303 <entry><literal>udt_catalog</literal></entry>
304 <entry><type>sql_identifier</type></entry>
305 <entry>Name of the database containing the data type (always the current database)</entry>
309 <entry><literal>udt_schema</literal></entry>
310 <entry><type>sql_identifier</type></entry>
311 <entry>Name of the schema containing the data type</entry>
315 <entry><literal>udt_name</literal></entry>
316 <entry><type>sql_identifier</type></entry>
317 <entry>Name of the data type</entry>
321 <entry><literal>attribute_name</literal></entry>
322 <entry><type>sql_identifier</type></entry>
323 <entry>Name of the attribute</entry>
327 <entry><literal>ordinal_position</literal></entry>
328 <entry><type>cardinal_number</type></entry>
329 <entry>Ordinal position of the attribute within the data type (count starts at 1)</entry>
333 <entry><literal>attribute_default</literal></entry>
334 <entry><type>character_data</type></entry>
335 <entry>Default expression of the attribute</entry>
339 <entry><literal>is_nullable</literal></entry>
340 <entry><type>yes_or_no</type></entry>
342 <literal>YES</literal> if the attribute is possibly nullable,
343 <literal>NO</literal> if it is known not nullable.
348 <entry><literal>data_type</literal></entry>
349 <entry><type>character_data</type></entry>
351 Data type of the attribute, if it is a built-in type, or
352 <literal>ARRAY</literal> if it is some array (in that case, see
353 the view <literal>element_types</literal>), else
354 <literal>USER-DEFINED</literal> (in that case, the type is
355 identified in <literal>attribute_udt_name</literal> and
361 <entry><literal>character_maximum_length</literal></entry>
362 <entry><type>cardinal_number</type></entry>
364 If <literal>data_type</literal> identifies a character or bit
365 string type, the declared maximum length; null for all other
366 data types or if no maximum length was declared.
371 <entry><literal>character_octet_length</literal></entry>
372 <entry><type>cardinal_number</type></entry>
374 If <literal>data_type</literal> identifies a character type,
375 the maximum possible length in octets (bytes) of a datum; null
376 for all other data types. The maximum octet length depends on
377 the declared character maximum length (see above) and the
383 <entry><literal>character_set_catalog</literal></entry>
384 <entry><type>sql_identifier</type></entry>
385 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
389 <entry><literal>character_set_schema</literal></entry>
390 <entry><type>sql_identifier</type></entry>
391 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
395 <entry><literal>character_set_name</literal></entry>
396 <entry><type>sql_identifier</type></entry>
397 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
401 <entry><literal>collation_catalog</literal></entry>
402 <entry><type>sql_identifier</type></entry>
404 Name of the database containing the collation of the attribute
405 (always the current database), null if default or the data type
406 of the attribute is not collatable
411 <entry><literal>collation_schema</literal></entry>
412 <entry><type>sql_identifier</type></entry>
414 Name of the schema containing the collation of the attribute,
415 null if default or the data type of the attribute is not
421 <entry><literal>collation_name</literal></entry>
422 <entry><type>sql_identifier</type></entry>
424 Name of the collation of the attribute, null if default or the
425 data type of the attribute is not collatable
430 <entry><literal>numeric_precision</literal></entry>
431 <entry><type>cardinal_number</type></entry>
433 If <literal>data_type</literal> identifies a numeric type, this
434 column contains the (declared or implicit) precision of the
435 type for this attribute. The precision indicates the number of
436 significant digits. It can be expressed in decimal (base 10)
437 or binary (base 2) terms, as specified in the column
438 <literal>numeric_precision_radix</literal>. For all other data
439 types, this column is null.
444 <entry><literal>numeric_precision_radix</literal></entry>
445 <entry><type>cardinal_number</type></entry>
447 If <literal>data_type</literal> identifies a numeric type, this
448 column indicates in which base the values in the columns
449 <literal>numeric_precision</literal> and
450 <literal>numeric_scale</literal> are expressed. The value is
451 either 2 or 10. For all other data types, this column is null.
456 <entry><literal>numeric_scale</literal></entry>
457 <entry><type>cardinal_number</type></entry>
459 If <literal>data_type</literal> identifies an exact numeric
460 type, this column contains the (declared or implicit) scale of
461 the type for this attribute. The scale indicates the number of
462 significant digits to the right of the decimal point. It can
463 be expressed in decimal (base 10) or binary (base 2) terms, as
464 specified in the column
465 <literal>numeric_precision_radix</literal>. For all other data
466 types, this column is null.
471 <entry><literal>datetime_precision</literal></entry>
472 <entry><type>cardinal_number</type></entry>
474 If <literal>data_type</literal> identifies a date, time,
475 timestamp, or interval type, this column contains the (declared
476 or implicit) fractional seconds precision of the type for this
477 attribute, that is, the number of decimal digits maintained
478 following the decimal point in the seconds value. For all
479 other data types, this column is null.
484 <entry><literal>interval_type</literal></entry>
485 <entry><type>character_data</type></entry>
487 If <literal>data_type</literal> identifies an interval type,
488 this column contains the specification which fields the
489 intervals include for this attribute, e.g., <literal>YEAR TO
490 MONTH</literal>, <literal>DAY TO SECOND</literal>, etc. If no
491 field restrictions were specified (that is, the interval
492 accepts all fields), and for all other data types, this field
498 <entry><literal>interval_precision</literal></entry>
499 <entry><type>cardinal_number</type></entry>
501 Applies to a feature not available
502 in <productname>PostgreSQL</productname>
503 (see <literal>datetime_precision</literal> for the fractional
504 seconds precision of interval type attributes)
509 <entry><literal>attribute_udt_catalog</literal></entry>
510 <entry><type>sql_identifier</type></entry>
512 Name of the database that the attribute data type is defined in
513 (always the current database)
518 <entry><literal>attribute_udt_schema</literal></entry>
519 <entry><type>sql_identifier</type></entry>
521 Name of the schema that the attribute data type is defined in
526 <entry><literal>attribute_udt_name</literal></entry>
527 <entry><type>sql_identifier</type></entry>
529 Name of the attribute data type
534 <entry><literal>scope_catalog</literal></entry>
535 <entry><type>sql_identifier</type></entry>
536 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
540 <entry><literal>scope_schema</literal></entry>
541 <entry><type>sql_identifier</type></entry>
542 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
546 <entry><literal>scope_name</literal></entry>
547 <entry><type>sql_identifier</type></entry>
548 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
552 <entry><literal>maximum_cardinality</literal></entry>
553 <entry><type>cardinal_number</type></entry>
554 <entry>Always null, because arrays always have unlimited maximum cardinality in <productname>PostgreSQL</></entry>
558 <entry><literal>dtd_identifier</literal></entry>
559 <entry><type>sql_identifier</type></entry>
561 An identifier of the data type descriptor of the column, unique
562 among the data type descriptors pertaining to the table. This
563 is mainly useful for joining with other instances of such
564 identifiers. (The specific format of the identifier is not
565 defined and not guaranteed to remain the same in future
571 <entry><literal>is_derived_reference_attribute</literal></entry>
572 <entry><type>yes_or_no</type></entry>
573 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
580 See also under <xref linkend="infoschema-columns">, a similarly
581 structured view, for further information on some of the columns.
585 <sect1 id="infoschema-character-sets">
586 <title><literal>character_sets</literal></title>
589 The view <literal>character_sets</literal> identifies the character
590 sets available in the current database. Since PostgreSQL does not
591 support multiple character sets within one database, this view only
592 shows one, which is the database encoding.
596 Take note of how the following terms are used in the SQL standard:
599 <term>character repertoire</term>
602 An abstract collection of characters, for
603 example <literal>UNICODE</literal>, <literal>UCS</literal>, or
604 <literal>LATIN1</literal>. Not exposed as an SQL object, but
605 visible in this view.
611 <term>character encoding form</term>
614 An encoding of some character repertoire. Most older character
615 repertoires only use one encoding form, and so there are no
616 separate names for them (e.g., <literal>LATIN1</literal> is an
617 encoding form applicable to the <literal>LATIN1</literal>
618 repertoire). But for example Unicode has the encoding forms
619 <literal>UTF8</literal>, <literal>UTF16</literal>, etc. (not
620 all supported by PostgreSQL). Encoding forms are not exposed
621 as an SQL object, but are visible in this view.
627 <term>character set</term>
630 A named SQL object that identifies a character repertoire, a
631 character encoding, and a default collation. A predefined
632 character set would typically have the same name as an encoding
633 form, but users could define other names. For example, the
634 character set <literal>UTF8</literal> would typically identify
635 the character repertoire <literal>UCS</literal>, encoding
636 form <literal>UTF8</literal>, and some default collation.
642 You can think of an <quote>encoding</quote> in PostgreSQL either as
643 a character set or a character encoding form. They will have the
644 same name, and there can only be one in one database.
648 <title><literal>character_sets</literal> Columns</title>
654 <entry>Data Type</entry>
655 <entry>Description</entry>
661 <entry><literal>character_set_catalog</literal></entry>
662 <entry><literal>sql_identifier</literal></entry>
663 <entry>Character sets are currently not implemented as schema objects, so this column is null.</entry>
667 <entry><literal>character_set_schema</literal></entry>
668 <entry><literal>sql_identifier</literal></entry>
669 <entry>Character sets are currently not implemented as schema objects, so this column is null.</entry>
673 <entry><literal>character_set_name</literal></entry>
674 <entry><literal>sql_identifier</literal></entry>
675 <entry>Name of the character set, currently implemented as showing the name of the database encoding</entry>
679 <entry><literal>character_repertoire</literal></entry>
680 <entry><literal>sql_identifier</literal></entry>
681 <entry>Character repertoire, showing <literal>UCS</literal> if the encoding is <literal>UTF8</literal>, else just the encoding name</entry>
685 <entry><literal>form_of_use</literal></entry>
686 <entry><literal>sql_identifier</literal></entry>
687 <entry>Character encoding form, same as the database encoding</entry>
691 <entry><literal>default_collate_catalog</literal></entry>
692 <entry><literal>sql_identifier</literal></entry>
693 <entry>Name of the database containing the default collation (always the current database, if any collation is identified)</entry>
697 <entry><literal>default_collate_schema</literal></entry>
698 <entry><literal>sql_identifier</literal></entry>
699 <entry>Name of the schema containing the default collation</entry>
703 <entry><literal>default_collate_name</literal></entry>
704 <entry><literal>sql_identifier</literal></entry>
706 Name of the default collation. The default collation is
707 identified as the collation that matches
708 the <literal>COLLATE</literal> and <literal>CTYPE</literal>
709 settings of the current database. If there is no such
710 collation, then this column and the associated schema and
711 catalog columns are null.
719 <sect1 id="infoschema-check-constraint-routine-usage">
720 <title><literal>check_constraint_routine_usage</literal></title>
723 The view <literal>check_constraint_routine_usage</literal>
724 identifies routines (functions and procedures) that are used by a
725 check constraint. Only those routines are shown that are owned by
726 a currently enabled role.
730 <title><literal>check_constraint_routine_usage</literal> Columns</title>
736 <entry>Data Type</entry>
737 <entry>Description</entry>
743 <entry><literal>constraint_catalog</literal></entry>
744 <entry><literal>sql_identifier</literal></entry>
745 <entry>Name of the database containing the constraint (always the current database)</entry>
749 <entry><literal>constraint_schema</literal></entry>
750 <entry><literal>sql_identifier</literal></entry>
751 <entry>Name of the schema containing the constraint</entry>
755 <entry><literal>constraint_name</literal></entry>
756 <entry><literal>sql_identifier</literal></entry>
757 <entry>Name of the constraint</entry>
761 <entry><literal>specific_catalog</literal></entry>
762 <entry><literal>sql_identifier</literal></entry>
763 <entry>Name of the database containing the function (always the current database)</entry>
767 <entry><literal>specific_schema</literal></entry>
768 <entry><literal>sql_identifier</literal></entry>
769 <entry>Name of the schema containing the function</entry>
773 <entry><literal>specific_name</literal></entry>
774 <entry><literal>sql_identifier</literal></entry>
776 The <quote>specific name</quote> of the function. See <xref
777 linkend="infoschema-routines"> for more information.
785 <sect1 id="infoschema-check-constraints">
786 <title><literal>check_constraints</literal></title>
789 The view <literal>check_constraints</literal> contains all check
790 constraints, either defined on a table or on a domain, that are
791 owned by a currently enabled role. (The owner of the table or
792 domain is the owner of the constraint.)
796 <title><literal>check_constraints</literal> Columns</title>
802 <entry>Data Type</entry>
803 <entry>Description</entry>
809 <entry><literal>constraint_catalog</literal></entry>
810 <entry><literal>sql_identifier</literal></entry>
811 <entry>Name of the database containing the constraint (always the current database)</entry>
815 <entry><literal>constraint_schema</literal></entry>
816 <entry><literal>sql_identifier</literal></entry>
817 <entry>Name of the schema containing the constraint</entry>
821 <entry><literal>constraint_name</literal></entry>
822 <entry><literal>sql_identifier</literal></entry>
823 <entry>Name of the constraint</entry>
827 <entry><literal>check_clause</literal></entry>
828 <entry><literal>character_data</literal></entry>
829 <entry>The check expression of the check constraint</entry>
836 <sect1 id="infoschema-collations">
837 <title><literal>collations</literal></title>
840 The view <literal>collations</literal> contains the collations
841 available in the current database.
845 <title><literal>collations</literal> Columns</title>
851 <entry>Data Type</entry>
852 <entry>Description</entry>
858 <entry><literal>collation_catalog</literal></entry>
859 <entry><literal>sql_identifier</literal></entry>
860 <entry>Name of the database containing the collation (always the current database)</entry>
864 <entry><literal>collation_schema</literal></entry>
865 <entry><literal>sql_identifier</literal></entry>
866 <entry>Name of the schema containing the collation</entry>
870 <entry><literal>collation_name</literal></entry>
871 <entry><literal>sql_identifier</literal></entry>
872 <entry>Name of the default collation</entry>
876 <entry><literal>pad_attribute</literal></entry>
877 <entry><literal>character_data</literal></entry>
879 Always <literal>NO PAD</literal> (The alternative <literal>PAD
880 SPACE</literal> is not supported by PostgreSQL.)
888 <sect1 id="infoschema-collation-character-set-applicab"> <!-- max 44 characters -->
889 <title><literal>collation_character_set_applicability</literal></title>
892 The view <literal>collation_character_set_applicability</literal>
893 identifies which character set the available collations are
894 applicable to. In PostgreSQL, there is only one character set per
895 database (see explanation
896 in <xref linkend="infoschema-character-sets">), so this view does
897 not provide much useful information.
901 <title><literal>collation_character_set_applicability</literal> Columns</title>
907 <entry>Data Type</entry>
908 <entry>Description</entry>
914 <entry><literal>collation_catalog</literal></entry>
915 <entry><literal>sql_identifier</literal></entry>
916 <entry>Name of the database containing the collation (always the current database)</entry>
920 <entry><literal>collation_schema</literal></entry>
921 <entry><literal>sql_identifier</literal></entry>
922 <entry>Name of the schema containing the collation</entry>
926 <entry><literal>collation_name</literal></entry>
927 <entry><literal>sql_identifier</literal></entry>
928 <entry>Name of the default collation</entry>
932 <entry><literal>character_set_catalog</literal></entry>
933 <entry><literal>sql_identifier</literal></entry>
934 <entry>Character sets are currently not implemented as schema objects, so this column is null</entry>
938 <entry><literal>character_set_schema</literal></entry>
939 <entry><literal>sql_identifier</literal></entry>
940 <entry>Character sets are currently not implemented as schema objects, so this column is null</entry>
944 <entry><literal>character_set_name</literal></entry>
945 <entry><literal>sql_identifier</literal></entry>
946 <entry>Name of the character set</entry>
953 <sect1 id="infoschema-column-domain-usage">
954 <title><literal>column_domain_usage</literal></title>
957 The view <literal>column_domain_usage</literal> identifies all
958 columns (of a table or a view) that make use of some domain defined
959 in the current database and owned by a currently enabled role.
963 <title><literal>column_domain_usage</literal> Columns</title>
969 <entry>Data Type</entry>
970 <entry>Description</entry>
976 <entry><literal>domain_catalog</literal></entry>
977 <entry><type>sql_identifier</type></entry>
978 <entry>Name of the database containing the domain (always the current database)</entry>
982 <entry><literal>domain_schema</literal></entry>
983 <entry><type>sql_identifier</type></entry>
984 <entry>Name of the schema containing the domain</entry>
988 <entry><literal>domain_name</literal></entry>
989 <entry><type>sql_identifier</type></entry>
990 <entry>Name of the domain</entry>
994 <entry><literal>table_catalog</literal></entry>
995 <entry><type>sql_identifier</type></entry>
996 <entry>Name of the database containing the table (always the current database)</entry>
1000 <entry><literal>table_schema</literal></entry>
1001 <entry><type>sql_identifier</type></entry>
1002 <entry>Name of the schema containing the table</entry>
1006 <entry><literal>table_name</literal></entry>
1007 <entry><type>sql_identifier</type></entry>
1008 <entry>Name of the table</entry>
1012 <entry><literal>column_name</literal></entry>
1013 <entry><type>sql_identifier</type></entry>
1014 <entry>Name of the column</entry>
1021 <sect1 id="infoschema-column-privileges">
1022 <title><literal>column_privileges</literal></title>
1025 The view <literal>column_privileges</literal> identifies all
1026 privileges granted on columns to a currently enabled role or by a
1027 currently enabled role. There is one row for each combination of
1028 column, grantor, and grantee.
1032 If a privilege has been granted on an entire table, it will show up in
1033 this view as a grant for each column, but only for the
1034 privilege types where column granularity is possible:
1035 <literal>SELECT</literal>, <literal>INSERT</literal>,
1036 <literal>UPDATE</literal>, <literal>REFERENCES</literal>.
1040 <title><literal>column_privileges</literal> Columns</title>
1046 <entry>Data Type</entry>
1047 <entry>Description</entry>
1053 <entry><literal>grantor</literal></entry>
1054 <entry><type>sql_identifier</type></entry>
1055 <entry>Name of the role that granted the privilege</entry>
1059 <entry><literal>grantee</literal></entry>
1060 <entry><type>sql_identifier</type></entry>
1061 <entry>Name of the role that the privilege was granted to</entry>
1065 <entry><literal>table_catalog</literal></entry>
1066 <entry><type>sql_identifier</type></entry>
1067 <entry>Name of the database that contains the table that contains the column (always the current database)</entry>
1071 <entry><literal>table_schema</literal></entry>
1072 <entry><type>sql_identifier</type></entry>
1073 <entry>Name of the schema that contains the table that contains the column</entry>
1077 <entry><literal>table_name</literal></entry>
1078 <entry><type>sql_identifier</type></entry>
1079 <entry>Name of the table that contains the column</entry>
1083 <entry><literal>column_name</literal></entry>
1084 <entry><type>sql_identifier</type></entry>
1085 <entry>Name of the column</entry>
1089 <entry><literal>privilege_type</literal></entry>
1090 <entry><type>character_data</type></entry>
1092 Type of the privilege: <literal>SELECT</literal>,
1093 <literal>INSERT</literal>, <literal>UPDATE</literal>, or
1094 <literal>REFERENCES</literal>
1099 <entry><literal>is_grantable</literal></entry>
1100 <entry><type>yes_or_no</type></entry>
1101 <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
1108 <sect1 id="infoschema-column-udt-usage">
1109 <title><literal>column_udt_usage</literal></title>
1112 The view <literal>column_udt_usage</literal> identifies all columns
1113 that use data types owned by a currently enabled role. Note that in
1114 <productname>PostgreSQL</productname>, built-in data types behave
1115 like user-defined types, so they are included here as well. See
1116 also <xref linkend="infoschema-columns"> for details.
1120 <title><literal>column_udt_usage</literal> Columns</title>
1126 <entry>Data Type</entry>
1127 <entry>Description</entry>
1133 <entry><literal>udt_catalog</literal></entry>
1134 <entry><type>sql_identifier</type></entry>
1136 Name of the database that the column data type (the underlying
1137 type of the domain, if applicable) is defined in (always the
1143 <entry><literal>udt_schema</literal></entry>
1144 <entry><type>sql_identifier</type></entry>
1146 Name of the schema that the column data type (the underlying
1147 type of the domain, if applicable) is defined in
1152 <entry><literal>udt_name</literal></entry>
1153 <entry><type>sql_identifier</type></entry>
1155 Name of the column data type (the underlying type of the
1156 domain, if applicable)
1161 <entry><literal>table_catalog</literal></entry>
1162 <entry><type>sql_identifier</type></entry>
1163 <entry>Name of the database containing the table (always the current database)</entry>
1167 <entry><literal>table_schema</literal></entry>
1168 <entry><type>sql_identifier</type></entry>
1169 <entry>Name of the schema containing the table</entry>
1173 <entry><literal>table_name</literal></entry>
1174 <entry><type>sql_identifier</type></entry>
1175 <entry>Name of the table</entry>
1179 <entry><literal>column_name</literal></entry>
1180 <entry><type>sql_identifier</type></entry>
1181 <entry>Name of the column</entry>
1188 <sect1 id="infoschema-columns">
1189 <title><literal>columns</literal></title>
1192 The view <literal>columns</literal> contains information about all
1193 table columns (or view columns) in the database. System columns
1194 (<literal>oid</>, etc.) are not included. Only those columns are
1195 shown that the current user has access to (by way of being the
1196 owner or having some privilege).
1200 <title><literal>columns</literal> Columns</title>
1206 <entry>Data Type</entry>
1207 <entry>Description</entry>
1213 <entry><literal>table_catalog</literal></entry>
1214 <entry><type>sql_identifier</type></entry>
1215 <entry>Name of the database containing the table (always the current database)</entry>
1219 <entry><literal>table_schema</literal></entry>
1220 <entry><type>sql_identifier</type></entry>
1221 <entry>Name of the schema containing the table</entry>
1225 <entry><literal>table_name</literal></entry>
1226 <entry><type>sql_identifier</type></entry>
1227 <entry>Name of the table</entry>
1231 <entry><literal>column_name</literal></entry>
1232 <entry><type>sql_identifier</type></entry>
1233 <entry>Name of the column</entry>
1237 <entry><literal>ordinal_position</literal></entry>
1238 <entry><type>cardinal_number</type></entry>
1239 <entry>Ordinal position of the column within the table (count starts at 1)</entry>
1243 <entry><literal>column_default</literal></entry>
1244 <entry><type>character_data</type></entry>
1245 <entry>Default expression of the column</entry>
1249 <entry><literal>is_nullable</literal></entry>
1250 <entry><type>yes_or_no</type></entry>
1252 <literal>YES</literal> if the column is possibly nullable,
1253 <literal>NO</literal> if it is known not nullable. A not-null
1254 constraint is one way a column can be known not nullable, but
1255 there can be others.
1260 <entry><literal>data_type</literal></entry>
1261 <entry><type>character_data</type></entry>
1263 Data type of the column, if it is a built-in type, or
1264 <literal>ARRAY</literal> if it is some array (in that case, see
1265 the view <literal>element_types</literal>), else
1266 <literal>USER-DEFINED</literal> (in that case, the type is
1267 identified in <literal>udt_name</literal> and associated
1268 columns). If the column is based on a domain, this column
1269 refers to the type underlying the domain (and the domain is
1270 identified in <literal>domain_name</literal> and associated
1276 <entry><literal>character_maximum_length</literal></entry>
1277 <entry><type>cardinal_number</type></entry>
1279 If <literal>data_type</literal> identifies a character or bit
1280 string type, the declared maximum length; null for all other
1281 data types or if no maximum length was declared.
1286 <entry><literal>character_octet_length</literal></entry>
1287 <entry><type>cardinal_number</type></entry>
1289 If <literal>data_type</literal> identifies a character type,
1290 the maximum possible length in octets (bytes) of a datum; null
1291 for all other data types. The maximum octet length depends on
1292 the declared character maximum length (see above) and the
1298 <entry><literal>numeric_precision</literal></entry>
1299 <entry><type>cardinal_number</type></entry>
1301 If <literal>data_type</literal> identifies a numeric type, this
1302 column contains the (declared or implicit) precision of the
1303 type for this column. The precision indicates the number of
1304 significant digits. It can be expressed in decimal (base 10)
1305 or binary (base 2) terms, as specified in the column
1306 <literal>numeric_precision_radix</literal>. For all other data
1307 types, this column is null.
1312 <entry><literal>numeric_precision_radix</literal></entry>
1313 <entry><type>cardinal_number</type></entry>
1315 If <literal>data_type</literal> identifies a numeric type, this
1316 column indicates in which base the values in the columns
1317 <literal>numeric_precision</literal> and
1318 <literal>numeric_scale</literal> are expressed. The value is
1319 either 2 or 10. For all other data types, this column is null.
1324 <entry><literal>numeric_scale</literal></entry>
1325 <entry><type>cardinal_number</type></entry>
1327 If <literal>data_type</literal> identifies an exact numeric
1328 type, this column contains the (declared or implicit) scale of
1329 the type for this column. The scale indicates the number of
1330 significant digits to the right of the decimal point. It can
1331 be expressed in decimal (base 10) or binary (base 2) terms, as
1332 specified in the column
1333 <literal>numeric_precision_radix</literal>. For all other data
1334 types, this column is null.
1339 <entry><literal>datetime_precision</literal></entry>
1340 <entry><type>cardinal_number</type></entry>
1342 If <literal>data_type</literal> identifies a date, time,
1343 timestamp, or interval type, this column contains the (declared
1344 or implicit) fractional seconds precision of the type for this
1345 column, that is, the number of decimal digits maintained
1346 following the decimal point in the seconds value. For all
1347 other data types, this column is null.
1352 <entry><literal>interval_type</literal></entry>
1353 <entry><type>character_data</type></entry>
1355 If <literal>data_type</literal> identifies an interval type,
1356 this column contains the specification which fields the
1357 intervals include for this column, e.g., <literal>YEAR TO
1358 MONTH</literal>, <literal>DAY TO SECOND</literal>, etc. If no
1359 field restrictions were specified (that is, the interval
1360 accepts all fields), and for all other data types, this field
1366 <entry><literal>interval_precision</literal></entry>
1367 <entry><type>cardinal_number</type></entry>
1369 Applies to a feature not available
1370 in <productname>PostgreSQL</productname>
1371 (see <literal>datetime_precision</literal> for the fractional
1372 seconds precision of interval type columns)
1377 <entry><literal>character_set_catalog</literal></entry>
1378 <entry><type>sql_identifier</type></entry>
1379 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1383 <entry><literal>character_set_schema</literal></entry>
1384 <entry><type>sql_identifier</type></entry>
1385 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1389 <entry><literal>character_set_name</literal></entry>
1390 <entry><type>sql_identifier</type></entry>
1391 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1395 <entry><literal>collation_catalog</literal></entry>
1396 <entry><type>sql_identifier</type></entry>
1398 Name of the database containing the collation of the column
1399 (always the current database), null if default or the data type
1400 of the column is not collatable
1405 <entry><literal>collation_schema</literal></entry>
1406 <entry><type>sql_identifier</type></entry>
1408 Name of the schema containing the collation of the column, null
1409 if default or the data type of the column is not collatable
1414 <entry><literal>collation_name</literal></entry>
1415 <entry><type>sql_identifier</type></entry>
1417 Name of the collation of the column, null if default or the
1418 data type of the column is not collatable
1423 <entry><literal>domain_catalog</literal></entry>
1424 <entry><type>sql_identifier</type></entry>
1426 If the column has a domain type, the name of the database that
1427 the domain is defined in (always the current database), else
1433 <entry><literal>domain_schema</literal></entry>
1434 <entry><type>sql_identifier</type></entry>
1436 If the column has a domain type, the name of the schema that
1437 the domain is defined in, else null.
1442 <entry><literal>domain_name</literal></entry>
1443 <entry><type>sql_identifier</type></entry>
1444 <entry>If the column has a domain type, the name of the domain, else null.</entry>
1448 <entry><literal>udt_catalog</literal></entry>
1449 <entry><type>sql_identifier</type></entry>
1451 Name of the database that the column data type (the underlying
1452 type of the domain, if applicable) is defined in (always the
1458 <entry><literal>udt_schema</literal></entry>
1459 <entry><type>sql_identifier</type></entry>
1461 Name of the schema that the column data type (the underlying
1462 type of the domain, if applicable) is defined in
1467 <entry><literal>udt_name</literal></entry>
1468 <entry><type>sql_identifier</type></entry>
1470 Name of the column data type (the underlying type of the
1471 domain, if applicable)
1476 <entry><literal>scope_catalog</literal></entry>
1477 <entry><type>sql_identifier</type></entry>
1478 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1482 <entry><literal>scope_schema</literal></entry>
1483 <entry><type>sql_identifier</type></entry>
1484 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1488 <entry><literal>scope_name</literal></entry>
1489 <entry><type>sql_identifier</type></entry>
1490 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1494 <entry><literal>maximum_cardinality</literal></entry>
1495 <entry><type>cardinal_number</type></entry>
1496 <entry>Always null, because arrays always have unlimited maximum cardinality in <productname>PostgreSQL</></entry>
1500 <entry><literal>dtd_identifier</literal></entry>
1501 <entry><type>sql_identifier</type></entry>
1503 An identifier of the data type descriptor of the column, unique
1504 among the data type descriptors pertaining to the table. This
1505 is mainly useful for joining with other instances of such
1506 identifiers. (The specific format of the identifier is not
1507 defined and not guaranteed to remain the same in future
1513 <entry><literal>is_self_referencing</literal></entry>
1514 <entry><type>yes_or_no</type></entry>
1515 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1519 <entry><literal>is_identity</literal></entry>
1520 <entry><type>yes_or_no</type></entry>
1521 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1525 <entry><literal>identity_generation</literal></entry>
1526 <entry><type>character_data</type></entry>
1527 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1531 <entry><literal>identity_start</literal></entry>
1532 <entry><type>character_data</type></entry>
1533 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1537 <entry><literal>identity_increment</literal></entry>
1538 <entry><type>character_data</type></entry>
1539 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1543 <entry><literal>identity_maximum</literal></entry>
1544 <entry><type>character_data</type></entry>
1545 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1549 <entry><literal>identity_minimum</literal></entry>
1550 <entry><type>character_data</type></entry>
1551 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1555 <entry><literal>identity_cycle</literal></entry>
1556 <entry><type>yes_or_no</type></entry>
1557 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1561 <entry><literal>is_generated</literal></entry>
1562 <entry><type>character_data</type></entry>
1563 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1567 <entry><literal>generation_expression</literal></entry>
1568 <entry><type>character_data</type></entry>
1569 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1573 <entry><literal>is_updatable</literal></entry>
1574 <entry><type>yes_or_no</type></entry>
1576 <literal>YES</literal> if the column is updatable,
1577 <literal>NO</literal> if not (Columns in base tables are always
1578 updatable, columns in views not necessarily)
1586 Since data types can be defined in a variety of ways in SQL, and
1587 <productname>PostgreSQL</productname> contains additional ways to
1588 define data types, their representation in the information schema
1589 can be somewhat difficult. The column <literal>data_type</literal>
1590 is supposed to identify the underlying built-in type of the column.
1591 In <productname>PostgreSQL</productname>, this means that the type
1592 is defined in the system catalog schema
1593 <literal>pg_catalog</literal>. This column might be useful if the
1594 application can handle the well-known built-in types specially (for
1595 example, format the numeric types differently or use the data in
1596 the precision columns). The columns <literal>udt_name</literal>,
1597 <literal>udt_schema</literal>, and <literal>udt_catalog</literal>
1598 always identify the underlying data type of the column, even if the
1599 column is based on a domain. (Since
1600 <productname>PostgreSQL</productname> treats built-in types like
1601 user-defined types, built-in types appear here as well. This is an
1602 extension of the SQL standard.) These columns should be used if an
1603 application wants to process data differently according to the
1604 type, because in that case it wouldn't matter if the column is
1605 really based on a domain. If the column is based on a domain, the
1606 identity of the domain is stored in the columns
1607 <literal>domain_name</literal>, <literal>domain_schema</literal>,
1608 and <literal>domain_catalog</literal>. If you want to pair up
1609 columns with their associated data types and treat domains as
1610 separate types, you could write <literal>coalesce(domain_name,
1611 udt_name)</literal>, etc.
1615 <sect1 id="infoschema-constraint-column-usage">
1616 <title><literal>constraint_column_usage</literal></title>
1619 The view <literal>constraint_column_usage</literal> identifies all
1620 columns in the current database that are used by some constraint.
1621 Only those columns are shown that are contained in a table owned by
1622 a currently enabled role. For a check constraint, this view
1623 identifies the columns that are used in the check expression. For
1624 a foreign key constraint, this view identifies the columns that the
1625 foreign key references. For a unique or primary key constraint,
1626 this view identifies the constrained columns.
1630 <title><literal>constraint_column_usage</literal> Columns</title>
1636 <entry>Data Type</entry>
1637 <entry>Description</entry>
1643 <entry><literal>table_catalog</literal></entry>
1644 <entry><type>sql_identifier</type></entry>
1646 Name of the database that contains the table that contains the
1647 column that is used by some constraint (always the current
1653 <entry><literal>table_schema</literal></entry>
1654 <entry><type>sql_identifier</type></entry>
1656 Name of the schema that contains the table that contains the
1657 column that is used by some constraint
1662 <entry><literal>table_name</literal></entry>
1663 <entry><type>sql_identifier</type></entry>
1665 Name of the table that contains the column that is used by some
1671 <entry><literal>column_name</literal></entry>
1672 <entry><type>sql_identifier</type></entry>
1674 Name of the column that is used by some constraint
1679 <entry><literal>constraint_catalog</literal></entry>
1680 <entry><type>sql_identifier</type></entry>
1681 <entry>Name of the database that contains the constraint (always the current database)</entry>
1685 <entry><literal>constraint_schema</literal></entry>
1686 <entry><type>sql_identifier</type></entry>
1687 <entry>Name of the schema that contains the constraint</entry>
1691 <entry><literal>constraint_name</literal></entry>
1692 <entry><type>sql_identifier</type></entry>
1693 <entry>Name of the constraint</entry>
1700 <sect1 id="infoschema-constraint-table-usage">
1701 <title><literal>constraint_table_usage</literal></title>
1704 The view <literal>constraint_table_usage</literal> identifies all
1705 tables in the current database that are used by some constraint and
1706 are owned by a currently enabled role. (This is different from the
1707 view <literal>table_constraints</literal>, which identifies all
1708 table constraints along with the table they are defined on.) For a
1709 foreign key constraint, this view identifies the table that the
1710 foreign key references. For a unique or primary key constraint,
1711 this view simply identifies the table the constraint belongs to.
1712 Check constraints and not-null constraints are not included in this
1717 <title><literal>constraint_table_usage</literal> Columns</title>
1723 <entry>Data Type</entry>
1724 <entry>Description</entry>
1730 <entry><literal>table_catalog</literal></entry>
1731 <entry><type>sql_identifier</type></entry>
1733 Name of the database that contains the table that is used by
1734 some constraint (always the current database)
1739 <entry><literal>table_schema</literal></entry>
1740 <entry><type>sql_identifier</type></entry>
1742 Name of the schema that contains the table that is used by some
1748 <entry><literal>table_name</literal></entry>
1749 <entry><type>sql_identifier</type></entry>
1750 <entry>Name of the table that is used by some constraint</entry>
1754 <entry><literal>constraint_catalog</literal></entry>
1755 <entry><type>sql_identifier</type></entry>
1756 <entry>Name of the database that contains the constraint (always the current database)</entry>
1760 <entry><literal>constraint_schema</literal></entry>
1761 <entry><type>sql_identifier</type></entry>
1762 <entry>Name of the schema that contains the constraint</entry>
1766 <entry><literal>constraint_name</literal></entry>
1767 <entry><type>sql_identifier</type></entry>
1768 <entry>Name of the constraint</entry>
1775 <sect1 id="infoschema-data-type-privileges">
1776 <title><literal>data_type_privileges</literal></title>
1779 The view <literal>data_type_privileges</literal> identifies all
1780 data type descriptors that the current user has access to, by way
1781 of being the owner of the described object or having some privilege
1782 for it. A data type descriptor is generated whenever a data type
1783 is used in the definition of a table column, a domain, or a
1784 function (as parameter or return type) and stores some information
1785 about how the data type is used in that instance (for example, the
1786 declared maximum length, if applicable). Each data type
1787 descriptor is assigned an arbitrary identifier that is unique
1788 among the data type descriptor identifiers assigned for one object
1789 (table, domain, function). This view is probably not useful for
1790 applications, but it is used to define some other views in the
1795 <title><literal>data_type_privileges</literal> Columns</title>
1801 <entry>Data Type</entry>
1802 <entry>Description</entry>
1808 <entry><literal>object_catalog</literal></entry>
1809 <entry><type>sql_identifier</type></entry>
1810 <entry>Name of the database that contains the described object (always the current database)</entry>
1814 <entry><literal>object_schema</literal></entry>
1815 <entry><type>sql_identifier</type></entry>
1816 <entry>Name of the schema that contains the described object</entry>
1820 <entry><literal>object_name</literal></entry>
1821 <entry><type>sql_identifier</type></entry>
1822 <entry>Name of the described object</entry>
1826 <entry><literal>object_type</literal></entry>
1827 <entry><type>character_data</type></entry>
1829 The type of the described object: one of
1830 <literal>TABLE</literal> (the data type descriptor pertains to
1831 a column of that table), <literal>DOMAIN</literal> (the data
1832 type descriptors pertains to that domain),
1833 <literal>ROUTINE</literal> (the data type descriptor pertains
1834 to a parameter or the return data type of that function).
1839 <entry><literal>dtd_identifier</literal></entry>
1840 <entry><type>sql_identifier</type></entry>
1842 The identifier of the data type descriptor, which is unique
1843 among the data type descriptors for that same object.
1851 <sect1 id="infoschema-domain-constraints">
1852 <title><literal>domain_constraints</literal></title>
1855 The view <literal>domain_constraints</literal> contains all
1856 constraints belonging to domains defined in the current database.
1860 <title><literal>domain_constraints</literal> Columns</title>
1866 <entry>Data Type</entry>
1867 <entry>Description</entry>
1873 <entry><literal>constraint_catalog</literal></entry>
1874 <entry><type>sql_identifier</type></entry>
1875 <entry>Name of the database that contains the constraint (always the current database)</entry>
1879 <entry><literal>constraint_schema</literal></entry>
1880 <entry><type>sql_identifier</type></entry>
1881 <entry>Name of the schema that contains the constraint</entry>
1885 <entry><literal>constraint_name</literal></entry>
1886 <entry><type>sql_identifier</type></entry>
1887 <entry>Name of the constraint</entry>
1891 <entry><literal>domain_catalog</literal></entry>
1892 <entry><type>sql_identifier</type></entry>
1893 <entry>Name of the database that contains the domain (always the current database)</entry>
1897 <entry><literal>domain_schema</literal></entry>
1898 <entry><type>sql_identifier</type></entry>
1899 <entry>Name of the schema that contains the domain</entry>
1903 <entry><literal>domain_name</literal></entry>
1904 <entry><type>sql_identifier</type></entry>
1905 <entry>Name of the domain</entry>
1909 <entry><literal>is_deferrable</literal></entry>
1910 <entry><type>yes_or_no</type></entry>
1911 <entry><literal>YES</literal> if the constraint is deferrable, <literal>NO</literal> if not</entry>
1915 <entry><literal>initially_deferred</literal></entry>
1916 <entry><type>yes_or_no</type></entry>
1917 <entry><literal>YES</literal> if the constraint is deferrable and initially deferred, <literal>NO</literal> if not</entry>
1924 <sect1 id="infoschema-domain-udt-usage">
1925 <title><literal>domain_udt_usage</literal></title>
1928 The view <literal>domain_udt_usage</literal> identifies all domains
1929 that are based on data types owned by a currently enabled role.
1930 Note that in <productname>PostgreSQL</productname>, built-in data
1931 types behave like user-defined types, so they are included here as
1936 <title><literal>domain_udt_usage</literal> Columns</title>
1942 <entry>Data Type</entry>
1943 <entry>Description</entry>
1949 <entry><literal>udt_catalog</literal></entry>
1950 <entry><type>sql_identifier</type></entry>
1951 <entry>Name of the database that the domain data type is defined in (always the current database)</entry>
1955 <entry><literal>udt_schema</literal></entry>
1956 <entry><type>sql_identifier</type></entry>
1957 <entry>Name of the schema that the domain data type is defined in</entry>
1961 <entry><literal>udt_name</literal></entry>
1962 <entry><type>sql_identifier</type></entry>
1963 <entry>Name of the domain data type</entry>
1967 <entry><literal>domain_catalog</literal></entry>
1968 <entry><type>sql_identifier</type></entry>
1969 <entry>Name of the database that contains the domain (always the current database)</entry>
1973 <entry><literal>domain_schema</literal></entry>
1974 <entry><type>sql_identifier</type></entry>
1975 <entry>Name of the schema that contains the domain</entry>
1979 <entry><literal>domain_name</literal></entry>
1980 <entry><type>sql_identifier</type></entry>
1981 <entry>Name of the domain</entry>
1988 <sect1 id="infoschema-domains">
1989 <title><literal>domains</literal></title>
1992 The view <literal>domains</literal> contains all domains defined in
1993 the current database.
1997 <title><literal>domains</literal> Columns</title>
2003 <entry>Data Type</entry>
2004 <entry>Description</entry>
2010 <entry><literal>domain_catalog</literal></entry>
2011 <entry><type>sql_identifier</type></entry>
2012 <entry>Name of the database that contains the domain (always the current database)</entry>
2016 <entry><literal>domain_schema</literal></entry>
2017 <entry><type>sql_identifier</type></entry>
2018 <entry>Name of the schema that contains the domain</entry>
2022 <entry><literal>domain_name</literal></entry>
2023 <entry><type>sql_identifier</type></entry>
2024 <entry>Name of the domain</entry>
2028 <entry><literal>data_type</literal></entry>
2029 <entry><type>character_data</type></entry>
2031 Data type of the domain, if it is a built-in type, or
2032 <literal>ARRAY</literal> if it is some array (in that case, see
2033 the view <literal>element_types</literal>), else
2034 <literal>USER-DEFINED</literal> (in that case, the type is
2035 identified in <literal>udt_name</literal> and associated
2041 <entry><literal>character_maximum_length</literal></entry>
2042 <entry><type>cardinal_number</type></entry>
2044 If the domain has a character or bit string type, the declared
2045 maximum length; null for all other data types or if no maximum
2046 length was declared.
2051 <entry><literal>character_octet_length</literal></entry>
2052 <entry><type>cardinal_number</type></entry>
2054 If the domain has a character type, the maximum possible length
2055 in octets (bytes) of a datum; null for all other data types.
2056 The maximum octet length depends on the declared character
2057 maximum length (see above) and the server encoding.
2062 <entry><literal>character_set_catalog</literal></entry>
2063 <entry><type>sql_identifier</type></entry>
2064 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2068 <entry><literal>character_set_schema</literal></entry>
2069 <entry><type>sql_identifier</type></entry>
2070 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2074 <entry><literal>character_set_name</literal></entry>
2075 <entry><type>sql_identifier</type></entry>
2076 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2080 <entry><literal>collation_catalog</literal></entry>
2081 <entry><type>sql_identifier</type></entry>
2083 Name of the database containing the collation of the domain
2084 (always the current database), null if default or the data type
2085 of the domain is not collatable
2090 <entry><literal>collation_schema</literal></entry>
2091 <entry><type>sql_identifier</type></entry>
2093 Name of the schema containing the collation of the domain, null
2094 if default or the data type of the domain is not collatable
2099 <entry><literal>collation_name</literal></entry>
2100 <entry><type>sql_identifier</type></entry>
2102 Name of the collation of the column, null if default or the
2103 data type of the domain is not collatable
2108 <entry><literal>numeric_precision</literal></entry>
2109 <entry><type>cardinal_number</type></entry>
2111 If the domain has a numeric type, this column contains the
2112 (declared or implicit) precision of the type for this domain.
2113 The precision indicates the number of significant digits. It
2114 can be expressed in decimal (base 10) or binary (base 2) terms,
2115 as specified in the column
2116 <literal>numeric_precision_radix</literal>. For all other data
2117 types, this column is null.
2122 <entry><literal>numeric_precision_radix</literal></entry>
2123 <entry><type>cardinal_number</type></entry>
2125 If the domain has a numeric type, this column indicates in
2126 which base the values in the columns
2127 <literal>numeric_precision</literal> and
2128 <literal>numeric_scale</literal> are expressed. The value is
2129 either 2 or 10. For all other data types, this column is null.
2134 <entry><literal>numeric_scale</literal></entry>
2135 <entry><type>cardinal_number</type></entry>
2137 If the domain has an exact numeric type, this column contains
2138 the (declared or implicit) scale of the type for this domain.
2139 The scale indicates the number of significant digits to the
2140 right of the decimal point. It can be expressed in decimal
2141 (base 10) or binary (base 2) terms, as specified in the column
2142 <literal>numeric_precision_radix</literal>. For all other data
2143 types, this column is null.
2148 <entry><literal>datetime_precision</literal></entry>
2149 <entry><type>cardinal_number</type></entry>
2151 If <literal>data_type</literal> identifies a date, time,
2152 timestamp, or interval type, this column contains the (declared
2153 or implicit) fractional seconds precision of the type for this
2154 domain, that is, the number of decimal digits maintained
2155 following the decimal point in the seconds value. For all
2156 other data types, this column is null.
2161 <entry><literal>interval_type</literal></entry>
2162 <entry><type>character_data</type></entry>
2164 If <literal>data_type</literal> identifies an interval type,
2165 this column contains the specification which fields the
2166 intervals include for this domain, e.g., <literal>YEAR TO
2167 MONTH</literal>, <literal>DAY TO SECOND</literal>, etc. If no
2168 field restrictions were specified (that is, the interval
2169 accepts all fields), and for all other data types, this field
2175 <entry><literal>interval_precision</literal></entry>
2176 <entry><type>cardinal_number</type></entry>
2178 Applies to a feature not available
2179 in <productname>PostgreSQL</productname>
2180 (see <literal>datetime_precision</literal> for the fractional
2181 seconds precision of interval type domains)
2186 <entry><literal>domain_default</literal></entry>
2187 <entry><type>character_data</type></entry>
2188 <entry>Default expression of the domain</entry>
2192 <entry><literal>udt_catalog</literal></entry>
2193 <entry><type>sql_identifier</type></entry>
2194 <entry>Name of the database that the domain data type is defined in (always the current database)</entry>
2198 <entry><literal>udt_schema</literal></entry>
2199 <entry><type>sql_identifier</type></entry>
2200 <entry>Name of the schema that the domain data type is defined in</entry>
2204 <entry><literal>udt_name</literal></entry>
2205 <entry><type>sql_identifier</type></entry>
2206 <entry>Name of the domain data type</entry>
2210 <entry><literal>scope_catalog</literal></entry>
2211 <entry><type>sql_identifier</type></entry>
2212 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2216 <entry><literal>scope_schema</literal></entry>
2217 <entry><type>sql_identifier</type></entry>
2218 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2222 <entry><literal>scope_name</literal></entry>
2223 <entry><type>sql_identifier</type></entry>
2224 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2228 <entry><literal>maximum_cardinality</literal></entry>
2229 <entry><type>cardinal_number</type></entry>
2230 <entry>Always null, because arrays always have unlimited maximum cardinality in <productname>PostgreSQL</></entry>
2234 <entry><literal>dtd_identifier</literal></entry>
2235 <entry><type>sql_identifier</type></entry>
2237 An identifier of the data type descriptor of the domain, unique
2238 among the data type descriptors pertaining to the domain (which
2239 is trivial, because a domain only contains one data type
2240 descriptor). This is mainly useful for joining with other
2241 instances of such identifiers. (The specific format of the
2242 identifier is not defined and not guaranteed to remain the same
2243 in future versions.)
2251 <sect1 id="infoschema-element-types">
2252 <title><literal>element_types</literal></title>
2255 The view <literal>element_types</literal> contains the data type
2256 descriptors of the elements of arrays. When a table column, composite-type attribute,
2257 domain, function parameter, or function return value is defined to
2258 be of an array type, the respective information schema view only
2259 contains <literal>ARRAY</literal> in the column
2260 <literal>data_type</literal>. To obtain information on the element
2261 type of the array, you can join the respective view with this view.
2262 For example, to show the columns of a table with data types and
2263 array element types, if applicable, you could do:
2265 SELECT c.column_name, c.data_type, e.data_type AS element_type
2266 FROM information_schema.columns c LEFT JOIN information_schema.element_types e
2267 ON ((c.table_catalog, c.table_schema, c.table_name, 'TABLE', c.dtd_identifier)
2268 = (e.object_catalog, e.object_schema, e.object_name, e.object_type, e.collection_type_identifier))
2269 WHERE c.table_schema = '...' AND c.table_name = '...'
2270 ORDER BY c.ordinal_position;
2272 This view only includes objects that the current user has access
2273 to, by way of being the owner or having some privilege.
2277 <title><literal>element_types</literal> Columns</title>
2283 <entry>Data Type</entry>
2284 <entry>Description</entry>
2290 <entry><literal>object_catalog</literal></entry>
2291 <entry><type>sql_identifier</type></entry>
2293 Name of the database that contains the object that uses the
2294 array being described (always the current database)
2299 <entry><literal>object_schema</literal></entry>
2300 <entry><type>sql_identifier</type></entry>
2302 Name of the schema that contains the object that uses the array
2308 <entry><literal>object_name</literal></entry>
2309 <entry><type>sql_identifier</type></entry>
2311 Name of the object that uses the array being described
2316 <entry><literal>object_type</literal></entry>
2317 <entry><type>character_data</type></entry>
2319 The type of the object that uses the array being described: one
2320 of <literal>TABLE</literal> (the array is used by a column of
2321 that table), <literal>USER-DEFINED TYPE</literal> (the array is
2322 used by an attribute of that composite type),
2323 <literal>DOMAIN</literal> (the array is used by that domain),
2324 <literal>ROUTINE</literal> (the array is used by a parameter or
2325 the return data type of that function).
2330 <entry><literal>collection_type_identifier</literal></entry>
2331 <entry><type>sql_identifier</type></entry>
2333 The identifier of the data type descriptor of the array being
2334 described. Use this to join with the
2335 <literal>dtd_identifier</literal> columns of other information
2341 <entry><literal>data_type</literal></entry>
2342 <entry><type>character_data</type></entry>
2344 Data type of the array elements, if it is a built-in type, else
2345 <literal>USER-DEFINED</literal> (in that case, the type is
2346 identified in <literal>udt_name</literal> and associated
2352 <entry><literal>character_maximum_length</literal></entry>
2353 <entry><type>cardinal_number</type></entry>
2354 <entry>Always null, since this information is not applied to array element data types in <productname>PostgreSQL</></entry>
2358 <entry><literal>character_octet_length</literal></entry>
2359 <entry><type>cardinal_number</type></entry>
2360 <entry>Always null, since this information is not applied to array element data types in <productname>PostgreSQL</></entry>
2364 <entry><literal>character_set_catalog</literal></entry>
2365 <entry><type>sql_identifier</type></entry>
2366 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2370 <entry><literal>character_set_schema</literal></entry>
2371 <entry><type>sql_identifier</type></entry>
2372 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2376 <entry><literal>character_set_name</literal></entry>
2377 <entry><type>sql_identifier</type></entry>
2378 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2382 <entry><literal>collation_catalog</literal></entry>
2383 <entry><type>sql_identifier</type></entry>
2385 Name of the database containing the collation of the element
2386 type (always the current database), null if default or the data
2387 type of the element is not collatable
2392 <entry><literal>collation_schema</literal></entry>
2393 <entry><type>sql_identifier</type></entry>
2395 Name of the schema containing the collation of the element
2396 type, null if default or the data type of the element is not
2402 <entry><literal>collation_name</literal></entry>
2403 <entry><type>sql_identifier</type></entry>
2405 Name of the collation of the element type, null if default or
2406 the data type of the element is not collatable
2411 <entry><literal>numeric_precision</literal></entry>
2412 <entry><type>cardinal_number</type></entry>
2413 <entry>Always null, since this information is not applied to array element data types in <productname>PostgreSQL</></entry>
2417 <entry><literal>numeric_precision_radix</literal></entry>
2418 <entry><type>cardinal_number</type></entry>
2419 <entry>Always null, since this information is not applied to array element data types in <productname>PostgreSQL</></entry>
2423 <entry><literal>numeric_scale</literal></entry>
2424 <entry><type>cardinal_number</type></entry>
2425 <entry>Always null, since this information is not applied to array element data types in <productname>PostgreSQL</></entry>
2429 <entry><literal>datetime_precision</literal></entry>
2430 <entry><type>cardinal_number</type></entry>
2431 <entry>Always null, since this information is not applied to array element data types in <productname>PostgreSQL</></entry>
2435 <entry><literal>interval_type</literal></entry>
2436 <entry><type>character_data</type></entry>
2437 <entry>Always null, since this information is not applied to array element data types in <productname>PostgreSQL</></entry>
2441 <entry><literal>interval_precision</literal></entry>
2442 <entry><type>cardinal_number</type></entry>
2443 <entry>Always null, since this information is not applied to array element data types in <productname>PostgreSQL</></entry>
2447 <entry><literal>domain_default</literal></entry>
2448 <entry><type>character_data</type></entry>
2449 <entry>Not yet implemented</entry>
2453 <entry><literal>udt_catalog</literal></entry>
2454 <entry><type>sql_identifier</type></entry>
2456 Name of the database that the data type of the elements is
2457 defined in (always the current database)
2462 <entry><literal>udt_schema</literal></entry>
2463 <entry><type>sql_identifier</type></entry>
2465 Name of the schema that the data type of the elements is
2471 <entry><literal>udt_name</literal></entry>
2472 <entry><type>sql_identifier</type></entry>
2474 Name of the data type of the elements
2479 <entry><literal>scope_catalog</literal></entry>
2480 <entry><type>sql_identifier</type></entry>
2481 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2485 <entry><literal>scope_schema</literal></entry>
2486 <entry><type>sql_identifier</type></entry>
2487 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2491 <entry><literal>scope_name</literal></entry>
2492 <entry><type>sql_identifier</type></entry>
2493 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2497 <entry><literal>maximum_cardinality</literal></entry>
2498 <entry><type>cardinal_number</type></entry>
2499 <entry>Always null, because arrays always have unlimited maximum cardinality in <productname>PostgreSQL</></entry>
2503 <entry><literal>dtd_identifier</literal></entry>
2504 <entry><type>sql_identifier</type></entry>
2506 An identifier of the data type descriptor of the element. This
2507 is currently not useful.
2515 <sect1 id="infoschema-enabled-roles">
2516 <title><literal>enabled_roles</literal></title>
2519 The view <literal>enabled_roles</literal> identifies the currently
2520 <quote>enabled roles</quote>. The enabled roles are recursively
2521 defined as the current user together with all roles that have been
2522 granted to the enabled roles with automatic inheritance. In other
2523 words, these are all roles that the current user has direct or
2524 indirect, automatically inheriting membership in.
2525 <indexterm><primary>enabled role</primary></indexterm>
2526 <indexterm><primary>role</primary><secondary>enabled</secondary></indexterm>
2530 For permission checking, the set of <quote>applicable roles</quote>
2531 is applied, which can be broader than the set of enabled roles. So
2532 generally, it is better to use the view
2533 <literal>applicable_roles</literal> instead of this one; see also
2538 <title><literal>enabled_roles</literal> Columns</title>
2544 <entry>Data Type</entry>
2545 <entry>Description</entry>
2551 <entry><literal>role_name</literal></entry>
2552 <entry><type>sql_identifier</type></entry>
2553 <entry>Name of a role</entry>
2560 <sect1 id="infoschema-foreign-data-wrapper-options">
2561 <title><literal>foreign_data_wrapper_options</literal></title>
2564 The view <literal>foreign_data_wrapper_options</literal> contains
2565 all the options defined for foreign-data wrappers in the current
2566 database. Only those foreign-data wrappers are shown that the
2567 current user has access to (by way of being the owner or having
2572 <title><literal>foreign_data_wrapper_options</literal> Columns</title>
2578 <entry>Data Type</entry>
2579 <entry>Description</entry>
2585 <entry><literal>foreign_data_wrapper_catalog</literal></entry>
2586 <entry><type>sql_identifier</type></entry>
2587 <entry>Name of the database that the foreign-data wrapper is defined in (always the current database)</entry>
2591 <entry><literal>foreign_data_wrapper_name</literal></entry>
2592 <entry><type>sql_identifier</type></entry>
2593 <entry>Name of the foreign-data wrapper</entry>
2597 <entry><literal>option_name</literal></entry>
2598 <entry><type>sql_identifier</type></entry>
2599 <entry>Name of an option</entry>
2603 <entry><literal>option_value</literal></entry>
2604 <entry><type>character_data</type></entry>
2605 <entry>Value of the option</entry>
2612 <sect1 id="infoschema-foreign-data-wrappers">
2613 <title><literal>foreign_data_wrappers</literal></title>
2616 The view <literal>foreign_data_wrappers</literal> contains all
2617 foreign-data wrappers defined in the current database. Only those
2618 foreign-data wrappers are shown that the current user has access to
2619 (by way of being the owner or having some privilege).
2623 <title><literal>foreign_data_wrappers</literal> Columns</title>
2629 <entry>Data Type</entry>
2630 <entry>Description</entry>
2636 <entry><literal>foreign_data_wrapper_catalog</literal></entry>
2637 <entry><type>sql_identifier</type></entry>
2638 <entry>Name of the database that contains the foreign-data
2639 wrapper (always the current database)</entry>
2643 <entry><literal>foreign_data_wrapper_name</literal></entry>
2644 <entry><type>sql_identifier</type></entry>
2645 <entry>Name of the foreign-data wrapper</entry>
2649 <entry><literal>authorization_identifier</literal></entry>
2650 <entry><type>sql_identifier</type></entry>
2651 <entry>Name of the owner of the foreign server</entry>
2655 <entry><literal>library_name</literal></entry>
2656 <entry><type>character_data</type></entry>
2657 <entry>File name of the library that implementing this foreign-data wrapper</entry>
2661 <entry><literal>foreign_data_wrapper_language</literal></entry>
2662 <entry><type>character_data</type></entry>
2663 <entry>Language used to implement this foreign-data wrapper</entry>
2670 <sect1 id="infoschema-foreign-server-options">
2671 <title><literal>foreign_server_options</literal></title>
2674 The view <literal>foreign_server_options</literal> contains all the
2675 options defined for foreign servers in the current database. Only
2676 those foreign servers are shown that the current user has access to
2677 (by way of being the owner or having some privilege).
2681 <title><literal>foreign_server_options</literal> Columns</title>
2687 <entry>Data Type</entry>
2688 <entry>Description</entry>
2694 <entry><literal>foreign_server_catalog</literal></entry>
2695 <entry><type>sql_identifier</type></entry>
2696 <entry>Name of the database that the foreign server is defined in (always the current database)</entry>
2700 <entry><literal>foreign_server_name</literal></entry>
2701 <entry><type>sql_identifier</type></entry>
2702 <entry>Name of the foreign server</entry>
2706 <entry><literal>option_name</literal></entry>
2707 <entry><type>sql_identifier</type></entry>
2708 <entry>Name of an option</entry>
2712 <entry><literal>option_value</literal></entry>
2713 <entry><type>character_data</type></entry>
2714 <entry>Value of the option</entry>
2721 <sect1 id="infoschema-foreign-servers">
2722 <title><literal>foreign_servers</literal></title>
2725 The view <literal>foreign_servers</literal> contains all foreign
2726 servers defined in the current database. Only those foreign
2727 servers are shown that the current user has access to (by way of
2728 being the owner or having some privilege).
2732 <title><literal>foreign_servers</literal> Columns</title>
2738 <entry>Data Type</entry>
2739 <entry>Description</entry>
2745 <entry><literal>foreign_server_catalog</literal></entry>
2746 <entry><type>sql_identifier</type></entry>
2747 <entry>Name of the database that the foreign server is defined in (always the current database)</entry>
2751 <entry><literal>foreign_server_name</literal></entry>
2752 <entry><type>sql_identifier</type></entry>
2753 <entry>Name of the foreign server</entry>
2757 <entry><literal>foreign_data_wrapper_catalog</literal></entry>
2758 <entry><type>sql_identifier</type></entry>
2759 <entry>Name of the database that contains the foreign-data
2760 wrapper used by the foreign server (always the current database)</entry>
2764 <entry><literal>foreign_data_wrapper_name</literal></entry>
2765 <entry><type>sql_identifier</type></entry>
2766 <entry>Name of the foreign-data wrapper used by the foreign server</entry>
2770 <entry><literal>foreign_server_type</literal></entry>
2771 <entry><type>character_data</type></entry>
2772 <entry>Foreign server type information, if specified upon creation</entry>
2776 <entry><literal>foreign_server_version</literal></entry>
2777 <entry><type>character_data</type></entry>
2778 <entry>Foreign server version information, if specified upon creation</entry>
2782 <entry><literal>authorization_identifier</literal></entry>
2783 <entry><type>sql_identifier</type></entry>
2784 <entry>Name of the owner of the foreign server</entry>
2791 <sect1 id="infoschema-foreign-table-options">
2792 <title><literal>foreign_table_options</literal></title>
2795 The view <literal>foreign_table_options</literal> contains all the
2796 options defined for foreign tables in the current database. Only
2797 those foreign tables are shown that the current user has access to
2798 (by way of being the owner or having some privilege).
2802 <title><literal>foreign_table_options</literal> Columns</title>
2808 <entry>Data Type</entry>
2809 <entry>Description</entry>
2815 <entry><literal>foreign_table_catalog</literal></entry>
2816 <entry><type>sql_identifier</type></entry>
2817 <entry>Name of the database that contains the foreign table (always the current database)</entry>
2821 <entry><literal>foreign_table_schema</literal></entry>
2822 <entry><type>sql_identifier</type></entry>
2823 <entry>Name of the schema that contains the foreign table</entry>
2827 <entry><literal>foreign_table_name</literal></entry>
2828 <entry><type>sql_identifier</type></entry>
2829 <entry>Name of the foreign table</entry>
2833 <entry><literal>foreign_server_catalog</literal></entry>
2834 <entry><type>sql_identifier</type></entry>
2835 <entry>Name of the database that the foreign server is defined in (always the current database)</entry>
2839 <entry><literal>foreign_server_name</literal></entry>
2840 <entry><type>sql_identifier</type></entry>
2841 <entry>Name of the foreign server</entry>
2845 <entry><literal>option_name</literal></entry>
2846 <entry><type>sql_identifier</type></entry>
2847 <entry>Name of an option</entry>
2851 <entry><literal>option_value</literal></entry>
2852 <entry><type>character_data</type></entry>
2853 <entry>Value of the option</entry>
2860 <sect1 id="infoschema-foreign-tables">
2861 <title><literal>foreign_tables</literal></title>
2864 The view <literal>foreign_tables</literal> contains all foreign
2865 tables defined in the current database. Only those foreign
2866 tables are shown that the current user has access to (by way of
2867 being the owner or having some privilege).
2871 <title><literal>foreign_tables</literal> Columns</title>
2877 <entry>Data Type</entry>
2878 <entry>Description</entry>
2884 <entry><literal>foreign_table_catalog</literal></entry>
2885 <entry><type>sql_identifier</type></entry>
2886 <entry>Name of the database that the foreign table is defined in (always the current database)</entry>
2890 <entry><literal>foreign_table_schema</literal></entry>
2891 <entry><type>sql_identifier</type></entry>
2892 <entry>Name of the schema that contains the foreign table</entry>
2896 <entry><literal>foreign_table_name</literal></entry>
2897 <entry><type>sql_identifier</type></entry>
2898 <entry>Name of the foreign table</entry>
2902 <entry><literal>foreign_server_catalog</literal></entry>
2903 <entry><type>sql_identifier</type></entry>
2904 <entry>Name of the database that the foreign server is defined in (always the current database)</entry>
2908 <entry><literal>foreign_server_name</literal></entry>
2909 <entry><type>sql_identifier</type></entry>
2910 <entry>Name of the foreign server</entry>
2917 <sect1 id="infoschema-key-column-usage">
2918 <title><literal>key_column_usage</literal></title>
2921 The view <literal>key_column_usage</literal> identifies all columns
2922 in the current database that are restricted by some unique, primary
2923 key, or foreign key constraint. Check constraints are not included
2924 in this view. Only those columns are shown that the current user
2925 has access to, by way of being the owner or having some privilege.
2929 <title><literal>key_column_usage</literal> Columns</title>
2935 <entry>Data Type</entry>
2936 <entry>Description</entry>
2942 <entry><literal>constraint_catalog</literal></entry>
2943 <entry><type>sql_identifier</type></entry>
2944 <entry>Name of the database that contains the constraint (always the current database)</entry>
2948 <entry><literal>constraint_schema</literal></entry>
2949 <entry><type>sql_identifier</type></entry>
2950 <entry>Name of the schema that contains the constraint</entry>
2954 <entry><literal>constraint_name</literal></entry>
2955 <entry><type>sql_identifier</type></entry>
2956 <entry>Name of the constraint</entry>
2960 <entry><literal>table_catalog</literal></entry>
2961 <entry><type>sql_identifier</type></entry>
2963 Name of the database that contains the table that contains the
2964 column that is restricted by this constraint (always the
2970 <entry><literal>table_schema</literal></entry>
2971 <entry><type>sql_identifier</type></entry>
2973 Name of the schema that contains the table that contains the
2974 column that is restricted by this constraint
2979 <entry><literal>table_name</literal></entry>
2980 <entry><type>sql_identifier</type></entry>
2982 Name of the table that contains the column that is restricted
2988 <entry><literal>column_name</literal></entry>
2989 <entry><type>sql_identifier</type></entry>
2991 Name of the column that is restricted by this constraint
2996 <entry><literal>ordinal_position</literal></entry>
2997 <entry><type>cardinal_number</type></entry>
2999 Ordinal position of the column within the constraint key (count
3005 <entry><literal>position_in_unique_constraint</literal></entry>
3006 <entry><type>cardinal_number</type></entry>
3008 For a foreign-key constraint, ordinal position of the referenced
3009 column within its unique constraint (count starts at 1);
3018 <sect1 id="infoschema-parameters">
3019 <title><literal>parameters</literal></title>
3022 The view <literal>parameters</literal> contains information about
3023 the parameters (arguments) of all functions in the current database.
3024 Only those functions are shown that the current user has access to
3025 (by way of being the owner or having some privilege).
3029 <title><literal>parameters</literal> Columns</title>
3035 <entry>Data Type</entry>
3036 <entry>Description</entry>
3042 <entry><literal>specific_catalog</literal></entry>
3043 <entry><type>sql_identifier</type></entry>
3044 <entry>Name of the database containing the function (always the current database)</entry>
3048 <entry><literal>specific_schema</literal></entry>
3049 <entry><type>sql_identifier</type></entry>
3050 <entry>Name of the schema containing the function</entry>
3054 <entry><literal>specific_name</literal></entry>
3055 <entry><type>sql_identifier</type></entry>
3057 The <quote>specific name</quote> of the function. See <xref
3058 linkend="infoschema-routines"> for more information.
3063 <entry><literal>ordinal_position</literal></entry>
3064 <entry><type>cardinal_number</type></entry>
3066 Ordinal position of the parameter in the argument list of the
3067 function (count starts at 1)
3072 <entry><literal>parameter_mode</literal></entry>
3073 <entry><type>character_data</type></entry>
3075 <literal>IN</literal> for input parameter,
3076 <literal>OUT</literal> for output parameter,
3077 and <literal>INOUT</literal> for input/output parameter.
3082 <entry><literal>is_result</literal></entry>
3083 <entry><type>yes_or_no</type></entry>
3084 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3088 <entry><literal>as_locator</literal></entry>
3089 <entry><type>yes_or_no</type></entry>
3090 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3094 <entry><literal>parameter_name</literal></entry>
3095 <entry><type>sql_identifier</type></entry>
3096 <entry>Name of the parameter, or null if the parameter has no name</entry>
3100 <entry><literal>data_type</literal></entry>
3101 <entry><type>character_data</type></entry>
3103 Data type of the parameter, if it is a built-in type, or
3104 <literal>ARRAY</literal> if it is some array (in that case, see
3105 the view <literal>element_types</literal>), else
3106 <literal>USER-DEFINED</literal> (in that case, the type is
3107 identified in <literal>udt_name</literal> and associated
3113 <entry><literal>character_maximum_length</literal></entry>
3114 <entry><type>cardinal_number</type></entry>
3115 <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</></entry>
3119 <entry><literal>character_octet_length</literal></entry>
3120 <entry><type>cardinal_number</type></entry>
3121 <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</></entry>
3125 <entry><literal>character_set_catalog</literal></entry>
3126 <entry><type>sql_identifier</type></entry>
3127 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3131 <entry><literal>character_set_schema</literal></entry>
3132 <entry><type>sql_identifier</type></entry>
3133 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3137 <entry><literal>character_set_name</literal></entry>
3138 <entry><type>sql_identifier</type></entry>
3139 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3143 <entry><literal>collation_catalog</literal></entry>
3144 <entry><type>sql_identifier</type></entry>
3145 <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</></entry>
3149 <entry><literal>collation_schema</literal></entry>
3150 <entry><type>sql_identifier</type></entry>
3151 <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</></entry>
3155 <entry><literal>collation_name</literal></entry>
3156 <entry><type>sql_identifier</type></entry>
3157 <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</></entry>
3161 <entry><literal>numeric_precision</literal></entry>
3162 <entry><type>cardinal_number</type></entry>
3163 <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</></entry>
3167 <entry><literal>numeric_precision_radix</literal></entry>
3168 <entry><type>cardinal_number</type></entry>
3169 <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</></entry>
3173 <entry><literal>numeric_scale</literal></entry>
3174 <entry><type>cardinal_number</type></entry>
3175 <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</></entry>
3179 <entry><literal>datetime_precision</literal></entry>
3180 <entry><type>cardinal_number</type></entry>
3181 <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</></entry>
3185 <entry><literal>interval_type</literal></entry>
3186 <entry><type>character_data</type></entry>
3187 <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</></entry>
3191 <entry><literal>interval_precision</literal></entry>
3192 <entry><type>cardinal_number</type></entry>
3193 <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</></entry>
3197 <entry><literal>udt_catalog</literal></entry>
3198 <entry><type>sql_identifier</type></entry>
3200 Name of the database that the data type of the parameter is
3201 defined in (always the current database)
3206 <entry><literal>udt_schema</literal></entry>
3207 <entry><type>sql_identifier</type></entry>
3209 Name of the schema that the data type of the parameter is
3215 <entry><literal>udt_name</literal></entry>
3216 <entry><type>sql_identifier</type></entry>
3218 Name of the data type of the parameter
3223 <entry><literal>scope_catalog</literal></entry>
3224 <entry><type>sql_identifier</type></entry>
3225 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3229 <entry><literal>scope_schema</literal></entry>
3230 <entry><type>sql_identifier</type></entry>
3231 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3235 <entry><literal>scope_name</literal></entry>
3236 <entry><type>sql_identifier</type></entry>
3237 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3241 <entry><literal>maximum_cardinality</literal></entry>
3242 <entry><type>cardinal_number</type></entry>
3243 <entry>Always null, because arrays always have unlimited maximum cardinality in <productname>PostgreSQL</></entry>
3247 <entry><literal>dtd_identifier</literal></entry>
3248 <entry><type>sql_identifier</type></entry>
3250 An identifier of the data type descriptor of the parameter,
3251 unique among the data type descriptors pertaining to the
3252 function. This is mainly useful for joining with other
3253 instances of such identifiers. (The specific format of the
3254 identifier is not defined and not guaranteed to remain the same
3255 in future versions.)
3263 <sect1 id="infoschema-referential-constraints">
3264 <title><literal>referential_constraints</literal></title>
3267 The view <literal>referential_constraints</literal> contains all
3268 referential (foreign key) constraints in the current database.
3269 Only those constraints are shown for which the current user has
3270 write access to the referencing table (by way of being the
3271 owner or having some privilege other than SELECT).
3275 <title><literal>referential_constraints</literal> Columns</title>
3281 <entry>Data Type</entry>
3282 <entry>Description</entry>
3288 <entry><literal>constraint_catalog</literal></entry>
3289 <entry><literal>sql_identifier</literal></entry>
3290 <entry>Name of the database containing the constraint (always the current database)</entry>
3294 <entry><literal>constraint_schema</literal></entry>
3295 <entry><literal>sql_identifier</literal></entry>
3296 <entry>Name of the schema containing the constraint</entry>
3300 <entry><literal>constraint_name</literal></entry>
3301 <entry><literal>sql_identifier</literal></entry>
3302 <entry>Name of the constraint</entry>
3306 <entry><literal>unique_constraint_catalog</literal></entry>
3307 <entry><literal>sql_identifier</literal></entry>
3309 Name of the database that contains the unique or primary key
3310 constraint that the foreign key constraint references (always
3311 the current database)
3316 <entry><literal>unique_constraint_schema</literal></entry>
3317 <entry><literal>sql_identifier</literal></entry>
3319 Name of the schema that contains the unique or primary key
3320 constraint that the foreign key constraint references
3325 <entry><literal>unique_constraint_name</literal></entry>
3326 <entry><literal>sql_identifier</literal></entry>
3328 Name of the unique or primary key constraint that the foreign
3329 key constraint references
3334 <entry><literal>match_option</literal></entry>
3335 <entry><literal>character_data</literal></entry>
3337 Match option of the foreign key constraint:
3338 <literal>FULL</literal>, <literal>PARTIAL</literal>, or
3339 <literal>NONE</literal>.
3344 <entry><literal>update_rule</literal></entry>
3345 <entry><literal>character_data</literal></entry>
3347 Update rule of the foreign key constraint:
3348 <literal>CASCADE</literal>, <literal>SET NULL</literal>,
3349 <literal>SET DEFAULT</literal>, <literal>RESTRICT</literal>, or
3350 <literal>NO ACTION</literal>.
3355 <entry><literal>delete_rule</literal></entry>
3356 <entry><literal>character_data</literal></entry>
3358 Delete rule of the foreign key constraint:
3359 <literal>CASCADE</literal>, <literal>SET NULL</literal>,
3360 <literal>SET DEFAULT</literal>, <literal>RESTRICT</literal>, or
3361 <literal>NO ACTION</literal>.
3370 <sect1 id="infoschema-role-column-grants">
3371 <title><literal>role_column_grants</literal></title>
3374 The view <literal>role_column_grants</literal> identifies all
3375 privileges granted on columns where the grantor or grantee is a
3376 currently enabled role. Further information can be found under
3377 <literal>column_privileges</literal>. The only effective
3378 difference between this view
3379 and <literal>column_privileges</literal> is that this view omits
3380 columns that have been made accessible to the current user by way
3381 of a grant to <literal>PUBLIC</literal>.
3385 <title><literal>role_column_grants</literal> Columns</title>
3391 <entry>Data Type</entry>
3392 <entry>Description</entry>
3398 <entry><literal>grantor</literal></entry>
3399 <entry><type>sql_identifier</type></entry>
3400 <entry>Name of the role that granted the privilege</entry>
3404 <entry><literal>grantee</literal></entry>
3405 <entry><type>sql_identifier</type></entry>
3406 <entry>Name of the role that the privilege was granted to</entry>
3410 <entry><literal>table_catalog</literal></entry>
3411 <entry><type>sql_identifier</type></entry>
3412 <entry>Name of the database that contains the table that contains the column (always the current database)</entry>
3416 <entry><literal>table_schema</literal></entry>
3417 <entry><type>sql_identifier</type></entry>
3418 <entry>Name of the schema that contains the table that contains the column</entry>
3422 <entry><literal>table_name</literal></entry>
3423 <entry><type>sql_identifier</type></entry>
3424 <entry>Name of the table that contains the column</entry>
3428 <entry><literal>column_name</literal></entry>
3429 <entry><type>sql_identifier</type></entry>
3430 <entry>Name of the column</entry>
3434 <entry><literal>privilege_type</literal></entry>
3435 <entry><type>character_data</type></entry>
3437 Type of the privilege: <literal>SELECT</literal>,
3438 <literal>INSERT</literal>, <literal>UPDATE</literal>, or
3439 <literal>REFERENCES</literal>
3444 <entry><literal>is_grantable</literal></entry>
3445 <entry><type>yes_or_no</type></entry>
3446 <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
3453 <sect1 id="infoschema-role-routine-grants">
3454 <title><literal>role_routine_grants</literal></title>
3457 The view <literal>role_routine_grants</literal> identifies all
3458 privileges granted on functions where the grantor or grantee is a
3459 currently enabled role. Further information can be found under
3460 <literal>routine_privileges</literal>. The only effective
3461 difference between this view
3462 and <literal>routine_privileges</literal> is that this view omits
3463 functions that have been made accessible to the current user by way
3464 of a grant to <literal>PUBLIC</literal>.
3468 <title><literal>role_routine_grants</literal> Columns</title>
3474 <entry>Data Type</entry>
3475 <entry>Description</entry>
3481 <entry><literal>grantor</literal></entry>
3482 <entry><type>sql_identifier</type></entry>
3483 <entry>Name of the role that granted the privilege</entry>
3487 <entry><literal>grantee</literal></entry>
3488 <entry><type>sql_identifier</type></entry>
3489 <entry>Name of the role that the privilege was granted to</entry>
3493 <entry><literal>specific_catalog</literal></entry>
3494 <entry><type>sql_identifier</type></entry>
3495 <entry>Name of the database containing the function (always the current database)</entry>
3499 <entry><literal>specific_schema</literal></entry>
3500 <entry><type>sql_identifier</type></entry>
3501 <entry>Name of the schema containing the function</entry>
3505 <entry><literal>specific_name</literal></entry>
3506 <entry><type>sql_identifier</type></entry>
3508 The <quote>specific name</quote> of the function. See <xref
3509 linkend="infoschema-routines"> for more information.
3514 <entry><literal>routine_catalog</literal></entry>
3515 <entry><type>sql_identifier</type></entry>
3516 <entry>Name of the database containing the function (always the current database)</entry>
3520 <entry><literal>routine_schema</literal></entry>
3521 <entry><type>sql_identifier</type></entry>
3522 <entry>Name of the schema containing the function</entry>
3526 <entry><literal>routine_name</literal></entry>
3527 <entry><type>sql_identifier</type></entry>
3528 <entry>Name of the function (might be duplicated in case of overloading)</entry>
3532 <entry><literal>privilege_type</literal></entry>
3533 <entry><type>character_data</type></entry>
3534 <entry>Always <literal>EXECUTE</literal> (the only privilege type for functions)</entry>
3538 <entry><literal>is_grantable</literal></entry>
3539 <entry><type>yes_or_no</type></entry>
3540 <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
3547 <sect1 id="infoschema-role-table-grants">
3548 <title><literal>role_table_grants</literal></title>
3551 The view <literal>role_table_grants</literal> identifies all
3552 privileges granted on tables or views where the grantor or grantee
3553 is a currently enabled role. Further information can be found
3554 under <literal>table_privileges</literal>. The only effective
3555 difference between this view
3556 and <literal>table_privileges</literal> is that this view omits
3557 tables that have been made accessible to the current user by way of
3558 a grant to <literal>PUBLIC</literal>.
3562 <title><literal>role_table_grants</literal> Columns</title>
3568 <entry>Data Type</entry>
3569 <entry>Description</entry>
3575 <entry><literal>grantor</literal></entry>
3576 <entry><type>sql_identifier</type></entry>
3577 <entry>Name of the role that granted the privilege</entry>
3581 <entry><literal>grantee</literal></entry>
3582 <entry><type>sql_identifier</type></entry>
3583 <entry>Name of the role that the privilege was granted to</entry>
3587 <entry><literal>table_catalog</literal></entry>
3588 <entry><type>sql_identifier</type></entry>
3589 <entry>Name of the database that contains the table (always the current database)</entry>
3593 <entry><literal>table_schema</literal></entry>
3594 <entry><type>sql_identifier</type></entry>
3595 <entry>Name of the schema that contains the table</entry>
3599 <entry><literal>table_name</literal></entry>
3600 <entry><type>sql_identifier</type></entry>
3601 <entry>Name of the table</entry>
3605 <entry><literal>privilege_type</literal></entry>
3606 <entry><type>character_data</type></entry>
3608 Type of the privilege: <literal>SELECT</literal>,
3609 <literal>INSERT</literal>, <literal>UPDATE</literal>,
3610 <literal>DELETE</literal>, <literal>TRUNCATE</literal>,
3611 <literal>REFERENCES</literal>, or <literal>TRIGGER</literal>
3616 <entry><literal>is_grantable</literal></entry>
3617 <entry><type>yes_or_no</type></entry>
3618 <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
3622 <entry><literal>with_hierarchy</literal></entry>
3623 <entry><type>yes_or_no</type></entry>
3624 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3631 <sect1 id="infoschema-role-udt-grants">
3632 <title><literal>role_udt_grants</literal></title>
3635 The view <literal>role_udt_grants</literal> is intended to identify
3636 <literal>USAGE</literal> privileges granted on user-defined types
3637 where the grantor or grantee is a currently enabled role. Further
3638 information can be found under
3639 <literal>udt_privileges</literal>. The only effective difference
3640 between this view and <literal>udt_privileges</literal> is that
3641 this view omits objects that have been made accessible to the
3642 current user by way of a grant to <literal>PUBLIC</literal>. Since
3643 data types do not have real privileges in PostgreSQL, but only an
3644 implicit grant to <literal>PUBLIC</literal>, this view is empty.
3648 <title><literal>role_udt_grants</literal> Columns</title>
3654 <entry>Data Type</entry>
3655 <entry>Description</entry>
3661 <entry><literal>grantor</literal></entry>
3662 <entry><type>sql_identifier</type></entry>
3663 <entry>The name of the role that granted the privilege</entry>
3667 <entry><literal>grantee</literal></entry>
3668 <entry><type>sql_identifier</type></entry>
3669 <entry>The name of the role that the privilege was granted to</entry>
3673 <entry><literal>udt_catalog</literal></entry>
3674 <entry><type>sql_identifier</type></entry>
3675 <entry>Name of the database containing the type (always the current database)</entry>
3679 <entry><literal>udt_schema</literal></entry>
3680 <entry><type>sql_identifier</type></entry>
3681 <entry>Name of the schema containing the type</entry>
3685 <entry><literal>udt_name</literal></entry>
3686 <entry><type>sql_identifier</type></entry>
3687 <entry>Name of the type</entry>
3691 <entry><literal>privilege_type</literal></entry>
3692 <entry><type>character_data</type></entry>
3693 <entry>Always <literal>TYPE USAGE</literal></entry>
3697 <entry><literal>is_grantable</literal></entry>
3698 <entry><type>yes_or_no</type></entry>
3699 <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
3706 <sect1 id="infoschema-role-usage-grants">
3707 <title><literal>role_usage_grants</literal></title>
3710 The view <literal>role_usage_grants</literal> identifies
3711 <literal>USAGE</literal> privileges granted on various kinds of
3712 objects where the grantor or grantee is a currently enabled role.
3713 Further information can be found under
3714 <literal>usage_privileges</literal>. The only effective difference
3715 between this view and <literal>usage_privileges</literal> is that
3716 this view omits objects that have been made accessible to the
3717 current user by way of a grant to <literal>PUBLIC</literal>.
3721 <title><literal>role_usage_grants</literal> Columns</title>
3727 <entry>Data Type</entry>
3728 <entry>Description</entry>
3734 <entry><literal>grantor</literal></entry>
3735 <entry><type>sql_identifier</type></entry>
3736 <entry>The name of the role that granted the privilege</entry>
3740 <entry><literal>grantee</literal></entry>
3741 <entry><type>sql_identifier</type></entry>
3742 <entry>The name of the role that the privilege was granted to</entry>
3746 <entry><literal>object_catalog</literal></entry>
3747 <entry><type>sql_identifier</type></entry>
3748 <entry>Name of the database containing the object (always the current database)</entry>
3752 <entry><literal>object_schema</literal></entry>
3753 <entry><type>sql_identifier</type></entry>
3754 <entry>Name of the schema containing the object, if applicable,
3755 else an empty string</entry>
3759 <entry><literal>object_name</literal></entry>
3760 <entry><type>sql_identifier</type></entry>
3761 <entry>Name of the object</entry>
3765 <entry><literal>object_type</literal></entry>
3766 <entry><type>character_data</type></entry>
3767 <entry><literal>COLLATION</literal> or <literal>DOMAIN</literal> or <literal>FOREIGN DATA WRAPPER</literal> or <literal>FOREIGN SERVER</literal></entry>
3771 <entry><literal>privilege_type</literal></entry>
3772 <entry><type>character_data</type></entry>
3773 <entry>Always <literal>USAGE</literal></entry>
3777 <entry><literal>is_grantable</literal></entry>
3778 <entry><type>yes_or_no</type></entry>
3779 <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
3786 <sect1 id="infoschema-routine-privileges">
3787 <title><literal>routine_privileges</literal></title>
3790 The view <literal>routine_privileges</literal> identifies all
3791 privileges granted on functions to a currently enabled role or by a
3792 currently enabled role. There is one row for each combination of function,
3793 grantor, and grantee.
3797 <title><literal>routine_privileges</literal> Columns</title>
3803 <entry>Data Type</entry>
3804 <entry>Description</entry>
3810 <entry><literal>grantor</literal></entry>
3811 <entry><type>sql_identifier</type></entry>
3812 <entry>Name of the role that granted the privilege</entry>
3816 <entry><literal>grantee</literal></entry>
3817 <entry><type>sql_identifier</type></entry>
3818 <entry>Name of the role that the privilege was granted to</entry>
3822 <entry><literal>specific_catalog</literal></entry>
3823 <entry><type>sql_identifier</type></entry>
3824 <entry>Name of the database containing the function (always the current database)</entry>
3828 <entry><literal>specific_schema</literal></entry>
3829 <entry><type>sql_identifier</type></entry>
3830 <entry>Name of the schema containing the function</entry>
3834 <entry><literal>specific_name</literal></entry>
3835 <entry><type>sql_identifier</type></entry>
3837 The <quote>specific name</quote> of the function. See <xref
3838 linkend="infoschema-routines"> for more information.
3843 <entry><literal>routine_catalog</literal></entry>
3844 <entry><type>sql_identifier</type></entry>
3845 <entry>Name of the database containing the function (always the current database)</entry>
3849 <entry><literal>routine_schema</literal></entry>
3850 <entry><type>sql_identifier</type></entry>
3851 <entry>Name of the schema containing the function</entry>
3855 <entry><literal>routine_name</literal></entry>
3856 <entry><type>sql_identifier</type></entry>
3857 <entry>Name of the function (might be duplicated in case of overloading)</entry>
3861 <entry><literal>privilege_type</literal></entry>
3862 <entry><type>character_data</type></entry>
3863 <entry>Always <literal>EXECUTE</literal> (the only privilege type for functions)</entry>
3867 <entry><literal>is_grantable</literal></entry>
3868 <entry><type>yes_or_no</type></entry>
3869 <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
3876 <sect1 id="infoschema-routines">
3877 <title><literal>routines</literal></title>
3880 The view <literal>routines</literal> contains all functions in the
3881 current database. Only those functions are shown that the current
3882 user has access to (by way of being the owner or having some
3887 <title><literal>routines</literal> Columns</title>
3893 <entry>Data Type</entry>
3894 <entry>Description</entry>
3900 <entry><literal>specific_catalog</literal></entry>
3901 <entry><type>sql_identifier</type></entry>
3902 <entry>Name of the database containing the function (always the current database)</entry>
3906 <entry><literal>specific_schema</literal></entry>
3907 <entry><type>sql_identifier</type></entry>
3908 <entry>Name of the schema containing the function</entry>
3912 <entry><literal>specific_name</literal></entry>
3913 <entry><type>sql_identifier</type></entry>
3915 The <quote>specific name</quote> of the function. This is a
3916 name that uniquely identifies the function in the schema, even
3917 if the real name of the function is overloaded. The format of
3918 the specific name is not defined, it should only be used to
3919 compare it to other instances of specific routine names.
3924 <entry><literal>routine_catalog</literal></entry>
3925 <entry><type>sql_identifier</type></entry>
3926 <entry>Name of the database containing the function (always the current database)</entry>
3930 <entry><literal>routine_schema</literal></entry>
3931 <entry><type>sql_identifier</type></entry>
3932 <entry>Name of the schema containing the function</entry>
3936 <entry><literal>routine_name</literal></entry>
3937 <entry><type>sql_identifier</type></entry>
3938 <entry>Name of the function (might be duplicated in case of overloading)</entry>
3942 <entry><literal>routine_type</literal></entry>
3943 <entry><type>character_data</type></entry>
3945 Always <literal>FUNCTION</literal> (In the future there might
3946 be other types of routines.)
3951 <entry><literal>module_catalog</literal></entry>
3952 <entry><type>sql_identifier</type></entry>
3953 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3957 <entry><literal>module_schema</literal></entry>
3958 <entry><type>sql_identifier</type></entry>
3959 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3963 <entry><literal>module_name</literal></entry>
3964 <entry><type>sql_identifier</type></entry>
3965 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3969 <entry><literal>udt_catalog</literal></entry>
3970 <entry><type>sql_identifier</type></entry>
3971 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3975 <entry><literal>udt_schema</literal></entry>
3976 <entry><type>sql_identifier</type></entry>
3977 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3981 <entry><literal>udt_name</literal></entry>
3982 <entry><type>sql_identifier</type></entry>
3983 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3987 <entry><literal>data_type</literal></entry>
3988 <entry><type>character_data</type></entry>
3990 Return data type of the function, if it is a built-in type, or
3991 <literal>ARRAY</literal> if it is some array (in that case, see
3992 the view <literal>element_types</literal>), else
3993 <literal>USER-DEFINED</literal> (in that case, the type is
3994 identified in <literal>type_udt_name</literal> and associated
4000 <entry><literal>character_maximum_length</literal></entry>
4001 <entry><type>cardinal_number</type></entry>
4002 <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
4006 <entry><literal>character_octet_length</literal></entry>
4007 <entry><type>cardinal_number</type></entry>
4008 <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
4012 <entry><literal>character_set_catalog</literal></entry>
4013 <entry><type>sql_identifier</type></entry>
4014 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4018 <entry><literal>character_set_schema</literal></entry>
4019 <entry><type>sql_identifier</type></entry>
4020 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4024 <entry><literal>character_set_name</literal></entry>
4025 <entry><type>sql_identifier</type></entry>
4026 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4030 <entry><literal>collation_catalog</literal></entry>
4031 <entry><type>sql_identifier</type></entry>
4032 <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
4036 <entry><literal>collation_schema</literal></entry>
4037 <entry><type>sql_identifier</type></entry>
4038 <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
4042 <entry><literal>collation_name</literal></entry>
4043 <entry><type>sql_identifier</type></entry>
4044 <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
4048 <entry><literal>numeric_precision</literal></entry>
4049 <entry><type>cardinal_number</type></entry>
4050 <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
4054 <entry><literal>numeric_precision_radix</literal></entry>
4055 <entry><type>cardinal_number</type></entry>
4056 <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
4060 <entry><literal>numeric_scale</literal></entry>
4061 <entry><type>cardinal_number</type></entry>
4062 <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
4066 <entry><literal>datetime_precision</literal></entry>
4067 <entry><type>cardinal_number</type></entry>
4068 <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
4072 <entry><literal>interval_type</literal></entry>
4073 <entry><type>character_data</type></entry>
4074 <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
4078 <entry><literal>interval_precision</literal></entry>
4079 <entry><type>cardinal_number</type></entry>
4080 <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
4084 <entry><literal>type_udt_catalog</literal></entry>
4085 <entry><type>sql_identifier</type></entry>
4087 Name of the database that the return data type of the function
4088 is defined in (always the current database)
4093 <entry><literal>type_udt_schema</literal></entry>
4094 <entry><type>sql_identifier</type></entry>
4096 Name of the schema that the return data type of the function is
4102 <entry><literal>type_udt_name</literal></entry>
4103 <entry><type>sql_identifier</type></entry>
4105 Name of the return data type of the function
4110 <entry><literal>scope_catalog</literal></entry>
4111 <entry><type>sql_identifier</type></entry>
4112 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4116 <entry><literal>scope_schema</literal></entry>
4117 <entry><type>sql_identifier</type></entry>
4118 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4122 <entry><literal>scope_name</literal></entry>
4123 <entry><type>sql_identifier</type></entry>
4124 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4128 <entry><literal>maximum_cardinality</literal></entry>
4129 <entry><type>cardinal_number</type></entry>
4130 <entry>Always null, because arrays always have unlimited maximum cardinality in <productname>PostgreSQL</></entry>
4134 <entry><literal>dtd_identifier</literal></entry>
4135 <entry><type>sql_identifier</type></entry>
4137 An identifier of the data type descriptor of the return data
4138 type of this function, unique among the data type descriptors
4139 pertaining to the function. This is mainly useful for joining
4140 with other instances of such identifiers. (The specific format
4141 of the identifier is not defined and not guaranteed to remain
4142 the same in future versions.)
4147 <entry><literal>routine_body</literal></entry>
4148 <entry><type>character_data</type></entry>
4150 If the function is an SQL function, then
4151 <literal>SQL</literal>, else <literal>EXTERNAL</literal>.
4156 <entry><literal>routine_definition</literal></entry>
4157 <entry><type>character_data</type></entry>
4159 The source text of the function (null if the function is not
4160 owned by a currently enabled role). (According to the SQL
4161 standard, this column is only applicable if
4162 <literal>routine_body</literal> is <literal>SQL</literal>, but
4163 in <productname>PostgreSQL</productname> it will contain
4164 whatever source text was specified when the function was
4170 <entry><literal>external_name</literal></entry>
4171 <entry><type>character_data</type></entry>
4173 If this function is a C function, then the external name (link
4174 symbol) of the function; else null. (This works out to be the
4175 same value that is shown in
4176 <literal>routine_definition</literal>.)
4181 <entry><literal>external_language</literal></entry>
4182 <entry><type>character_data</type></entry>
4183 <entry>The language the function is written in</entry>
4187 <entry><literal>parameter_style</literal></entry>
4188 <entry><type>character_data</type></entry>
4190 Always <literal>GENERAL</literal> (The SQL standard defines
4191 other parameter styles, which are not available in <productname>PostgreSQL</>.)
4196 <entry><literal>is_deterministic</literal></entry>
4197 <entry><type>yes_or_no</type></entry>
4199 If the function is declared immutable (called deterministic in
4200 the SQL standard), then <literal>YES</literal>, else
4201 <literal>NO</literal>. (You cannot query the other volatility
4202 levels available in <productname>PostgreSQL</> through the information schema.)
4207 <entry><literal>sql_data_access</literal></entry>
4208 <entry><type>character_data</type></entry>
4210 Always <literal>MODIFIES</literal>, meaning that the function
4211 possibly modifies SQL data. This information is not useful for
4212 <productname>PostgreSQL</>.
4217 <entry><literal>is_null_call</literal></entry>
4218 <entry><type>yes_or_no</type></entry>
4220 If the function automatically returns null if any of its
4221 arguments are null, then <literal>YES</literal>, else
4222 <literal>NO</literal>.
4227 <entry><literal>sql_path</literal></entry>
4228 <entry><type>character_data</type></entry>
4229 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4233 <entry><literal>schema_level_routine</literal></entry>
4234 <entry><type>yes_or_no</type></entry>
4236 Always <literal>YES</literal> (The opposite would be a method
4237 of a user-defined type, which is a feature not available in
4238 <productname>PostgreSQL</>.)
4243 <entry><literal>max_dynamic_result_sets</literal></entry>
4244 <entry><type>cardinal_number</type></entry>
4245 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4249 <entry><literal>is_user_defined_cast</literal></entry>
4250 <entry><type>yes_or_no</type></entry>
4251 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4255 <entry><literal>is_implicitly_invocable</literal></entry>
4256 <entry><type>yes_or_no</type></entry>
4257 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4261 <entry><literal>security_type</literal></entry>
4262 <entry><type>character_data</type></entry>
4264 If the function runs with the privileges of the current user,
4265 then <literal>INVOKER</literal>, if the function runs with the
4266 privileges of the user who defined it, then
4267 <literal>DEFINER</literal>.
4272 <entry><literal>to_sql_specific_catalog</literal></entry>
4273 <entry><type>sql_identifier</type></entry>
4274 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4278 <entry><literal>to_sql_specific_schema</literal></entry>
4279 <entry><type>sql_identifier</type></entry>
4280 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4284 <entry><literal>to_sql_specific_name</literal></entry>
4285 <entry><type>sql_identifier</type></entry>
4286 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4290 <entry><literal>as_locator</literal></entry>
4291 <entry><type>yes_or_no</type></entry>
4292 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4296 <entry><literal>created</literal></entry>
4297 <entry><type>time_stamp</type></entry>
4298 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4302 <entry><literal>last_altered</literal></entry>
4303 <entry><type>time_stamp</type></entry>
4304 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4308 <entry><literal>new_savepoint_level</literal></entry>
4309 <entry><type>yes_or_no</type></entry>
4310 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4314 <entry><literal>is_udt_dependent</literal></entry>
4315 <entry><type>yes_or_no</type></entry>
4317 Currently always <literal>NO</literal>. The alternative
4318 <literal>YES</literal> applies to a feature not available in
4319 <productname>PostgreSQL</></entry>.
4323 <entry><literal>result_cast_from_data_type</literal></entry>
4324 <entry><type>character_data</type></entry>
4325 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4329 <entry><literal>result_cast_as_locator</literal></entry>
4330 <entry><type>yes_or_no</type></entry>
4331 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4335 <entry><literal>result_cast_char_max_length</literal></entry>
4336 <entry><type>cardinal_number</type></entry>
4337 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4341 <entry><literal>result_cast_char_octet_length</literal></entry>
4342 <entry><type>character_data</type></entry>
4343 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4347 <entry><literal>result_cast_char_set_catalog</literal></entry>
4348 <entry><type>sql_identifier</type></entry>
4349 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4353 <entry><literal>result_cast_char_set_schema</literal></entry>
4354 <entry><type>sql_identifier</type></entry>
4355 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4359 <entry><literal>result_cast_char_set_name</literal></entry>
4360 <entry><type>sql_identifier</type></entry>
4361 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4365 <entry><literal>result_cast_collation_catalog</literal></entry>
4366 <entry><type>sql_identifier</type></entry>
4367 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4371 <entry><literal>result_cast_collation_schema</literal></entry>
4372 <entry><type>sql_identifier</type></entry>
4373 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4377 <entry><literal>result_cast_collation_name</literal></entry>
4378 <entry><type>sql_identifier</type></entry>
4379 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4383 <entry><literal>result_cast_numeric_precision</literal></entry>
4384 <entry><type>cardinal_number</type></entry>
4385 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4389 <entry><literal>result_cast_numeric_precision_radix</literal></entry>
4390 <entry><type>cardinal_number</type></entry>
4391 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4395 <entry><literal>result_cast_numeric_scale</literal></entry>
4396 <entry><type>cardinal_number</type></entry>
4397 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4401 <entry><literal>result_cast_datetime_precision</literal></entry>
4402 <entry><type>character_data</type></entry>
4403 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4407 <entry><literal>result_cast_interval_type</literal></entry>
4408 <entry><type>character_data</type></entry>
4409 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4413 <entry><literal>result_cast_interval_precision</literal></entry>
4414 <entry><type>cardinal_number</type></entry>
4415 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4419 <entry><literal>result_cast_type_udt_catalog</literal></entry>
4420 <entry><type>sql_identifier</type></entry>
4421 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4425 <entry><literal>result_cast_type_udt_schema</literal></entry>
4426 <entry><type>sql_identifier</type></entry>
4427 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4431 <entry><literal>result_cast_type_udt_name</literal></entry>
4432 <entry><type>sql_identifier</type></entry>
4433 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4437 <entry><literal>result_cast_scope_catalog</literal></entry>
4438 <entry><type>sql_identifier</type></entry>
4439 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4443 <entry><literal>result_cast_scope_schema</literal></entry>
4444 <entry><type>sql_identifier</type></entry>
4445 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4449 <entry><literal>result_cast_scope_name</literal></entry>
4450 <entry><type>sql_identifier</type></entry>
4451 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4455 <entry><literal>result_cast_maximum_cardinality</literal></entry>
4456 <entry><type>cardinal_number</type></entry>
4457 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4461 <entry><literal>result_cast_dtd_identifier</literal></entry>
4462 <entry><type>sql_identifier</type></entry>
4463 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4470 <sect1 id="infoschema-schemata">
4471 <title><literal>schemata</literal></title>
4474 The view <literal>schemata</literal> contains all schemas in the
4475 current database that are owned by a currently enabled role.
4479 <title><literal>schemata</literal> Columns</title>
4485 <entry>Data Type</entry>
4486 <entry>Description</entry>
4492 <entry><literal>catalog_name</literal></entry>
4493 <entry><type>sql_identifier</type></entry>
4494 <entry>Name of the database that the schema is contained in (always the current database)</entry>
4498 <entry><literal>schema_name</literal></entry>
4499 <entry><type>sql_identifier</type></entry>
4500 <entry>Name of the schema</entry>
4504 <entry><literal>schema_owner</literal></entry>
4505 <entry><type>sql_identifier</type></entry>
4506 <entry>Name of the owner of the schema</entry>
4510 <entry><literal>default_character_set_catalog</literal></entry>
4511 <entry><type>sql_identifier</type></entry>
4512 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4516 <entry><literal>default_character_set_schema</literal></entry>
4517 <entry><type>sql_identifier</type></entry>
4518 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4522 <entry><literal>default_character_set_name</literal></entry>
4523 <entry><type>sql_identifier</type></entry>
4524 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4528 <entry><literal>sql_path</literal></entry>
4529 <entry><type>character_data</type></entry>
4530 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4537 <sect1 id="infoschema-sequences">
4538 <title><literal>sequences</literal></title>
4541 The view <literal>sequences</literal> contains all sequences
4542 defined in the current database. Only those sequences are shown
4543 that the current user has access to (by way of being the owner or
4544 having some privilege).
4548 <title><literal>sequences</literal> Columns</title>
4554 <entry>Data Type</entry>
4555 <entry>Description</entry>
4561 <entry><literal>sequence_catalog</literal></entry>
4562 <entry><type>sql_identifier</type></entry>
4563 <entry>Name of the database that contains the sequence (always the current database)</entry>
4567 <entry><literal>sequence_schema</literal></entry>
4568 <entry><type>sql_identifier</type></entry>
4569 <entry>Name of the schema that contains the sequence</entry>
4573 <entry><literal>sequence_name</literal></entry>
4574 <entry><type>sql_identifier</type></entry>
4575 <entry>Name of the sequence</entry>
4579 <entry><literal>data_type</literal></entry>
4580 <entry><type>character_data</type></entry>
4582 The data type of the sequence. In
4583 <productname>PostgreSQL</productname>, this is currently always
4584 <literal>bigint</literal>.
4589 <entry><literal>numeric_precision</literal></entry>
4590 <entry><type>cardinal_number</type></entry>
4592 This column contains the (declared or implicit) precision of
4593 the sequence data type (see above). The precision indicates
4594 the number of significant digits. It can be expressed in
4595 decimal (base 10) or binary (base 2) terms, as specified in the
4596 column <literal>numeric_precision_radix</literal>.
4601 <entry><literal>numeric_precision_radix</literal></entry>
4602 <entry><type>cardinal_number</type></entry>
4604 This column indicates in which base the values in the columns
4605 <literal>numeric_precision</literal> and
4606 <literal>numeric_scale</literal> are expressed. The value is
4612 <entry><literal>numeric_scale</literal></entry>
4613 <entry><type>cardinal_number</type></entry>
4615 This column contains the (declared or implicit) scale of the
4616 sequence data type (see above). The scale indicates the number
4617 of significant digits to the right of the decimal point. It
4618 can be expressed in decimal (base 10) or binary (base 2) terms,
4619 as specified in the column
4620 <literal>numeric_precision_radix</literal>.
4625 <entry><literal>start_value</literal></entry>
4626 <entry><type>character_data</type></entry>
4627 <entry>The start value of the sequence</entry>
4631 <entry><literal>minimum_value</literal></entry>
4632 <entry><type>character_data</type></entry>
4633 <entry>The minimum value of the sequence</entry>
4637 <entry><literal>maximum_value</literal></entry>
4638 <entry><type>character_data</type></entry>
4639 <entry>The maximum value of the sequence</entry>
4643 <entry><literal>increment</literal></entry>
4644 <entry><type>character_data</type></entry>
4645 <entry>The increment of the sequence</entry>
4649 <entry><literal>cycle_option</literal></entry>
4650 <entry><type>yes_or_no</type></entry>
4651 <entry><literal>YES</literal> if the sequence cycles, else <literal>NO</literal></entry>
4658 Note that in accordance with the SQL standard, the start, minimum,
4659 maximum, and increment values are returned as character strings.
4663 <sect1 id="infoschema-sql-features">
4664 <title><literal>sql_features</literal></title>
4667 The table <literal>sql_features</literal> contains information
4668 about which formal features defined in the SQL standard are
4669 supported by <productname>PostgreSQL</productname>. This is the
4670 same information that is presented in <xref linkend="features">.
4671 There you can also find some additional background information.
4675 <title><literal>sql_features</literal> Columns</title>
4681 <entry>Data Type</entry>
4682 <entry>Description</entry>
4688 <entry><literal>feature_id</literal></entry>
4689 <entry><type>character_data</type></entry>
4690 <entry>Identifier string of the feature</entry>
4694 <entry><literal>feature_name</literal></entry>
4695 <entry><type>character_data</type></entry>
4696 <entry>Descriptive name of the feature</entry>
4700 <entry><literal>sub_feature_id</literal></entry>
4701 <entry><type>character_data</type></entry>
4702 <entry>Identifier string of the subfeature, or a zero-length string if not a subfeature</entry>
4706 <entry><literal>sub_feature_name</literal></entry>
4707 <entry><type>character_data</type></entry>
4708 <entry>Descriptive name of the subfeature, or a zero-length string if not a subfeature</entry>
4712 <entry><literal>is_supported</literal></entry>
4713 <entry><type>yes_or_no</type></entry>
4715 <literal>YES</literal> if the feature is fully supported by the
4716 current version of <productname>PostgreSQL</>, <literal>NO</literal> if not
4721 <entry><literal>is_verified_by</literal></entry>
4722 <entry><type>character_data</type></entry>
4724 Always null, since the <productname>PostgreSQL</> development group does not
4725 perform formal testing of feature conformance
4730 <entry><literal>comments</literal></entry>
4731 <entry><type>character_data</type></entry>
4732 <entry>Possibly a comment about the supported status of the feature</entry>
4739 <sect1 id="infoschema-sql-implementation-info">
4740 <title><literal>sql_implementation_info</literal></title>
4743 The table <literal>sql_implementation_info</literal> contains
4744 information about various aspects that are left
4745 implementation-defined by the SQL standard. This information is
4746 primarily intended for use in the context of the ODBC interface;
4747 users of other interfaces will probably find this information to be
4748 of little use. For this reason, the individual implementation
4749 information items are not described here; you will find them in the
4750 description of the ODBC interface.
4754 <title><literal>sql_implementation_info</literal> Columns</title>
4760 <entry>Data Type</entry>
4761 <entry>Description</entry>
4767 <entry><literal>implementation_info_id</literal></entry>
4768 <entry><type>character_data</type></entry>
4769 <entry>Identifier string of the implementation information item</entry>
4773 <entry><literal>implementation_info_name</literal></entry>
4774 <entry><type>character_data</type></entry>
4775 <entry>Descriptive name of the implementation information item</entry>
4779 <entry><literal>integer_value</literal></entry>
4780 <entry><type>cardinal_number</type></entry>
4782 Value of the implementation information item, or null if the
4783 value is contained in the column
4784 <literal>character_value</literal>
4789 <entry><literal>character_value</literal></entry>
4790 <entry><type>character_data</type></entry>
4792 Value of the implementation information item, or null if the
4793 value is contained in the column
4794 <literal>integer_value</literal>
4799 <entry><literal>comments</literal></entry>
4800 <entry><type>character_data</type></entry>
4801 <entry>Possibly a comment pertaining to the implementation information item</entry>
4808 <sect1 id="infoschema-sql-languages">
4809 <title><literal>sql_languages</literal></title>
4812 The table <literal>sql_languages</literal> contains one row for
4813 each SQL language binding that is supported by
4814 <productname>PostgreSQL</productname>.
4815 <productname>PostgreSQL</productname> supports direct SQL and
4816 embedded SQL in C; that is all you will learn from this table.
4820 <title><literal>sql_languages</literal> Columns</title>
4826 <entry>Data Type</entry>
4827 <entry>Description</entry>
4833 <entry><literal>sql_language_source</literal></entry>
4834 <entry><type>character_data</type></entry>
4836 The name of the source of the language definition; always
4837 <literal>ISO 9075</literal>, that is, the SQL standard
4842 <entry><literal>sql_language_year</literal></entry>
4843 <entry><type>character_data</type></entry>
4845 The year the standard referenced in
4846 <literal>sql_language_source</literal> was approved; currently
4852 <entry><literal>sql_language_conformance</literal></entry>
4853 <entry><type>character_data</type></entry>
4855 The standard conformance level for the language binding. For
4856 ISO 9075:2003 this is always <literal>CORE</literal>.
4861 <entry><literal>sql_language_integrity</literal></entry>
4862 <entry><type>character_data</type></entry>
4863 <entry>Always null (This value is relevant to an earlier version of the SQL standard.)</entry>
4867 <entry><literal>sql_language_implementation</literal></entry>
4868 <entry><type>character_data</type></entry>
4869 <entry>Always null</entry>
4873 <entry><literal>sql_language_binding_style</literal></entry>
4874 <entry><type>character_data</type></entry>
4876 The language binding style, either <literal>DIRECT</literal> or
4877 <literal>EMBEDDED</literal>
4882 <entry><literal>sql_language_programming_language</literal></entry>
4883 <entry><type>character_data</type></entry>
4885 The programming language, if the binding style is
4886 <literal>EMBEDDED</literal>, else null. <productname>PostgreSQL</> only
4887 supports the language C.
4895 <sect1 id="infoschema-sql-packages">
4896 <title><literal>sql_packages</literal></title>
4899 The table <literal>sql_packages</literal> contains information
4900 about which feature packages defined in the SQL standard are
4901 supported by <productname>PostgreSQL</productname>. Refer to <xref
4902 linkend="features"> for background information on feature packages.
4906 <title><literal>sql_packages</literal> Columns</title>
4912 <entry>Data Type</entry>
4913 <entry>Description</entry>
4919 <entry><literal>feature_id</literal></entry>
4920 <entry><type>character_data</type></entry>
4921 <entry>Identifier string of the package</entry>
4925 <entry><literal>feature_name</literal></entry>
4926 <entry><type>character_data</type></entry>
4927 <entry>Descriptive name of the package</entry>
4931 <entry><literal>is_supported</literal></entry>
4932 <entry><type>yes_or_no</type></entry>
4934 <literal>YES</literal> if the package is fully supported by the
4935 current version of <productname>PostgreSQL</>, <literal>NO</literal> if not
4940 <entry><literal>is_verified_by</literal></entry>
4941 <entry><type>character_data</type></entry>
4943 Always null, since the <productname>PostgreSQL</> development group does not
4944 perform formal testing of feature conformance
4949 <entry><literal>comments</literal></entry>
4950 <entry><type>character_data</type></entry>
4951 <entry>Possibly a comment about the supported status of the package</entry>
4958 <sect1 id="infoschema-sql-parts">
4959 <title><literal>sql_parts</literal></title>
4962 The table <literal>sql_parts</literal> contains information about
4963 which of the several parts of the SQL standard are supported by
4964 <productname>PostgreSQL</productname>.
4968 <title><literal>sql_parts</literal> Columns</title>
4974 <entry>Data Type</entry>
4975 <entry>Description</entry>
4981 <entry><literal>feature_id</literal></entry>
4982 <entry><type>character_data</type></entry>
4983 <entry>An identifier string containing the number of the part</entry>
4987 <entry><literal>feature_name</literal></entry>
4988 <entry><type>character_data</type></entry>
4989 <entry>Descriptive name of the part</entry>
4993 <entry><literal>is_supported</literal></entry>
4994 <entry><type>yes_or_no</type></entry>
4996 <literal>YES</literal> if the part is fully supported by the
4997 current version of <productname>PostgreSQL</>,
4998 <literal>NO</literal> if not
5003 <entry><literal>is_verified_by</literal></entry>
5004 <entry><type>character_data</type></entry>
5006 Always null, since the <productname>PostgreSQL</> development group does not
5007 perform formal testing of feature conformance
5012 <entry><literal>comments</literal></entry>
5013 <entry><type>character_data</type></entry>
5014 <entry>Possibly a comment about the supported status of the part</entry>
5021 <sect1 id="infoschema-sql-sizing">
5022 <title><literal>sql_sizing</literal></title>
5025 The table <literal>sql_sizing</literal> contains information about
5026 various size limits and maximum values in
5027 <productname>PostgreSQL</productname>. This information is
5028 primarily intended for use in the context of the ODBC interface;
5029 users of other interfaces will probably find this information to be
5030 of little use. For this reason, the individual sizing items are
5031 not described here; you will find them in the description of the
5036 <title><literal>sql_sizing</literal> Columns</title>
5042 <entry>Data Type</entry>
5043 <entry>Description</entry>
5049 <entry><literal>sizing_id</literal></entry>
5050 <entry><type>cardinal_number</type></entry>
5051 <entry>Identifier of the sizing item</entry>
5055 <entry><literal>sizing_name</literal></entry>
5056 <entry><type>character_data</type></entry>
5057 <entry>Descriptive name of the sizing item</entry>
5061 <entry><literal>supported_value</literal></entry>
5062 <entry><type>cardinal_number</type></entry>
5064 Value of the sizing item, or 0 if the size is unlimited or
5065 cannot be determined, or null if the features for which the
5066 sizing item is applicable are not supported
5071 <entry><literal>comments</literal></entry>
5072 <entry><type>character_data</type></entry>
5073 <entry>Possibly a comment pertaining to the sizing item</entry>
5080 <sect1 id="infoschema-sql-sizing-profiles">
5081 <title><literal>sql_sizing_profiles</literal></title>
5084 The table <literal>sql_sizing_profiles</literal> contains
5085 information about the <literal>sql_sizing</literal> values that are
5086 required by various profiles of the SQL standard. <productname>PostgreSQL</> does
5087 not track any SQL profiles, so this table is empty.
5091 <title><literal>sql_sizing_profiles</literal> Columns</title>
5097 <entry>Data Type</entry>
5098 <entry>Description</entry>
5104 <entry><literal>sizing_id</literal></entry>
5105 <entry><type>cardinal_number</type></entry>
5106 <entry>Identifier of the sizing item</entry>
5110 <entry><literal>sizing_name</literal></entry>
5111 <entry><type>character_data</type></entry>
5112 <entry>Descriptive name of the sizing item</entry>
5116 <entry><literal>profile_id</literal></entry>
5117 <entry><type>character_data</type></entry>
5118 <entry>Identifier string of a profile</entry>
5122 <entry><literal>required_value</literal></entry>
5123 <entry><type>cardinal_number</type></entry>
5125 The value required by the SQL profile for the sizing item, or 0
5126 if the profile places no limit on the sizing item, or null if
5127 the profile does not require any of the features for which the
5128 sizing item is applicable
5133 <entry><literal>comments</literal></entry>
5134 <entry><type>character_data</type></entry>
5135 <entry>Possibly a comment pertaining to the sizing item within the profile</entry>
5142 <sect1 id="infoschema-table-constraints">
5143 <title><literal>table_constraints</literal></title>
5146 The view <literal>table_constraints</literal> contains all
5147 constraints belonging to tables that the current user owns or has
5148 some non-SELECT privilege on.
5152 <title><literal>table_constraints</literal> Columns</title>
5158 <entry>Data Type</entry>
5159 <entry>Description</entry>
5165 <entry><literal>constraint_catalog</literal></entry>
5166 <entry><type>sql_identifier</type></entry>
5167 <entry>Name of the database that contains the constraint (always the current database)</entry>
5171 <entry><literal>constraint_schema</literal></entry>
5172 <entry><type>sql_identifier</type></entry>
5173 <entry>Name of the schema that contains the constraint</entry>
5177 <entry><literal>constraint_name</literal></entry>
5178 <entry><type>sql_identifier</type></entry>
5179 <entry>Name of the constraint</entry>
5183 <entry><literal>table_catalog</literal></entry>
5184 <entry><type>sql_identifier</type></entry>
5185 <entry>Name of the database that contains the table (always the current database)</entry>
5189 <entry><literal>table_schema</literal></entry>
5190 <entry><type>sql_identifier</type></entry>
5191 <entry>Name of the schema that contains the table</entry>
5195 <entry><literal>table_name</literal></entry>
5196 <entry><type>sql_identifier</type></entry>
5197 <entry>Name of the table</entry>
5201 <entry><literal>constraint_type</literal></entry>
5202 <entry><type>character_data</type></entry>
5204 Type of the constraint: <literal>CHECK</literal>,
5205 <literal>FOREIGN KEY</literal>, <literal>PRIMARY KEY</literal>,
5206 or <literal>UNIQUE</literal>
5211 <entry><literal>is_deferrable</literal></entry>
5212 <entry><type>yes_or_no</type></entry>
5213 <entry><literal>YES</literal> if the constraint is deferrable, <literal>NO</literal> if not</entry>
5217 <entry><literal>initially_deferred</literal></entry>
5218 <entry><type>yes_or_no</type></entry>
5219 <entry><literal>YES</literal> if the constraint is deferrable and initially deferred, <literal>NO</literal> if not</entry>
5226 <sect1 id="infoschema-table-privileges">
5227 <title><literal>table_privileges</literal></title>
5230 The view <literal>table_privileges</literal> identifies all
5231 privileges granted on tables or views to a currently enabled role
5232 or by a currently enabled role. There is one row for each
5233 combination of table, grantor, and grantee.
5237 <title><literal>table_privileges</literal> Columns</title>
5243 <entry>Data Type</entry>
5244 <entry>Description</entry>
5250 <entry><literal>grantor</literal></entry>
5251 <entry><type>sql_identifier</type></entry>
5252 <entry>Name of the role that granted the privilege</entry>
5256 <entry><literal>grantee</literal></entry>
5257 <entry><type>sql_identifier</type></entry>
5258 <entry>Name of the role that the privilege was granted to</entry>
5262 <entry><literal>table_catalog</literal></entry>
5263 <entry><type>sql_identifier</type></entry>
5264 <entry>Name of the database that contains the table (always the current database)</entry>
5268 <entry><literal>table_schema</literal></entry>
5269 <entry><type>sql_identifier</type></entry>
5270 <entry>Name of the schema that contains the table</entry>
5274 <entry><literal>table_name</literal></entry>
5275 <entry><type>sql_identifier</type></entry>
5276 <entry>Name of the table</entry>
5280 <entry><literal>privilege_type</literal></entry>
5281 <entry><type>character_data</type></entry>
5283 Type of the privilege: <literal>SELECT</literal>,
5284 <literal>INSERT</literal>, <literal>UPDATE</literal>,
5285 <literal>DELETE</literal>, <literal>TRUNCATE</literal>,
5286 <literal>REFERENCES</literal>, or <literal>TRIGGER</literal>
5291 <entry><literal>is_grantable</literal></entry>
5292 <entry><type>yes_or_no</type></entry>
5293 <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
5297 <entry><literal>with_hierarchy</literal></entry>
5298 <entry><type>yes_or_no</type></entry>
5299 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5306 <sect1 id="infoschema-tables">
5307 <title><literal>tables</literal></title>
5310 The view <literal>tables</literal> contains all tables and views
5311 defined in the current database. Only those tables and views are
5312 shown that the current user has access to (by way of being the
5313 owner or having some privilege).
5317 <title><literal>tables</literal> Columns</title>
5323 <entry>Data Type</entry>
5324 <entry>Description</entry>
5330 <entry><literal>table_catalog</literal></entry>
5331 <entry><type>sql_identifier</type></entry>
5332 <entry>Name of the database that contains the table (always the current database)</entry>
5336 <entry><literal>table_schema</literal></entry>
5337 <entry><type>sql_identifier</type></entry>
5338 <entry>Name of the schema that contains the table</entry>
5342 <entry><literal>table_name</literal></entry>
5343 <entry><type>sql_identifier</type></entry>
5344 <entry>Name of the table</entry>
5348 <entry><literal>table_type</literal></entry>
5349 <entry><type>character_data</type></entry>
5351 Type of the table: <literal>BASE TABLE</literal> for a
5352 persistent base table (the normal table type),
5353 <literal>VIEW</literal> for a view, <literal>FOREIGN TABLE</literal>
5354 for a foreign table, or
5355 <literal>LOCAL TEMPORARY</literal> for a temporary table
5360 <entry><literal>self_referencing_column_name</literal></entry>
5361 <entry><type>sql_identifier</type></entry>
5362 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5366 <entry><literal>reference_generation</literal></entry>
5367 <entry><type>character_data</type></entry>
5368 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5372 <entry><literal>user_defined_type_catalog</literal></entry>
5373 <entry><type>sql_identifier</type></entry>
5375 If the table is a typed table, the name of the database that
5376 contains the underlying data type (always the current
5377 database), else null.
5382 <entry><literal>user_defined_type_schema</literal></entry>
5383 <entry><type>sql_identifier</type></entry>
5385 If the table is a typed table, the name of the schema that
5386 contains the underlying data type, else null.
5391 <entry><literal>user_defined_type_name</literal></entry>
5392 <entry><type>sql_identifier</type></entry>
5394 If the table is a typed table, the name of the underlying data
5400 <entry><literal>is_insertable_into</literal></entry>
5401 <entry><type>yes_or_no</type></entry>
5403 <literal>YES</literal> if the table is insertable into,
5404 <literal>NO</literal> if not (Base tables are always insertable
5405 into, views not necessarily.)
5410 <entry><literal>is_typed</literal></entry>
5411 <entry><type>yes_or_no</type></entry>
5412 <entry><literal>YES</literal> if the table is a typed table, <literal>NO</literal> if not</entry>
5416 <entry><literal>commit_action</literal></entry>
5417 <entry><type>character_data</type></entry>
5419 If the table is a temporary table, then
5420 <literal>PRESERVE</literal>, else null. (The SQL standard
5421 defines other commit actions for temporary tables, which are
5422 not supported by <productname>PostgreSQL</>.)
5430 <sect1 id="infoschema-triggered-update-columns">
5431 <title><literal>triggered_update_columns</literal></title>
5434 For triggers in the current database that specify a column list
5435 (like <literal>UPDATE OF column1, column2</literal>), the
5436 view <literal>triggered_update_columns</literal> identifies these
5437 columns. Triggers that do not specify a column list are not
5438 included in this view. Only those columns are shown that the
5439 current user owns or has some non-SELECT privilege on.
5443 <title><literal>triggered_update_columns</literal> Columns</title>
5449 <entry>Data Type</entry>
5450 <entry>Description</entry>
5456 <entry><literal>trigger_catalog</literal></entry>
5457 <entry><type>sql_identifier</type></entry>
5458 <entry>Name of the database that contains the trigger (always the current database)</entry>
5462 <entry><literal>trigger_schema</literal></entry>
5463 <entry><type>sql_identifier</type></entry>
5464 <entry>Name of the schema that contains the trigger</entry>
5468 <entry><literal>trigger_name</literal></entry>
5469 <entry><type>sql_identifier</type></entry>
5470 <entry>Name of the trigger</entry>
5474 <entry><literal>event_object_catalog</literal></entry>
5475 <entry><type>sql_identifier</type></entry>
5477 Name of the database that contains the table that the trigger
5478 is defined on (always the current database)
5483 <entry><literal>event_object_schema</literal></entry>
5484 <entry><type>sql_identifier</type></entry>
5485 <entry>Name of the schema that contains the table that the trigger is defined on</entry>
5489 <entry><literal>event_object_table</literal></entry>
5490 <entry><type>sql_identifier</type></entry>
5491 <entry>Name of the table that the trigger is defined on</entry>
5495 <entry><literal>event_object_column</literal></entry>
5496 <entry><type>sql_identifier</type></entry>
5497 <entry>Name of the column that the trigger is defined on</entry>
5504 <sect1 id="infoschema-triggers">
5505 <title><literal>triggers</literal></title>
5508 The view <literal>triggers</literal> contains all triggers defined
5509 in the current database on tables and views that the current user owns
5510 or has some non-SELECT privilege on.
5514 <title><literal>triggers</literal> Columns</title>
5520 <entry>Data Type</entry>
5521 <entry>Description</entry>
5527 <entry><literal>trigger_catalog</literal></entry>
5528 <entry><type>sql_identifier</type></entry>
5529 <entry>Name of the database that contains the trigger (always the current database)</entry>
5533 <entry><literal>trigger_schema</literal></entry>
5534 <entry><type>sql_identifier</type></entry>
5535 <entry>Name of the schema that contains the trigger</entry>
5539 <entry><literal>trigger_name</literal></entry>
5540 <entry><type>sql_identifier</type></entry>
5541 <entry>Name of the trigger</entry>
5545 <entry><literal>event_manipulation</literal></entry>
5546 <entry><type>character_data</type></entry>
5548 Event that fires the trigger (<literal>INSERT</literal>,
5549 <literal>UPDATE</literal>, or <literal>DELETE</literal>)
5554 <entry><literal>event_object_catalog</literal></entry>
5555 <entry><type>sql_identifier</type></entry>
5557 Name of the database that contains the table that the trigger
5558 is defined on (always the current database)
5563 <entry><literal>event_object_schema</literal></entry>
5564 <entry><type>sql_identifier</type></entry>
5565 <entry>Name of the schema that contains the table that the trigger is defined on</entry>
5569 <entry><literal>event_object_table</literal></entry>
5570 <entry><type>sql_identifier</type></entry>
5571 <entry>Name of the table that the trigger is defined on</entry>
5575 <entry><literal>action_order</literal></entry>
5576 <entry><type>cardinal_number</type></entry>
5577 <entry>Not yet implemented</entry>
5581 <entry><literal>action_condition</literal></entry>
5582 <entry><type>character_data</type></entry>
5584 <literal>WHEN</literal> condition of the trigger, null if none
5585 (also null if the table is not owned by a currently enabled
5591 <entry><literal>action_statement</literal></entry>
5592 <entry><type>character_data</type></entry>
5594 Statement that is executed by the trigger (currently always
5595 <literal>EXECUTE PROCEDURE
5596 <replaceable>function</replaceable>(...)</literal>)
5601 <entry><literal>action_orientation</literal></entry>
5602 <entry><type>character_data</type></entry>
5604 Identifies whether the trigger fires once for each processed
5605 row or once for each statement (<literal>ROW</literal> or
5606 <literal>STATEMENT</literal>)
5611 <entry><literal>action_timing</literal></entry>
5612 <entry><type>character_data</type></entry>
5614 Time at which the trigger fires (<literal>BEFORE</literal>,
5615 <literal>AFTER</literal>, or <literal>INSTEAD OF</literal>)
5620 <entry><literal>action_reference_old_table</literal></entry>
5621 <entry><type>sql_identifier</type></entry>
5622 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5626 <entry><literal>action_reference_new_table</literal></entry>
5627 <entry><type>sql_identifier</type></entry>
5628 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5632 <entry><literal>action_reference_old_row</literal></entry>
5633 <entry><type>sql_identifier</type></entry>
5634 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5638 <entry><literal>action_reference_new_row</literal></entry>
5639 <entry><type>sql_identifier</type></entry>
5640 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5644 <entry><literal>created</literal></entry>
5645 <entry><type>time_stamp</type></entry>
5646 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5653 Triggers in <productname>PostgreSQL</productname> have two
5654 incompatibilities with the SQL standard that affect the
5655 representation in the information schema. First, trigger names are
5656 local to each table in <productname>PostgreSQL</productname>, rather
5657 than being independent schema objects. Therefore there can be duplicate
5658 trigger names defined in one schema, so long as they belong to
5659 different tables. (<literal>trigger_catalog</literal> and
5660 <literal>trigger_schema</literal> are really the values pertaining
5661 to the table that the trigger is defined on.) Second, triggers can
5662 be defined to fire on multiple events in
5663 <productname>PostgreSQL</productname> (e.g., <literal>ON INSERT OR
5664 UPDATE</literal>), whereas the SQL standard only allows one. If a
5665 trigger is defined to fire on multiple events, it is represented as
5666 multiple rows in the information schema, one for each type of
5667 event. As a consequence of these two issues, the primary key of
5668 the view <literal>triggers</literal> is really
5669 <literal>(trigger_catalog, trigger_schema, event_object_table,
5670 trigger_name, event_manipulation)</literal> instead of
5671 <literal>(trigger_catalog, trigger_schema, trigger_name)</literal>,
5672 which is what the SQL standard specifies. Nonetheless, if you
5673 define your triggers in a manner that conforms with the SQL
5674 standard (trigger names unique in the schema and only one event
5675 type per trigger), this will not affect you.
5680 Prior to <productname>PostgreSQL</> 9.1, this view's columns
5681 <structfield>action_timing</structfield>,
5682 <structfield>action_reference_old_table</structfield>,
5683 <structfield>action_reference_new_table</structfield>,
5684 <structfield>action_reference_old_row</structfield>, and
5685 <structfield>action_reference_new_row</structfield>
5687 <structfield>condition_timing</structfield>,
5688 <structfield>condition_reference_old_table</structfield>,
5689 <structfield>condition_reference_new_table</structfield>,
5690 <structfield>condition_reference_old_row</structfield>, and
5691 <structfield>condition_reference_new_row</structfield>
5693 That was how they were named in the SQL:1999 standard.
5694 The new naming conforms to SQL:2003 and later.
5699 <sect1 id="infoschema-udt-privileges">
5700 <title><literal>udt_privileges</literal></title>
5703 The view <literal>udt_privileges</literal> is intended to identify
5704 <literal>USAGE</literal> privileges granted on user-defined types
5705 to a currently enabled role or by a currently enabled role. Since
5706 data types do not have real privileges
5707 in <productname>PostgreSQL</productname>, this view shows implicit
5708 non-grantable <literal>USAGE</literal> privileges granted by the
5709 owner to <literal>PUBLIC</literal> for all types, including
5710 built-in ones (except domains,
5711 see <xref linkend="infoschema-usage-privileges"> for that).
5715 <title><literal>udt_privileges</literal> Columns</title>
5721 <entry>Data Type</entry>
5722 <entry>Description</entry>
5728 <entry><literal>grantor</literal></entry>
5729 <entry><type>sql_identifier</type></entry>
5730 <entry>Name of the role that granted the privilege</entry>
5734 <entry><literal>grantee</literal></entry>
5735 <entry><type>sql_identifier</type></entry>
5736 <entry>Name of the role that the privilege was granted to</entry>
5740 <entry><literal>udt_catalog</literal></entry>
5741 <entry><type>sql_identifier</type></entry>
5742 <entry>Name of the database containing the type (always the current database)</entry>
5746 <entry><literal>udt_schema</literal></entry>
5747 <entry><type>sql_identifier</type></entry>
5748 <entry>Name of the schema containing the type</entry>
5752 <entry><literal>udt_name</literal></entry>
5753 <entry><type>sql_identifier</type></entry>
5754 <entry>Name of the type</entry>
5758 <entry><literal>privilege_type</literal></entry>
5759 <entry><type>character_data</type></entry>
5760 <entry>Always <literal>TYPE USAGE</literal></entry>
5764 <entry><literal>is_grantable</literal></entry>
5765 <entry><type>yes_or_no</type></entry>
5766 <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
5773 <sect1 id="infoschema-usage-privileges">
5774 <title><literal>usage_privileges</literal></title>
5777 The view <literal>usage_privileges</literal> identifies
5778 <literal>USAGE</literal> privileges granted on various kinds of
5779 objects to a currently enabled role or by a currently enabled role.
5780 In <productname>PostgreSQL</productname>, this currently applies to
5781 collations, domains, foreign-data wrappers, and foreign servers. There is one
5782 row for each combination of object, grantor, and grantee.
5786 Since collations and domains do not have real privileges
5787 in <productname>PostgreSQL</productname>, this view shows implicit
5788 non-grantable <literal>USAGE</literal> privileges granted by the
5789 owner to <literal>PUBLIC</literal> for all collations and domains. The other
5790 object types, however, show real privileges.
5794 <title><literal>usage_privileges</literal> Columns</title>
5800 <entry>Data Type</entry>
5801 <entry>Description</entry>
5807 <entry><literal>grantor</literal></entry>
5808 <entry><type>sql_identifier</type></entry>
5809 <entry>Name of the role that granted the privilege</entry>
5813 <entry><literal>grantee</literal></entry>
5814 <entry><type>sql_identifier</type></entry>
5815 <entry>Name of the role that the privilege was granted to</entry>
5819 <entry><literal>object_catalog</literal></entry>
5820 <entry><type>sql_identifier</type></entry>
5821 <entry>Name of the database containing the object (always the current database)</entry>
5825 <entry><literal>object_schema</literal></entry>
5826 <entry><type>sql_identifier</type></entry>
5827 <entry>Name of the schema containing the object, if applicable,
5828 else an empty string</entry>
5832 <entry><literal>object_name</literal></entry>
5833 <entry><type>sql_identifier</type></entry>
5834 <entry>Name of the object</entry>
5838 <entry><literal>object_type</literal></entry>
5839 <entry><type>character_data</type></entry>
5840 <entry><literal>COLLATION</literal> or <literal>DOMAIN</literal> or <literal>FOREIGN DATA WRAPPER</literal> or <literal>FOREIGN SERVER</literal></entry>
5844 <entry><literal>privilege_type</literal></entry>
5845 <entry><type>character_data</type></entry>
5846 <entry>Always <literal>USAGE</literal></entry>
5850 <entry><literal>is_grantable</literal></entry>
5851 <entry><type>yes_or_no</type></entry>
5852 <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
5859 <sect1 id="infoschema-user-defined-types">
5860 <title><literal>user_defined_types</literal></title>
5863 The view <literal>user_defined_types</literal> currently contains
5864 all composite types defined in the current database.
5868 SQL knows about two kinds of user-defined types: structured types
5869 (also known as composite types
5870 in <productname>PostgreSQL</productname>) and distinct types (not
5871 implemented in <productname>PostgreSQL</productname>). To be
5872 future-proof, use the
5873 column <literal>user_defined_type_category</literal> to
5874 differentiate between these. Other user-defined types such as base
5875 types and enums, which are <productname>PostgreSQL</productname>
5876 extensions, are not shown here. For domains,
5877 see <xref linkend="infoschema-domains"> instead.
5881 <title><literal>user_defined_types</literal> Columns</title>
5887 <entry>Data Type</entry>
5888 <entry>Description</entry>
5894 <entry><literal>user_defined_type_catalog</literal></entry>
5895 <entry><type>sql_identifier</type></entry>
5896 <entry>Name of the database that contains the type (always the current database)</entry>
5900 <entry><literal>user_defined_type_schema</literal></entry>
5901 <entry><type>sql_identifier</type></entry>
5902 <entry>Name of the schema that contains the type</entry>
5906 <entry><literal>user_defined_type_name</literal></entry>
5907 <entry><type>sql_identifier</type></entry>
5908 <entry>Name of the type</entry>
5912 <entry><literal>user_defined_type_category</literal></entry>
5913 <entry><type>character_data</type></entry>
5915 Currently always <literal>STRUCTURED</literal>
5920 <entry><literal>is_instantiable</literal></entry>
5921 <entry><type>yes_or_no</type></entry>
5922 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5926 <entry><literal>is_final</literal></entry>
5927 <entry><type>yes_or_no</type></entry>
5928 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5932 <entry><literal>ordering_form</literal></entry>
5933 <entry><type>character_data</type></entry>
5934 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5938 <entry><literal>ordering_category</literal></entry>
5939 <entry><type>character_data</type></entry>
5940 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5944 <entry><literal>ordering_routine_catalog</literal></entry>
5945 <entry><type>sql_identifier</type></entry>
5946 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5950 <entry><literal>ordering_routine_schema</literal></entry>
5951 <entry><type>sql_identifier</type></entry>
5952 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5956 <entry><literal>ordering_routine_name</literal></entry>
5957 <entry><type>sql_identifier</type></entry>
5958 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5962 <entry><literal>reference_type</literal></entry>
5963 <entry><type>character_data</type></entry>
5964 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5968 <entry><literal>data_type</literal></entry>
5969 <entry><type>character_data</type></entry>
5970 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5974 <entry><literal>character_maximum_length</literal></entry>
5975 <entry><type>cardinal_number</type></entry>
5976 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5980 <entry><literal>character_octet_length</literal></entry>
5981 <entry><type>cardinal_number</type></entry>
5982 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5986 <entry><literal>character_set_catalog</literal></entry>
5987 <entry><type>sql_identifier</type></entry>
5988 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5992 <entry><literal>character_set_schema</literal></entry>
5993 <entry><type>sql_identifier</type></entry>
5994 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5998 <entry><literal>character_set_name</literal></entry>
5999 <entry><type>sql_identifier</type></entry>
6000 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
6004 <entry><literal>collation_catalog</literal></entry>
6005 <entry><type>sql_identifier</type></entry>
6006 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
6010 <entry><literal>collation_schema</literal></entry>
6011 <entry><type>sql_identifier</type></entry>
6012 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
6016 <entry><literal>collation_name</literal></entry>
6017 <entry><type>sql_identifier</type></entry>
6018 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
6022 <entry><literal>numeric_precision</literal></entry>
6023 <entry><type>cardinal_number</type></entry>
6024 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
6028 <entry><literal>numeric_precision_radix</literal></entry>
6029 <entry><type>cardinal_number</type></entry>
6030 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
6034 <entry><literal>numeric_scale</literal></entry>
6035 <entry><type>cardinal_number</type></entry>
6036 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
6040 <entry><literal>datetime_precision</literal></entry>
6041 <entry><type>cardinal_number</type></entry>
6042 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
6046 <entry><literal>interval_type</literal></entry>
6047 <entry><type>character_data</type></entry>
6048 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
6052 <entry><literal>interval_precision</literal></entry>
6053 <entry><type>cardinal_number</type></entry>
6054 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
6058 <entry><literal>source_dtd_identifier</literal></entry>
6059 <entry><type>sql_identifier</type></entry>
6060 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
6064 <entry><literal>ref_dtd_identifier</literal></entry>
6065 <entry><type>sql_identifier</type></entry>
6066 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
6073 <sect1 id="infoschema-user-mapping-options">
6074 <title><literal>user_mapping_options</literal></title>
6077 The view <literal>user_mapping_options</literal> contains all the
6078 options defined for user mappings in the current database. Only
6079 those user mappings are shown where the current user has access to
6080 the corresponding foreign server (by way of being the owner or
6081 having some privilege).
6085 <title><literal>user_mapping_options</literal> Columns</title>
6091 <entry>Data Type</entry>
6092 <entry>Description</entry>
6098 <entry><literal>authorization_identifier</literal></entry>
6099 <entry><type>sql_identifier</type></entry>
6100 <entry>Name of the user being mapped,
6101 or <literal>PUBLIC</literal> if the mapping is public</entry>
6105 <entry><literal>foreign_server_catalog</literal></entry>
6106 <entry><type>sql_identifier</type></entry>
6107 <entry>Name of the database that the foreign server used by this
6108 mapping is defined in (always the current database)</entry>
6112 <entry><literal>foreign_server_name</literal></entry>
6113 <entry><type>sql_identifier</type></entry>
6114 <entry>Name of the foreign server used by this mapping</entry>
6118 <entry><literal>option_name</literal></entry>
6119 <entry><type>sql_identifier</type></entry>
6120 <entry>Name of an option</entry>
6124 <entry><literal>option_value</literal></entry>
6125 <entry><type>character_data</type></entry>
6126 <entry>Value of the option. This column will show as null
6127 unless the current user is the user being mapped, or the mapping
6128 is for <literal>PUBLIC</literal> and the current user is the
6129 server owner, or the current user is a superuser. The intent is
6130 to protect password information stored as user mapping
6138 <sect1 id="infoschema-user-mappings">
6139 <title><literal>user_mappings</literal></title>
6142 The view <literal>user_mappings</literal> contains all user
6143 mappings defined in the current database. Only those user mappings
6144 are shown where the current user has access to the corresponding
6145 foreign server (by way of being the owner or having some
6150 <title><literal>user_mappings</literal> Columns</title>
6156 <entry>Data Type</entry>
6157 <entry>Description</entry>
6163 <entry><literal>authorization_identifier</literal></entry>
6164 <entry><type>sql_identifier</type></entry>
6165 <entry>Name of the user being mapped,
6166 or <literal>PUBLIC</literal> if the mapping is public</entry>
6170 <entry><literal>foreign_server_catalog</literal></entry>
6171 <entry><type>sql_identifier</type></entry>
6172 <entry>Name of the database that the foreign server used by this
6173 mapping is defined in (always the current database)</entry>
6177 <entry><literal>foreign_server_name</literal></entry>
6178 <entry><type>sql_identifier</type></entry>
6179 <entry>Name of the foreign server used by this mapping</entry>
6186 <sect1 id="infoschema-view-column-usage">
6187 <title><literal>view_column_usage</literal></title>
6190 The view <literal>view_column_usage</literal> identifies all
6191 columns that are used in the query expression of a view (the
6192 <command>SELECT</command> statement that defines the view). A
6193 column is only included if the table that contains the column is
6194 owned by a currently enabled role.
6199 Columns of system tables are not included. This should be fixed
6205 <title><literal>view_column_usage</literal> Columns</title>
6211 <entry>Data Type</entry>
6212 <entry>Description</entry>
6218 <entry><literal>view_catalog</literal></entry>
6219 <entry><type>sql_identifier</type></entry>
6220 <entry>Name of the database that contains the view (always the current database)</entry>
6224 <entry><literal>view_schema</literal></entry>
6225 <entry><type>sql_identifier</type></entry>
6226 <entry>Name of the schema that contains the view</entry>
6230 <entry><literal>view_name</literal></entry>
6231 <entry><type>sql_identifier</type></entry>
6232 <entry>Name of the view</entry>
6236 <entry><literal>table_catalog</literal></entry>
6237 <entry><type>sql_identifier</type></entry>
6239 Name of the database that contains the table that contains the
6240 column that is used by the view (always the current database)
6245 <entry><literal>table_schema</literal></entry>
6246 <entry><type>sql_identifier</type></entry>
6248 Name of the schema that contains the table that contains the
6249 column that is used by the view
6254 <entry><literal>table_name</literal></entry>
6255 <entry><type>sql_identifier</type></entry>
6257 Name of the table that contains the column that is used by the
6263 <entry><literal>column_name</literal></entry>
6264 <entry><type>sql_identifier</type></entry>
6265 <entry>Name of the column that is used by the view</entry>
6272 <sect1 id="infoschema-view-routine-usage">
6273 <title><literal>view_routine_usage</literal></title>
6276 The view <literal>view_routine_usage</literal> identifies all
6277 routines (functions and procedures) that are used in the query
6278 expression of a view (the <command>SELECT</command> statement that
6279 defines the view). A routine is only included if that routine is
6280 owned by a currently enabled role.
6284 <title><literal>view_routine_usage</literal> Columns</title>
6290 <entry>Data Type</entry>
6291 <entry>Description</entry>
6297 <entry><literal>table_catalog</literal></entry>
6298 <entry><literal>sql_identifier</literal></entry>
6299 <entry>Name of the database containing the view (always the current database)</entry>
6303 <entry><literal>table_schema</literal></entry>
6304 <entry><literal>sql_identifier</literal></entry>
6305 <entry>Name of the schema containing the view</entry>
6309 <entry><literal>table_name</literal></entry>
6310 <entry><literal>sql_identifier</literal></entry>
6311 <entry>Name of the view</entry>
6315 <entry><literal>specific_catalog</literal></entry>
6316 <entry><literal>sql_identifier</literal></entry>
6317 <entry>Name of the database containing the function (always the current database)</entry>
6321 <entry><literal>specific_schema</literal></entry>
6322 <entry><literal>sql_identifier</literal></entry>
6323 <entry>Name of the schema containing the function</entry>
6327 <entry><literal>specific_name</literal></entry>
6328 <entry><literal>sql_identifier</literal></entry>
6330 The <quote>specific name</quote> of the function. See <xref
6331 linkend="infoschema-routines"> for more information.
6339 <sect1 id="infoschema-view-table-usage">
6340 <title><literal>view_table_usage</literal></title>
6343 The view <literal>view_table_usage</literal> identifies all tables
6344 that are used in the query expression of a view (the
6345 <command>SELECT</command> statement that defines the view). A
6346 table is only included if that table is owned by a currently
6352 System tables are not included. This should be fixed sometime.
6357 <title><literal>view_table_usage</literal> Columns</title>
6363 <entry>Data Type</entry>
6364 <entry>Description</entry>
6370 <entry><literal>view_catalog</literal></entry>
6371 <entry><type>sql_identifier</type></entry>
6372 <entry>Name of the database that contains the view (always the current database)</entry>
6376 <entry><literal>view_schema</literal></entry>
6377 <entry><type>sql_identifier</type></entry>
6378 <entry>Name of the schema that contains the view</entry>
6382 <entry><literal>view_name</literal></entry>
6383 <entry><type>sql_identifier</type></entry>
6384 <entry>Name of the view</entry>
6388 <entry><literal>table_catalog</literal></entry>
6389 <entry><type>sql_identifier</type></entry>
6391 Name of the database that contains the table that is
6392 used by the view (always the current database)
6397 <entry><literal>table_schema</literal></entry>
6398 <entry><type>sql_identifier</type></entry>
6400 Name of the schema that contains the table that is used by the
6406 <entry><literal>table_name</literal></entry>
6407 <entry><type>sql_identifier</type></entry>
6409 Name of the table that is used by the view
6417 <sect1 id="infoschema-views">
6418 <title><literal>views</literal></title>
6421 The view <literal>views</literal> contains all views defined in the
6422 current database. Only those views are shown that the current user
6423 has access to (by way of being the owner or having some privilege).
6427 <title><literal>views</literal> Columns</title>
6433 <entry>Data Type</entry>
6434 <entry>Description</entry>
6440 <entry><literal>table_catalog</literal></entry>
6441 <entry><type>sql_identifier</type></entry>
6442 <entry>Name of the database that contains the view (always the current database)</entry>
6446 <entry><literal>table_schema</literal></entry>
6447 <entry><type>sql_identifier</type></entry>
6448 <entry>Name of the schema that contains the view</entry>
6452 <entry><literal>table_name</literal></entry>
6453 <entry><type>sql_identifier</type></entry>
6454 <entry>Name of the view</entry>
6458 <entry><literal>view_definition</literal></entry>
6459 <entry><type>character_data</type></entry>
6461 Query expression defining the view (null if the view is not
6462 owned by a currently enabled role)
6467 <entry><literal>check_option</literal></entry>
6468 <entry><type>character_data</type></entry>
6469 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
6473 <entry><literal>is_updatable</literal></entry>
6474 <entry><type>yes_or_no</type></entry>
6476 <literal>YES</literal> if the view is updatable (allows
6477 <command>UPDATE</command> and <command>DELETE</command>),
6478 <literal>NO</literal> if not
6483 <entry><literal>is_insertable_into</literal></entry>
6484 <entry><type>yes_or_no</type></entry>
6486 <literal>YES</literal> if the view is insertable into (allows
6487 <command>INSERT</command>), <literal>NO</literal> if not
6492 <entry><literal>is_trigger_updatable</literal></entry>
6493 <entry><type>yes_or_no</type></entry>
6495 <literal>YES</> if the view has an <literal>INSTEAD OF</>
6496 <command>UPDATE</> trigger defined on it, <literal>NO</> if not
6501 <entry><literal>is_trigger_deletable</literal></entry>
6502 <entry><type>yes_or_no</type></entry>
6504 <literal>YES</> if the view has an <literal>INSTEAD OF</>
6505 <command>DELETE</> trigger defined on it, <literal>NO</> if not
6510 <entry><literal>is_trigger_insertable_into</literal></entry>
6511 <entry><type>yes_or_no</type></entry>
6513 <literal>YES</> if the view has an <literal>INSTEAD OF</>
6514 <command>INSERT</> trigger defined on it, <literal>NO</> if not