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.
24 <sect1 id=
"infoschema-schema">
25 <title>The Schema
</title>
28 The information schema itself is a schema named
29 <literal>information_schema
</literal>. This schema automatically
30 exists in all databases. The owner of this schema is the initial
31 database user in the cluster, and that user naturally has all the
32 privileges on this schema, including the ability to drop it (but
33 the space savings achieved by that are minuscule).
37 By default, the information schema is not in the schema search
38 path, so you need to access all objects in it through qualified
39 names. Since the names of some of the objects in the information
40 schema are generic names that might occur in user applications, you
41 should be careful if you want to put the information schema in the
46 <sect1 id=
"infoschema-datatypes">
47 <title>Data Types
</title>
50 The columns of the information schema views use special data types
51 that are defined in the information schema. These are defined as
52 simple domains over ordinary built-in types. You should not use
53 these types for work outside the information schema, but your
54 applications must be prepared for them if they select from the
63 <term><type>cardinal_number
</type></term>
66 A nonnegative integer.
72 <term><type>character_data
</type></term>
75 A character string (without specific maximum length).
81 <term><type>sql_identifier
</type></term>
84 A character string. This type is used for SQL identifiers, the
85 type
<type>character_data
</type> is used for any other kind of
92 <term><type>time_stamp
</type></term>
95 A domain over the type
<type>timestamp with time zone
</type>
101 Every column in the information schema has one of these four types.
105 Boolean (true/false) data is represented in the information schema
106 by a column of type
<type>character_data
</type> that contains
107 either
<literal>YES
</literal> or
<literal>NO
</literal>. (The
108 information schema was invented before the type
109 <type>boolean
</type> was added to the SQL standard, so this
110 convention is necessary to keep the information schema backward
115 <sect1 id=
"infoschema-information-schema-catalog-name">
116 <title><literal>information_schema_catalog_name
</literal></title>
119 <literal>information_schema_catalog_name
</literal> is a table that
120 always contains one row and one column containing the name of the
121 current database (current catalog, in SQL terminology).
125 <title><literal>information_schema_catalog_name
</literal> Columns
</title>
131 <entry>Data Type
</entry>
132 <entry>Description
</entry>
138 <entry><literal>catalog_name
</literal></entry>
139 <entry><type>sql_identifier
</type></entry>
140 <entry>Name of the database that contains this information schema
</entry>
147 <sect1 id=
"infoschema-administrable-role-authorizations">
148 <title><literal>administrable_role_authorizations
</literal></title>
151 The view
<literal>administrable_role_authorizations
</literal>
152 identifies all roles that the current user has the admin option
157 <title><literal>administrable_role_authorizations
</literal> Columns
</title>
163 <entry>Data Type
</entry>
164 <entry>Description
</entry>
170 <entry><literal>grantee
</literal></entry>
171 <entry><type>sql_identifier
</type></entry>
173 Name of the role to which this role membership was granted (can
174 be the current user, or a different role in case of nested role
180 <entry><literal>role_name
</literal></entry>
181 <entry><type>sql_identifier
</type></entry>
182 <entry>Name of a role
</entry>
186 <entry><literal>is_grantable
</literal></entry>
187 <entry><type>character_data
</type></entry>
188 <entry>Always
<literal>YES
</literal></entry>
195 <sect1 id=
"infoschema-applicable-roles">
196 <title><literal>applicable_roles
</literal></title>
199 The view
<literal>applicable_roles
</literal> identifies all roles
200 whose privileges the current user can use. This means there is
201 some chain of role grants from the current user to the role in
202 question. The current user itself is also an applicable role. The
203 set of applicable roles is generally used for permission checking.
204 <indexterm><primary>applicable role
</primary></indexterm>
205 <indexterm><primary>role
</primary><secondary>applicable
</secondary></indexterm>
209 <title><literal>applicable_roles
</literal> Columns
</title>
215 <entry>Data Type
</entry>
216 <entry>Description
</entry>
222 <entry><literal>grantee
</literal></entry>
223 <entry><type>sql_identifier
</type></entry>
225 Name of the role to which this role membership was granted (can
226 be the current user, or a different role in case of nested role
232 <entry><literal>role_name
</literal></entry>
233 <entry><type>sql_identifier
</type></entry>
234 <entry>Name of a role
</entry>
238 <entry><literal>is_grantable
</literal></entry>
239 <entry><type>character_data
</type></entry>
241 <literal>YES
</literal> if the grantee has the admin option on
242 the role,
<literal>NO
</literal> if not
250 <sect1 id=
"infoschema-attributes">
251 <title><literal>attributes
</literal></title>
254 The view
<literal>attributes
</literal> contains information about
255 the attributes of composite data types defined in the database.
256 (Note that the view does not give information about table columns,
257 which are sometimes called attributes in PostgreSQL contexts.)
261 <title><literal>attributes
</literal> Columns
</title>
267 <entry>Data Type
</entry>
268 <entry>Description
</entry>
274 <entry><literal>udt_catalog
</literal></entry>
275 <entry><type>sql_identifier
</type></entry>
276 <entry>Name of the database containing the data type (always the current database)
</entry>
280 <entry><literal>udt_schema
</literal></entry>
281 <entry><type>sql_identifier
</type></entry>
282 <entry>Name of the schema containing the data type
</entry>
286 <entry><literal>udt_name
</literal></entry>
287 <entry><type>sql_identifier
</type></entry>
288 <entry>Name of the data type
</entry>
292 <entry><literal>attribute_name
</literal></entry>
293 <entry><type>sql_identifier
</type></entry>
294 <entry>Name of the attribute
</entry>
298 <entry><literal>ordinal_position
</literal></entry>
299 <entry><type>cardinal_number
</type></entry>
300 <entry>Ordinal position of the attribute within the data type (count starts at
1)
</entry>
304 <entry><literal>attribute_default
</literal></entry>
305 <entry><type>character_data
</type></entry>
306 <entry>Default expression of the attribute
</entry>
310 <entry><literal>is_nullable
</literal></entry>
311 <entry><type>character_data
</type></entry>
313 <literal>YES
</literal> if the attribute is possibly nullable,
314 <literal>NO
</literal> if it is known not nullable.
319 <entry><literal>data_type
</literal></entry>
320 <entry><type>character_data
</type></entry>
322 Data type of the attribute, if it is a built-in type, or
323 <literal>ARRAY
</literal> if it is some array (in that case, see
324 the view
<literal>element_types
</literal>), else
325 <literal>USER-DEFINED
</literal> (in that case, the type is
326 identified in
<literal>attribute_udt_name
</literal> and
332 <entry><literal>character_maximum_length
</literal></entry>
333 <entry><type>cardinal_number
</type></entry>
335 If
<literal>data_type
</literal> identifies a character or bit
336 string type, the declared maximum length; null for all other
337 data types or if no maximum length was declared.
342 <entry><literal>character_octet_length
</literal></entry>
343 <entry><type>cardinal_number
</type></entry>
345 If
<literal>data_type
</literal> identifies a character type,
346 the maximum possible length in octets (bytes) of a datum; null
347 for all other data types. The maximum octet length depends on
348 the declared character maximum length (see above) and the
354 <entry><literal>numeric_precision
</literal></entry>
355 <entry><type>cardinal_number
</type></entry>
357 If
<literal>data_type
</literal> identifies a numeric type, this
358 column contains the (declared or implicit) precision of the
359 type for this attribute. The precision indicates the number of
360 significant digits. It can be expressed in decimal (base
10)
361 or binary (base
2) terms, as specified in the column
362 <literal>numeric_precision_radix
</literal>. For all other data
363 types, this column is null.
368 <entry><literal>numeric_precision_radix
</literal></entry>
369 <entry><type>cardinal_number
</type></entry>
371 If
<literal>data_type
</literal> identifies a numeric type, this
372 column indicates in which base the values in the columns
373 <literal>numeric_precision
</literal> and
374 <literal>numeric_scale
</literal> are expressed. The value is
375 either
2 or
10. For all other data types, this column is null.
380 <entry><literal>numeric_scale
</literal></entry>
381 <entry><type>cardinal_number
</type></entry>
383 If
<literal>data_type
</literal> identifies an exact numeric
384 type, this column contains the (declared or implicit) scale of
385 the type for this attribute. The scale indicates the number of
386 significant digits to the right of the decimal point. It can
387 be expressed in decimal (base
10) or binary (base
2) terms, as
388 specified in the column
389 <literal>numeric_precision_radix
</literal>. For all other data
390 types, this column is null.
395 <entry><literal>datetime_precision
</literal></entry>
396 <entry><type>cardinal_number
</type></entry>
398 If
<literal>data_type
</literal> identifies a date, time,
399 timestamp, or interval type, this column contains the (declared
400 or implicit) fractional seconds precision of the type for this
401 attribute, that is, the number of decimal digits maintained
402 following the decimal point in the seconds value. For all
403 other data types, this column is null.
408 <entry><literal>interval_type
</literal></entry>
409 <entry><type>character_data
</type></entry>
410 <entry>Not yet implemented
</entry>
414 <entry><literal>interval_precision
</literal></entry>
415 <entry><type>character_data
</type></entry>
416 <entry>Not yet implemented
</entry>
420 <entry><literal>attribute_udt_catalog
</literal></entry>
421 <entry><type>sql_identifier
</type></entry>
423 Name of the database that the attribute data type is defined in
424 (always the current database)
429 <entry><literal>attribute_udt_schema
</literal></entry>
430 <entry><type>sql_identifier
</type></entry>
432 Name of the schema that the attribute data type is defined in
437 <entry><literal>attribute_udt_name
</literal></entry>
438 <entry><type>sql_identifier
</type></entry>
440 Name of the attribute data type
445 <entry><literal>scope_catalog
</literal></entry>
446 <entry><type>sql_identifier
</type></entry>
447 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
451 <entry><literal>scope_schema
</literal></entry>
452 <entry><type>sql_identifier
</type></entry>
453 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
457 <entry><literal>scope_name
</literal></entry>
458 <entry><type>sql_identifier
</type></entry>
459 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
463 <entry><literal>maximum_cardinality
</literal></entry>
464 <entry><type>cardinal_number
</type></entry>
465 <entry>Always null, because arrays always have unlimited maximum cardinality in
<productname>PostgreSQL<
/></entry>
469 <entry><literal>dtd_identifier
</literal></entry>
470 <entry><type>sql_identifier
</type></entry>
472 An identifier of the data type descriptor of the column, unique
473 among the data type descriptors pertaining to the table. This
474 is mainly useful for joining with other instances of such
475 identifiers. (The specific format of the identifier is not
476 defined and not guaranteed to remain the same in future
482 <entry><literal>is_derived_reference_attribute
</literal></entry>
483 <entry><type>character_data
</type></entry>
484 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
491 See also under
<xref linkend=
"infoschema-columns">, a similarly
492 structured view, for further information on some of the columns.
496 <sect1 id=
"infoschema-check-constraint-routine-usage">
497 <title><literal>check_constraint_routine_usage
</literal></title>
500 The view
<literal>check_constraint_routine_usage
</literal>
501 identifies routines (functions and procedures) that are used by a
502 check constraint. Only those routines are shown that are owned by
503 a currently enabled role.
507 <title><literal>check_constraint_routine_usage
</literal> Columns
</title>
513 <entry>Data Type
</entry>
514 <entry>Description
</entry>
520 <entry><literal>constraint_catalog
</literal></entry>
521 <entry><literal>sql_identifier
</literal></entry>
522 <entry>Name of the database containing the constraint (always the current database)
</entry>
526 <entry><literal>constraint_schema
</literal></entry>
527 <entry><literal>sql_identifier
</literal></entry>
528 <entry>Name of the schema containing the constraint
</entry>
532 <entry><literal>constraint_name
</literal></entry>
533 <entry><literal>sql_identifier
</literal></entry>
534 <entry>Name of the constraint
</entry>
538 <entry><literal>specific_catalog
</literal></entry>
539 <entry><literal>sql_identifier
</literal></entry>
540 <entry>Name of the database containing the function (always the current database)
</entry>
544 <entry><literal>specific_schema
</literal></entry>
545 <entry><literal>sql_identifier
</literal></entry>
546 <entry>Name of the schema containing the function
</entry>
550 <entry><literal>specific_name
</literal></entry>
551 <entry><literal>sql_identifier
</literal></entry>
553 The
<quote>specific name
</quote> of the function. See
<xref
554 linkend=
"infoschema-routines"> for more information.
562 <sect1 id=
"infoschema-check-constraints">
563 <title><literal>check_constraints
</literal></title>
566 The view
<literal>check_constraints
</literal> contains all check
567 constraints, either defined on a table or on a domain, that are
568 owned by a currently enabled role. (The owner of the table or
569 domain is the owner of the constraint.)
573 <title><literal>check_constraints
</literal> Columns
</title>
579 <entry>Data Type
</entry>
580 <entry>Description
</entry>
586 <entry><literal>constraint_catalog
</literal></entry>
587 <entry><literal>sql_identifier
</literal></entry>
588 <entry>Name of the database containing the constraint (always the current database)
</entry>
592 <entry><literal>constraint_schema
</literal></entry>
593 <entry><literal>sql_identifier
</literal></entry>
594 <entry>Name of the schema containing the constraint
</entry>
598 <entry><literal>constraint_name
</literal></entry>
599 <entry><literal>sql_identifier
</literal></entry>
600 <entry>Name of the constraint
</entry>
604 <entry><literal>check_clause
</literal></entry>
605 <entry><literal>character_data
</literal></entry>
606 <entry>The check expression of the check constraint
</entry>
613 <sect1 id=
"infoschema-column-domain-usage">
614 <title><literal>column_domain_usage
</literal></title>
617 The view
<literal>column_domain_usage
</literal> identifies all
618 columns (of a table or a view) that make use of some domain defined
619 in the current database and owned by a currently enabled role.
623 <title><literal>column_domain_usage
</literal> Columns
</title>
629 <entry>Data Type
</entry>
630 <entry>Description
</entry>
636 <entry><literal>domain_catalog
</literal></entry>
637 <entry><type>sql_identifier
</type></entry>
638 <entry>Name of the database containing the domain (always the current database)
</entry>
642 <entry><literal>domain_schema
</literal></entry>
643 <entry><type>sql_identifier
</type></entry>
644 <entry>Name of the schema containing the domain
</entry>
648 <entry><literal>domain_name
</literal></entry>
649 <entry><type>sql_identifier
</type></entry>
650 <entry>Name of the domain
</entry>
654 <entry><literal>table_catalog
</literal></entry>
655 <entry><type>sql_identifier
</type></entry>
656 <entry>Name of the database containing the table (always the current database)
</entry>
660 <entry><literal>table_schema
</literal></entry>
661 <entry><type>sql_identifier
</type></entry>
662 <entry>Name of the schema containing the table
</entry>
666 <entry><literal>table_name
</literal></entry>
667 <entry><type>sql_identifier
</type></entry>
668 <entry>Name of the table
</entry>
672 <entry><literal>column_name
</literal></entry>
673 <entry><type>sql_identifier
</type></entry>
674 <entry>Name of the column
</entry>
681 <sect1 id=
"infoschema-column-privileges">
682 <title><literal>column_privileges
</literal></title>
685 The view
<literal>column_privileges
</literal> identifies all
686 privileges granted on columns to a currently enabled role or by a
687 currently enabled role. There is one row for each combination of
688 column, grantor, and grantee.
692 If a privilege has been granted on an entire table, it will show up in
693 this view as a grant for each column, but only for the
694 privilege types where column granularity is possible:
695 <literal>SELECT
</literal>,
<literal>INSERT
</literal>,
696 <literal>UPDATE
</literal>,
<literal>REFERENCES
</literal>.
700 <title><literal>column_privileges
</literal> Columns
</title>
706 <entry>Data Type
</entry>
707 <entry>Description
</entry>
713 <entry><literal>grantor
</literal></entry>
714 <entry><type>sql_identifier
</type></entry>
715 <entry>Name of the role that granted the privilege
</entry>
719 <entry><literal>grantee
</literal></entry>
720 <entry><type>sql_identifier
</type></entry>
721 <entry>Name of the role that the privilege was granted to
</entry>
725 <entry><literal>table_catalog
</literal></entry>
726 <entry><type>sql_identifier
</type></entry>
727 <entry>Name of the database that contains the table that contains the column (always the current database)
</entry>
731 <entry><literal>table_schema
</literal></entry>
732 <entry><type>sql_identifier
</type></entry>
733 <entry>Name of the schema that contains the table that contains the column
</entry>
737 <entry><literal>table_name
</literal></entry>
738 <entry><type>sql_identifier
</type></entry>
739 <entry>Name of the table that contains the column
</entry>
743 <entry><literal>column_name
</literal></entry>
744 <entry><type>sql_identifier
</type></entry>
745 <entry>Name of the column
</entry>
749 <entry><literal>privilege_type
</literal></entry>
750 <entry><type>character_data
</type></entry>
752 Type of the privilege:
<literal>SELECT
</literal>,
753 <literal>INSERT
</literal>,
<literal>UPDATE
</literal>, or
754 <literal>REFERENCES
</literal>
759 <entry><literal>is_grantable
</literal></entry>
760 <entry><type>character_data
</type></entry>
761 <entry><literal>YES
</literal> if the privilege is grantable,
<literal>NO
</literal> if not
</entry>
768 <sect1 id=
"infoschema-column-udt-usage">
769 <title><literal>column_udt_usage
</literal></title>
772 The view
<literal>column_udt_usage
</literal> identifies all columns
773 that use data types owned by a currently enabled role. Note that in
774 <productname>PostgreSQL
</productname>, built-in data types behave
775 like user-defined types, so they are included here as well. See
776 also
<xref linkend=
"infoschema-columns"> for details.
780 <title><literal>column_udt_usage
</literal> Columns
</title>
786 <entry>Data Type
</entry>
787 <entry>Description
</entry>
793 <entry><literal>udt_catalog
</literal></entry>
794 <entry><type>sql_identifier
</type></entry>
796 Name of the database that the column data type (the underlying
797 type of the domain, if applicable) is defined in (always the
803 <entry><literal>udt_schema
</literal></entry>
804 <entry><type>sql_identifier
</type></entry>
806 Name of the schema that the column data type (the underlying
807 type of the domain, if applicable) is defined in
812 <entry><literal>udt_name
</literal></entry>
813 <entry><type>sql_identifier
</type></entry>
815 Name of the column data type (the underlying type of the
816 domain, if applicable)
821 <entry><literal>table_catalog
</literal></entry>
822 <entry><type>sql_identifier
</type></entry>
823 <entry>Name of the database containing the table (always the current database)
</entry>
827 <entry><literal>table_schema
</literal></entry>
828 <entry><type>sql_identifier
</type></entry>
829 <entry>Name of the schema containing the table
</entry>
833 <entry><literal>table_name
</literal></entry>
834 <entry><type>sql_identifier
</type></entry>
835 <entry>Name of the table
</entry>
839 <entry><literal>column_name
</literal></entry>
840 <entry><type>sql_identifier
</type></entry>
841 <entry>Name of the column
</entry>
848 <sect1 id=
"infoschema-columns">
849 <title><literal>columns
</literal></title>
852 The view
<literal>columns
</literal> contains information about all
853 table columns (or view columns) in the database. System columns
854 (
<literal>oid<
/>, etc.) are not included. Only those columns are
855 shown that the current user has access to (by way of being the
856 owner or having some privilege).
860 <title><literal>columns
</literal> Columns
</title>
866 <entry>Data Type
</entry>
867 <entry>Description
</entry>
873 <entry><literal>table_catalog
</literal></entry>
874 <entry><type>sql_identifier
</type></entry>
875 <entry>Name of the database containing the table (always the current database)
</entry>
879 <entry><literal>table_schema
</literal></entry>
880 <entry><type>sql_identifier
</type></entry>
881 <entry>Name of the schema containing the table
</entry>
885 <entry><literal>table_name
</literal></entry>
886 <entry><type>sql_identifier
</type></entry>
887 <entry>Name of the table
</entry>
891 <entry><literal>column_name
</literal></entry>
892 <entry><type>sql_identifier
</type></entry>
893 <entry>Name of the column
</entry>
897 <entry><literal>ordinal_position
</literal></entry>
898 <entry><type>cardinal_number
</type></entry>
899 <entry>Ordinal position of the column within the table (count starts at
1)
</entry>
903 <entry><literal>column_default
</literal></entry>
904 <entry><type>character_data
</type></entry>
905 <entry>Default expression of the column
</entry>
909 <entry><literal>is_nullable
</literal></entry>
910 <entry><type>character_data
</type></entry>
912 <literal>YES
</literal> if the column is possibly nullable,
913 <literal>NO
</literal> if it is known not nullable. A not-null
914 constraint is one way a column can be known not nullable, but
920 <entry><literal>data_type
</literal></entry>
921 <entry><type>character_data
</type></entry>
923 Data type of the column, if it is a built-in type, or
924 <literal>ARRAY
</literal> if it is some array (in that case, see
925 the view
<literal>element_types
</literal>), else
926 <literal>USER-DEFINED
</literal> (in that case, the type is
927 identified in
<literal>udt_name
</literal> and associated
928 columns). If the column is based on a domain, this column
929 refers to the type underlying the domain (and the domain is
930 identified in
<literal>domain_name
</literal> and associated
936 <entry><literal>character_maximum_length
</literal></entry>
937 <entry><type>cardinal_number
</type></entry>
939 If
<literal>data_type
</literal> identifies a character or bit
940 string type, the declared maximum length; null for all other
941 data types or if no maximum length was declared.
946 <entry><literal>character_octet_length
</literal></entry>
947 <entry><type>cardinal_number
</type></entry>
949 If
<literal>data_type
</literal> identifies a character type,
950 the maximum possible length in octets (bytes) of a datum; null
951 for all other data types. The maximum octet length depends on
952 the declared character maximum length (see above) and the
958 <entry><literal>numeric_precision
</literal></entry>
959 <entry><type>cardinal_number
</type></entry>
961 If
<literal>data_type
</literal> identifies a numeric type, this
962 column contains the (declared or implicit) precision of the
963 type for this column. The precision indicates the number of
964 significant digits. It can be expressed in decimal (base
10)
965 or binary (base
2) terms, as specified in the column
966 <literal>numeric_precision_radix
</literal>. For all other data
967 types, this column is null.
972 <entry><literal>numeric_precision_radix
</literal></entry>
973 <entry><type>cardinal_number
</type></entry>
975 If
<literal>data_type
</literal> identifies a numeric type, this
976 column indicates in which base the values in the columns
977 <literal>numeric_precision
</literal> and
978 <literal>numeric_scale
</literal> are expressed. The value is
979 either
2 or
10. For all other data types, this column is null.
984 <entry><literal>numeric_scale
</literal></entry>
985 <entry><type>cardinal_number
</type></entry>
987 If
<literal>data_type
</literal> identifies an exact numeric
988 type, this column contains the (declared or implicit) scale of
989 the type for this column. The scale indicates the number of
990 significant digits to the right of the decimal point. It can
991 be expressed in decimal (base
10) or binary (base
2) terms, as
992 specified in the column
993 <literal>numeric_precision_radix
</literal>. For all other data
994 types, this column is null.
999 <entry><literal>datetime_precision
</literal></entry>
1000 <entry><type>cardinal_number
</type></entry>
1002 If
<literal>data_type
</literal> identifies a date, time,
1003 timestamp, or interval type, this column contains the (declared
1004 or implicit) fractional seconds precision of the type for this
1005 column, that is, the number of decimal digits maintained
1006 following the decimal point in the seconds value. For all
1007 other data types, this column is null.
1012 <entry><literal>interval_type
</literal></entry>
1013 <entry><type>character_data
</type></entry>
1014 <entry>Not yet implemented
</entry>
1018 <entry><literal>interval_precision
</literal></entry>
1019 <entry><type>character_data
</type></entry>
1020 <entry>Not yet implemented
</entry>
1024 <entry><literal>character_set_catalog
</literal></entry>
1025 <entry><type>sql_identifier
</type></entry>
1026 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
1030 <entry><literal>character_set_schema
</literal></entry>
1031 <entry><type>sql_identifier
</type></entry>
1032 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
1036 <entry><literal>character_set_name
</literal></entry>
1037 <entry><type>sql_identifier
</type></entry>
1038 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
1042 <entry><literal>collation_catalog
</literal></entry>
1043 <entry><type>sql_identifier
</type></entry>
1044 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
1048 <entry><literal>collation_schema
</literal></entry>
1049 <entry><type>sql_identifier
</type></entry>
1050 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
1054 <entry><literal>collation_name
</literal></entry>
1055 <entry><type>sql_identifier
</type></entry>
1056 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
1060 <entry><literal>domain_catalog
</literal></entry>
1061 <entry><type>sql_identifier
</type></entry>
1063 If the column has a domain type, the name of the database that
1064 the domain is defined in (always the current database), else
1070 <entry><literal>domain_schema
</literal></entry>
1071 <entry><type>sql_identifier
</type></entry>
1073 If the column has a domain type, the name of the schema that
1074 the domain is defined in, else null.
1079 <entry><literal>domain_name
</literal></entry>
1080 <entry><type>sql_identifier
</type></entry>
1081 <entry>If the column has a domain type, the name of the domain, else null.
</entry>
1085 <entry><literal>udt_catalog
</literal></entry>
1086 <entry><type>sql_identifier
</type></entry>
1088 Name of the database that the column data type (the underlying
1089 type of the domain, if applicable) is defined in (always the
1095 <entry><literal>udt_schema
</literal></entry>
1096 <entry><type>sql_identifier
</type></entry>
1098 Name of the schema that the column data type (the underlying
1099 type of the domain, if applicable) is defined in
1104 <entry><literal>udt_name
</literal></entry>
1105 <entry><type>sql_identifier
</type></entry>
1107 Name of the column data type (the underlying type of the
1108 domain, if applicable)
1113 <entry><literal>scope_catalog
</literal></entry>
1114 <entry><type>sql_identifier
</type></entry>
1115 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
1119 <entry><literal>scope_schema
</literal></entry>
1120 <entry><type>sql_identifier
</type></entry>
1121 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
1125 <entry><literal>scope_name
</literal></entry>
1126 <entry><type>sql_identifier
</type></entry>
1127 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
1131 <entry><literal>maximum_cardinality
</literal></entry>
1132 <entry><type>cardinal_number
</type></entry>
1133 <entry>Always null, because arrays always have unlimited maximum cardinality in
<productname>PostgreSQL<
/></entry>
1137 <entry><literal>dtd_identifier
</literal></entry>
1138 <entry><type>sql_identifier
</type></entry>
1140 An identifier of the data type descriptor of the column, unique
1141 among the data type descriptors pertaining to the table. This
1142 is mainly useful for joining with other instances of such
1143 identifiers. (The specific format of the identifier is not
1144 defined and not guaranteed to remain the same in future
1150 <entry><literal>is_self_referencing
</literal></entry>
1151 <entry><type>character_data
</type></entry>
1152 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
1156 <entry><literal>is_identity
</literal></entry>
1157 <entry><type>character_data
</type></entry>
1158 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
1162 <entry><literal>identity_generation
</literal></entry>
1163 <entry><type>character_data
</type></entry>
1164 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
1168 <entry><literal>identity_start
</literal></entry>
1169 <entry><type>character_data
</type></entry>
1170 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
1174 <entry><literal>identity_increment
</literal></entry>
1175 <entry><type>character_data
</type></entry>
1176 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
1180 <entry><literal>identity_maximum
</literal></entry>
1181 <entry><type>character_data
</type></entry>
1182 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
1186 <entry><literal>identity_minimum
</literal></entry>
1187 <entry><type>character_data
</type></entry>
1188 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
1192 <entry><literal>identity_cycle
</literal></entry>
1193 <entry><type>character_data
</type></entry>
1194 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
1198 <entry><literal>is_generated
</literal></entry>
1199 <entry><type>character_data
</type></entry>
1200 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
1204 <entry><literal>generation_expression
</literal></entry>
1205 <entry><type>character_data
</type></entry>
1206 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
1210 <entry><literal>is_updatable
</literal></entry>
1211 <entry><type>character_data
</type></entry>
1213 <literal>YES
</literal> if the column is updatable,
1214 <literal>NO
</literal> if not (Columns in base tables are always
1215 updatable, columns in views not necessarily)
1223 Since data types can be defined in a variety of ways in SQL, and
1224 <productname>PostgreSQL
</productname> contains additional ways to
1225 define data types, their representation in the information schema
1226 can be somewhat difficult. The column
<literal>data_type
</literal>
1227 is supposed to identify the underlying built-in type of the column.
1228 In
<productname>PostgreSQL
</productname>, this means that the type
1229 is defined in the system catalog schema
1230 <literal>pg_catalog
</literal>. This column might be useful if the
1231 application can handle the well-known built-in types specially (for
1232 example, format the numeric types differently or use the data in
1233 the precision columns). The columns
<literal>udt_name
</literal>,
1234 <literal>udt_schema
</literal>, and
<literal>udt_catalog
</literal>
1235 always identify the underlying data type of the column, even if the
1236 column is based on a domain. (Since
1237 <productname>PostgreSQL
</productname> treats built-in types like
1238 user-defined types, built-in types appear here as well. This is an
1239 extension of the SQL standard.) These columns should be used if an
1240 application wants to process data differently according to the
1241 type, because in that case it wouldn't matter if the column is
1242 really based on a domain. If the column is based on a domain, the
1243 identity of the domain is stored in the columns
1244 <literal>domain_name
</literal>,
<literal>domain_schema
</literal>,
1245 and
<literal>domain_catalog
</literal>. If you want to pair up
1246 columns with their associated data types and treat domains as
1247 separate types, you could write
<literal>coalesce(domain_name,
1248 udt_name)
</literal>, etc.
1252 <sect1 id=
"infoschema-constraint-column-usage">
1253 <title><literal>constraint_column_usage
</literal></title>
1256 The view
<literal>constraint_column_usage
</literal> identifies all
1257 columns in the current database that are used by some constraint.
1258 Only those columns are shown that are contained in a table owned by
1259 a currently enabled role. For a check constraint, this view
1260 identifies the columns that are used in the check expression. For
1261 a foreign key constraint, this view identifies the columns that the
1262 foreign key references. For a unique or primary key constraint,
1263 this view identifies the constrained columns.
1267 <title><literal>constraint_column_usage
</literal> Columns
</title>
1273 <entry>Data Type
</entry>
1274 <entry>Description
</entry>
1280 <entry><literal>table_catalog
</literal></entry>
1281 <entry><type>sql_identifier
</type></entry>
1283 Name of the database that contains the table that contains the
1284 column that is used by some constraint (always the current
1290 <entry><literal>table_schema
</literal></entry>
1291 <entry><type>sql_identifier
</type></entry>
1293 Name of the schema that contains the table that contains the
1294 column that is used by some constraint
1299 <entry><literal>table_name
</literal></entry>
1300 <entry><type>sql_identifier
</type></entry>
1302 Name of the table that contains the column that is used by some
1308 <entry><literal>column_name
</literal></entry>
1309 <entry><type>sql_identifier
</type></entry>
1311 Name of the column that is used by some constraint
1316 <entry><literal>constraint_catalog
</literal></entry>
1317 <entry><type>sql_identifier
</type></entry>
1318 <entry>Name of the database that contains the constraint (always the current database)
</entry>
1322 <entry><literal>constraint_schema
</literal></entry>
1323 <entry><type>sql_identifier
</type></entry>
1324 <entry>Name of the schema that contains the constraint
</entry>
1328 <entry><literal>constraint_name
</literal></entry>
1329 <entry><type>sql_identifier
</type></entry>
1330 <entry>Name of the constraint
</entry>
1337 <sect1 id=
"infoschema-constraint-table-usage">
1338 <title><literal>constraint_table_usage
</literal></title>
1341 The view
<literal>constraint_table_usage
</literal> identifies all
1342 tables in the current database that are used by some constraint and
1343 are owned by a currently enabled role. (This is different from the
1344 view
<literal>table_constraints
</literal>, which identifies all
1345 table constraints along with the table they are defined on.) For a
1346 foreign key constraint, this view identifies the table that the
1347 foreign key references. For a unique or primary key constraint,
1348 this view simply identifies the table the constraint belongs to.
1349 Check constraints and not-null constraints are not included in this
1354 <title><literal>constraint_table_usage
</literal> Columns
</title>
1360 <entry>Data Type
</entry>
1361 <entry>Description
</entry>
1367 <entry><literal>table_catalog
</literal></entry>
1368 <entry><type>sql_identifier
</type></entry>
1370 Name of the database that contains the table that is used by
1371 some constraint (always the current database)
1376 <entry><literal>table_schema
</literal></entry>
1377 <entry><type>sql_identifier
</type></entry>
1379 Name of the schema that contains the table that is used by some
1385 <entry><literal>table_name
</literal></entry>
1386 <entry><type>sql_identifier
</type></entry>
1387 <entry>Name of the table that is used by some constraint
</entry>
1391 <entry><literal>constraint_catalog
</literal></entry>
1392 <entry><type>sql_identifier
</type></entry>
1393 <entry>Name of the database that contains the constraint (always the current database)
</entry>
1397 <entry><literal>constraint_schema
</literal></entry>
1398 <entry><type>sql_identifier
</type></entry>
1399 <entry>Name of the schema that contains the constraint
</entry>
1403 <entry><literal>constraint_name
</literal></entry>
1404 <entry><type>sql_identifier
</type></entry>
1405 <entry>Name of the constraint
</entry>
1412 <sect1 id=
"infoschema-data-type-privileges">
1413 <title><literal>data_type_privileges
</literal></title>
1416 The view
<literal>data_type_privileges
</literal> identifies all
1417 data type descriptors that the current user has access to, by way
1418 of being the owner of the described object or having some privilege
1419 for it. A data type descriptor is generated whenever a data type
1420 is used in the definition of a table column, a domain, or a
1421 function (as parameter or return type) and stores some information
1422 about how the data type is used in that instance (for example, the
1423 declared maximum length, if applicable). Each data type
1424 descriptor is assigned an arbitrary identifier that is unique
1425 among the data type descriptor identifiers assigned for one object
1426 (table, domain, function). This view is probably not useful for
1427 applications, but it is used to define some other views in the
1432 <title><literal>data_type_privileges
</literal> Columns
</title>
1438 <entry>Data Type
</entry>
1439 <entry>Description
</entry>
1445 <entry><literal>object_catalog
</literal></entry>
1446 <entry><type>sql_identifier
</type></entry>
1447 <entry>Name of the database that contains the described object (always the current database)
</entry>
1451 <entry><literal>object_schema
</literal></entry>
1452 <entry><type>sql_identifier
</type></entry>
1453 <entry>Name of the schema that contains the described object
</entry>
1457 <entry><literal>object_name
</literal></entry>
1458 <entry><type>sql_identifier
</type></entry>
1459 <entry>Name of the described object
</entry>
1463 <entry><literal>object_type
</literal></entry>
1464 <entry><type>character_data
</type></entry>
1466 The type of the described object: one of
1467 <literal>TABLE
</literal> (the data type descriptor pertains to
1468 a column of that table),
<literal>DOMAIN
</literal> (the data
1469 type descriptors pertains to that domain),
1470 <literal>ROUTINE
</literal> (the data type descriptor pertains
1471 to a parameter or the return data type of that function).
1476 <entry><literal>dtd_identifier
</literal></entry>
1477 <entry><type>sql_identifier
</type></entry>
1479 The identifier of the data type descriptor, which is unique
1480 among the data type descriptors for that same object.
1488 <sect1 id=
"infoschema-domain-constraints">
1489 <title><literal>domain_constraints
</literal></title>
1492 The view
<literal>domain_constraints
</literal> contains all
1493 constraints belonging to domains defined in the current database.
1497 <title><literal>domain_constraints
</literal> Columns
</title>
1503 <entry>Data Type
</entry>
1504 <entry>Description
</entry>
1510 <entry><literal>constraint_catalog
</literal></entry>
1511 <entry><type>sql_identifier
</type></entry>
1512 <entry>Name of the database that contains the constraint (always the current database)
</entry>
1516 <entry><literal>constraint_schema
</literal></entry>
1517 <entry><type>sql_identifier
</type></entry>
1518 <entry>Name of the schema that contains the constraint
</entry>
1522 <entry><literal>constraint_name
</literal></entry>
1523 <entry><type>sql_identifier
</type></entry>
1524 <entry>Name of the constraint
</entry>
1528 <entry><literal>domain_catalog
</literal></entry>
1529 <entry><type>sql_identifier
</type></entry>
1530 <entry>Name of the database that contains the domain (always the current database)
</entry>
1534 <entry><literal>domain_schema
</literal></entry>
1535 <entry><type>sql_identifier
</type></entry>
1536 <entry>Name of the schema that contains the domain
</entry>
1540 <entry><literal>domain_name
</literal></entry>
1541 <entry><type>sql_identifier
</type></entry>
1542 <entry>Name of the domain
</entry>
1546 <entry><literal>is_deferrable
</literal></entry>
1547 <entry><type>character_data
</type></entry>
1548 <entry><literal>YES
</literal> if the constraint is deferrable,
<literal>NO
</literal> if not
</entry>
1552 <entry><literal>initially_deferred
</literal></entry>
1553 <entry><type>character_data
</type></entry>
1554 <entry><literal>YES
</literal> if the constraint is deferrable and initially deferred,
<literal>NO
</literal> if not
</entry>
1561 <sect1 id=
"infoschema-domain-udt-usage">
1562 <title><literal>domain_udt_usage
</literal></title>
1565 The view
<literal>domain_udt_usage
</literal> identifies all domains
1566 that are based on data types owned by a currently enabled role.
1567 Note that in
<productname>PostgreSQL
</productname>, built-in data
1568 types behave like user-defined types, so they are included here as
1573 <title><literal>domain_udt_usage
</literal> Columns
</title>
1579 <entry>Data Type
</entry>
1580 <entry>Description
</entry>
1586 <entry><literal>udt_catalog
</literal></entry>
1587 <entry><type>sql_identifier
</type></entry>
1588 <entry>Name of the database that the domain data type is defined in (always the current database)
</entry>
1592 <entry><literal>udt_schema
</literal></entry>
1593 <entry><type>sql_identifier
</type></entry>
1594 <entry>Name of the schema that the domain data type is defined in
</entry>
1598 <entry><literal>udt_name
</literal></entry>
1599 <entry><type>sql_identifier
</type></entry>
1600 <entry>Name of the domain data type
</entry>
1604 <entry><literal>domain_catalog
</literal></entry>
1605 <entry><type>sql_identifier
</type></entry>
1606 <entry>Name of the database that contains the domain (always the current database)
</entry>
1610 <entry><literal>domain_schema
</literal></entry>
1611 <entry><type>sql_identifier
</type></entry>
1612 <entry>Name of the schema that contains the domain
</entry>
1616 <entry><literal>domain_name
</literal></entry>
1617 <entry><type>sql_identifier
</type></entry>
1618 <entry>Name of the domain
</entry>
1625 <sect1 id=
"infoschema-domains">
1626 <title><literal>domains
</literal></title>
1629 The view
<literal>domains
</literal> contains all domains defined in
1630 the current database.
1634 <title><literal>domains
</literal> Columns
</title>
1640 <entry>Data Type
</entry>
1641 <entry>Description
</entry>
1647 <entry><literal>domain_catalog
</literal></entry>
1648 <entry><type>sql_identifier
</type></entry>
1649 <entry>Name of the database that contains the domain (always the current database)
</entry>
1653 <entry><literal>domain_schema
</literal></entry>
1654 <entry><type>sql_identifier
</type></entry>
1655 <entry>Name of the schema that contains the domain
</entry>
1659 <entry><literal>domain_name
</literal></entry>
1660 <entry><type>sql_identifier
</type></entry>
1661 <entry>Name of the domain
</entry>
1665 <entry><literal>data_type
</literal></entry>
1666 <entry><type>character_data
</type></entry>
1668 Data type of the domain, if it is a built-in type, or
1669 <literal>ARRAY
</literal> if it is some array (in that case, see
1670 the view
<literal>element_types
</literal>), else
1671 <literal>USER-DEFINED
</literal> (in that case, the type is
1672 identified in
<literal>udt_name
</literal> and associated
1678 <entry><literal>character_maximum_length
</literal></entry>
1679 <entry><type>cardinal_number
</type></entry>
1681 If the domain has a character or bit string type, the declared
1682 maximum length; null for all other data types or if no maximum
1683 length was declared.
1688 <entry><literal>character_octet_length
</literal></entry>
1689 <entry><type>cardinal_number
</type></entry>
1691 If the domain has a character type, the maximum possible length
1692 in octets (bytes) of a datum; null for all other data types.
1693 The maximum octet length depends on the declared character
1694 maximum length (see above) and the server encoding.
1699 <entry><literal>character_set_catalog
</literal></entry>
1700 <entry><type>sql_identifier
</type></entry>
1701 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
1705 <entry><literal>character_set_schema
</literal></entry>
1706 <entry><type>sql_identifier
</type></entry>
1707 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
1711 <entry><literal>character_set_name
</literal></entry>
1712 <entry><type>sql_identifier
</type></entry>
1713 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
1717 <entry><literal>collation_catalog
</literal></entry>
1718 <entry><type>sql_identifier
</type></entry>
1719 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
1723 <entry><literal>collation_schema
</literal></entry>
1724 <entry><type>sql_identifier
</type></entry>
1725 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
1729 <entry><literal>collation_name
</literal></entry>
1730 <entry><type>sql_identifier
</type></entry>
1731 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
1735 <entry><literal>numeric_precision
</literal></entry>
1736 <entry><type>cardinal_number
</type></entry>
1738 If the domain has a numeric type, this column contains the
1739 (declared or implicit) precision of the type for this domain.
1740 The precision indicates the number of significant digits. It
1741 can be expressed in decimal (base
10) or binary (base
2) terms,
1742 as specified in the column
1743 <literal>numeric_precision_radix
</literal>. For all other data
1744 types, this column is null.
1749 <entry><literal>numeric_precision_radix
</literal></entry>
1750 <entry><type>cardinal_number
</type></entry>
1752 If the domain has a numeric type, this column indicates in
1753 which base the values in the columns
1754 <literal>numeric_precision
</literal> and
1755 <literal>numeric_scale
</literal> are expressed. The value is
1756 either
2 or
10. For all other data types, this column is null.
1761 <entry><literal>numeric_scale
</literal></entry>
1762 <entry><type>cardinal_number
</type></entry>
1764 If the domain has an exact numeric type, this column contains
1765 the (declared or implicit) scale of the type for this domain.
1766 The scale indicates the number of significant digits to the
1767 right of the decimal point. It can be expressed in decimal
1768 (base
10) or binary (base
2) terms, as specified in the column
1769 <literal>numeric_precision_radix
</literal>. For all other data
1770 types, this column is null.
1775 <entry><literal>datetime_precision
</literal></entry>
1776 <entry><type>cardinal_number
</type></entry>
1778 If
<literal>data_type
</literal> identifies a date, time,
1779 timestamp, or interval type, this column contains the (declared
1780 or implicit) fractional seconds precision of the type for this
1781 domain, that is, the number of decimal digits maintained
1782 following the decimal point in the seconds value. For all
1783 other data types, this column is null.
1788 <entry><literal>interval_type
</literal></entry>
1789 <entry><type>character_data
</type></entry>
1790 <entry>Not yet implemented
</entry>
1794 <entry><literal>interval_precision
</literal></entry>
1795 <entry><type>character_data
</type></entry>
1796 <entry>Not yet implemented
</entry>
1800 <entry><literal>domain_default
</literal></entry>
1801 <entry><type>character_data
</type></entry>
1802 <entry>Default expression of the domain
</entry>
1806 <entry><literal>udt_catalog
</literal></entry>
1807 <entry><type>sql_identifier
</type></entry>
1808 <entry>Name of the database that the domain data type is defined in (always the current database)
</entry>
1812 <entry><literal>udt_schema
</literal></entry>
1813 <entry><type>sql_identifier
</type></entry>
1814 <entry>Name of the schema that the domain data type is defined in
</entry>
1818 <entry><literal>udt_name
</literal></entry>
1819 <entry><type>sql_identifier
</type></entry>
1820 <entry>Name of the domain data type
</entry>
1824 <entry><literal>scope_catalog
</literal></entry>
1825 <entry><type>sql_identifier
</type></entry>
1826 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
1830 <entry><literal>scope_schema
</literal></entry>
1831 <entry><type>sql_identifier
</type></entry>
1832 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
1836 <entry><literal>scope_name
</literal></entry>
1837 <entry><type>sql_identifier
</type></entry>
1838 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
1842 <entry><literal>maximum_cardinality
</literal></entry>
1843 <entry><type>cardinal_number
</type></entry>
1844 <entry>Always null, because arrays always have unlimited maximum cardinality in
<productname>PostgreSQL<
/></entry>
1848 <entry><literal>dtd_identifier
</literal></entry>
1849 <entry><type>sql_identifier
</type></entry>
1851 An identifier of the data type descriptor of the domain, unique
1852 among the data type descriptors pertaining to the domain (which
1853 is trivial, because a domain only contains one data type
1854 descriptor). This is mainly useful for joining with other
1855 instances of such identifiers. (The specific format of the
1856 identifier is not defined and not guaranteed to remain the same
1857 in future versions.)
1865 <sect1 id=
"infoschema-element-types">
1866 <title><literal>element_types
</literal></title>
1869 The view
<literal>element_types
</literal> contains the data type
1870 descriptors of the elements of arrays. When a table column,
1871 domain, function parameter, or function return value is defined to
1872 be of an array type, the respective information schema view only
1873 contains
<literal>ARRAY
</literal> in the column
1874 <literal>data_type
</literal>. To obtain information on the element
1875 type of the array, you can join the respective view with this view.
1876 For example, to show the columns of a table with data types and
1877 array element types, if applicable, you could do:
1879 SELECT c.column_name, c.data_type, e.data_type AS element_type
1880 FROM information_schema.columns c LEFT JOIN information_schema.element_types e
1881 ON ((c.table_catalog, c.table_schema, c.table_name, 'TABLE', c.dtd_identifier)
1882 = (e.object_catalog, e.object_schema, e.object_name, e.object_type, e.dtd_identifier))
1883 WHERE c.table_schema = '...' AND c.table_name = '...'
1884 ORDER BY c.ordinal_position;
1886 This view only includes objects that the current user has access
1887 to, by way of being the owner or having some privilege.
1891 <title><literal>element_types
</literal> Columns
</title>
1897 <entry>Data Type
</entry>
1898 <entry>Description
</entry>
1904 <entry><literal>object_catalog
</literal></entry>
1905 <entry><type>sql_identifier
</type></entry>
1907 Name of the database that contains the object that uses the
1908 array being described (always the current database)
1913 <entry><literal>object_schema
</literal></entry>
1914 <entry><type>sql_identifier
</type></entry>
1916 Name of the schema that contains the object that uses the array
1922 <entry><literal>object_name
</literal></entry>
1923 <entry><type>sql_identifier
</type></entry>
1925 Name of the object that uses the array being described
1930 <entry><literal>object_type
</literal></entry>
1931 <entry><type>character_data
</type></entry>
1933 The type of the object that uses the array being described: one
1934 of
<literal>TABLE
</literal> (the array is used by a column of
1935 that table),
<literal>DOMAIN
</literal> (the array is used by
1936 that domain),
<literal>ROUTINE
</literal> (the array is used by
1937 a parameter or the return data type of that function).
1942 <entry><literal>dtd_identifier
</literal></entry>
1943 <entry><type>sql_identifier
</type></entry>
1945 The identifier of the data type descriptor of the array being
1951 <entry><literal>data_type
</literal></entry>
1952 <entry><type>character_data
</type></entry>
1954 Data type of the array elements, if it is a built-in type, else
1955 <literal>USER-DEFINED
</literal> (in that case, the type is
1956 identified in
<literal>udt_name
</literal> and associated
1962 <entry><literal>character_maximum_length
</literal></entry>
1963 <entry><type>cardinal_number
</type></entry>
1964 <entry>Always null, since this information is not applied to array element data types in
<productname>PostgreSQL<
/></entry>
1968 <entry><literal>character_octet_length
</literal></entry>
1969 <entry><type>cardinal_number
</type></entry>
1970 <entry>Always null, since this information is not applied to array element data types in
<productname>PostgreSQL<
/></entry>
1974 <entry><literal>character_set_catalog
</literal></entry>
1975 <entry><type>sql_identifier
</type></entry>
1976 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
1980 <entry><literal>character_set_schema
</literal></entry>
1981 <entry><type>sql_identifier
</type></entry>
1982 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
1986 <entry><literal>character_set_name
</literal></entry>
1987 <entry><type>sql_identifier
</type></entry>
1988 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
1992 <entry><literal>collation_catalog
</literal></entry>
1993 <entry><type>sql_identifier
</type></entry>
1994 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
1998 <entry><literal>collation_schema
</literal></entry>
1999 <entry><type>sql_identifier
</type></entry>
2000 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
2004 <entry><literal>collation_name
</literal></entry>
2005 <entry><type>sql_identifier
</type></entry>
2006 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
2010 <entry><literal>numeric_precision
</literal></entry>
2011 <entry><type>cardinal_number
</type></entry>
2012 <entry>Always null, since this information is not applied to array element data types in
<productname>PostgreSQL<
/></entry>
2016 <entry><literal>numeric_precision_radix
</literal></entry>
2017 <entry><type>cardinal_number
</type></entry>
2018 <entry>Always null, since this information is not applied to array element data types in
<productname>PostgreSQL<
/></entry>
2022 <entry><literal>numeric_scale
</literal></entry>
2023 <entry><type>cardinal_number
</type></entry>
2024 <entry>Always null, since this information is not applied to array element data types in
<productname>PostgreSQL<
/></entry>
2028 <entry><literal>datetime_precision
</literal></entry>
2029 <entry><type>cardinal_number
</type></entry>
2030 <entry>Always null, since this information is not applied to array element data types in
<productname>PostgreSQL<
/></entry>
2034 <entry><literal>interval_type
</literal></entry>
2035 <entry><type>character_data
</type></entry>
2036 <entry>Always null, since this information is not applied to array element data types in
<productname>PostgreSQL<
/></entry>
2040 <entry><literal>interval_precision
</literal></entry>
2041 <entry><type>character_data
</type></entry>
2042 <entry>Always null, since this information is not applied to array element data types in
<productname>PostgreSQL<
/></entry>
2046 <entry><literal>domain_default
</literal></entry>
2047 <entry><type>character_data
</type></entry>
2048 <entry>Not yet implemented
</entry>
2052 <entry><literal>udt_catalog
</literal></entry>
2053 <entry><type>sql_identifier
</type></entry>
2055 Name of the database that the data type of the elements is
2056 defined in (always the current database)
2061 <entry><literal>udt_schema
</literal></entry>
2062 <entry><type>sql_identifier
</type></entry>
2064 Name of the schema that the data type of the elements is
2070 <entry><literal>udt_name
</literal></entry>
2071 <entry><type>sql_identifier
</type></entry>
2073 Name of the data type of the elements
2078 <entry><literal>scope_catalog
</literal></entry>
2079 <entry><type>sql_identifier
</type></entry>
2080 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
2084 <entry><literal>scope_schema
</literal></entry>
2085 <entry><type>sql_identifier
</type></entry>
2086 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
2090 <entry><literal>scope_name
</literal></entry>
2091 <entry><type>sql_identifier
</type></entry>
2092 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
2096 <entry><literal>maximum_cardinality
</literal></entry>
2097 <entry><type>cardinal_number
</type></entry>
2098 <entry>Always null, because arrays always have unlimited maximum cardinality in
<productname>PostgreSQL<
/></entry>
2106 <sect1 id=
"infoschema-enabled-roles">
2107 <title><literal>enabled_roles
</literal></title>
2110 The view
<literal>enabled_roles
</literal> identifies the currently
2111 <quote>enabled roles
</quote>. The enabled roles are recursively
2112 defined as the current user together with all roles that have been
2113 granted to the enabled roles with automatic inheritance. In other
2114 words, these are all roles that the current user has direct or
2115 indirect, automatically inheriting membership in.
2116 <indexterm><primary>enabled role
</primary></indexterm>
2117 <indexterm><primary>role
</primary><secondary>enabled
</secondary></indexterm>
2121 For permission checking, the set of
<quote>applicable roles
</quote>
2122 is applied, which can be broader than the set of enabled roles. So
2123 generally, it is better to use the view
2124 <literal>applicable_roles
</literal> instead of this one; see also
2129 <title><literal>enabled_roles
</literal> Columns
</title>
2135 <entry>Data Type
</entry>
2136 <entry>Description
</entry>
2142 <entry><literal>role_name
</literal></entry>
2143 <entry><type>sql_identifier
</type></entry>
2144 <entry>Name of a role
</entry>
2151 <sect1 id=
"infoschema-foreign-data-wrapper-options">
2152 <title><literal>foreign_data_wrapper_options
</literal></title>
2155 The view
<literal>foreign_data_wrapper_options
</literal> contains
2156 all the options defined for foreign-data wrappers in the current
2157 database. Only those foreign-data wrappers are shown that the
2158 current user has access to (by way of being the owner or having
2163 <title><literal>foreign_data_wrapper_options
</literal> Columns
</title>
2169 <entry>Data Type
</entry>
2170 <entry>Description
</entry>
2176 <entry><literal>foreign_data_wrapper_catalog
</literal></entry>
2177 <entry><type>sql_identifier
</type></entry>
2178 <entry>Name of the database that the foreign-data wrapper is defined in (always the current database)
</entry>
2182 <entry><literal>foreign_data_wrapper_name
</literal></entry>
2183 <entry><type>sql_identifier
</type></entry>
2184 <entry>Name of the foreign-data wrapper
</entry>
2188 <entry><literal>option_name
</literal></entry>
2189 <entry><type>sql_identifier
</type></entry>
2190 <entry>Name of an option
</entry>
2194 <entry><literal>option_value
</literal></entry>
2195 <entry><type>character_data
</type></entry>
2196 <entry>Value of the option
</entry>
2203 <sect1 id=
"infoschema-foreign-data-wrappers">
2204 <title><literal>foreign_data_wrappers
</literal></title>
2207 The view
<literal>foreign_data_wrappers
</literal> contains all
2208 foreign-data wrappers defined in the current database. Only those
2209 foreign-data wrappers are shown that the current user has access to
2210 (by way of being the owner or having some privilege).
2214 <title><literal>foreign_data_wrappers
</literal> Columns
</title>
2220 <entry>Data Type
</entry>
2221 <entry>Description
</entry>
2227 <entry><literal>foreign_data_wrapper_catalog
</literal></entry>
2228 <entry><type>sql_identifier
</type></entry>
2229 <entry>Name of the database that contains the foreign-data
2230 wrapper (always the current database)
</entry>
2234 <entry><literal>foreign_data_wrapper_name
</literal></entry>
2235 <entry><type>sql_identifier
</type></entry>
2236 <entry>Name of the foreign-data wrapper
</entry>
2240 <entry><literal>authorization_identifier
</literal></entry>
2241 <entry><type>sql_identifier
</type></entry>
2242 <entry>Name of the owner of the foreign server
</entry>
2246 <entry><literal>library_name
</literal></entry>
2247 <entry><type>character_data
</type></entry>
2248 <entry>File name of the library that implementing this foreign-data wrapper
</entry>
2252 <entry><literal>foreign_data_wrapper_language
</literal></entry>
2253 <entry><type>character_data
</type></entry>
2254 <entry>Language used to implement this foreign-data wrapper
</entry>
2261 <sect1 id=
"infoschema-foreign-server-options">
2262 <title><literal>foreign_server_options
</literal></title>
2265 The view
<literal>foreign_server_options
</literal> contains all the
2266 options defined for foreign servers in the current database. Only
2267 those foreign servers are shown that the current user has access to
2268 (by way of being the owner or having some privilege).
2272 <title><literal>foreign_server_options
</literal> Columns
</title>
2278 <entry>Data Type
</entry>
2279 <entry>Description
</entry>
2285 <entry><literal>foreign_server_catalog
</literal></entry>
2286 <entry><type>sql_identifier
</type></entry>
2287 <entry>Name of the database that the foreign server is defined in (always the current database)
</entry>
2291 <entry><literal>foreign_server_name
</literal></entry>
2292 <entry><type>sql_identifier
</type></entry>
2293 <entry>Name of the foreign server
</entry>
2297 <entry><literal>option_name
</literal></entry>
2298 <entry><type>sql_identifier
</type></entry>
2299 <entry>Name of an option
</entry>
2303 <entry><literal>option_value
</literal></entry>
2304 <entry><type>character_data
</type></entry>
2305 <entry>Value of the option
</entry>
2312 <sect1 id=
"infoschema-foreign-servers">
2313 <title><literal>foreign_servers
</literal></title>
2316 The view
<literal>foreign_servers
</literal> contains all foreign
2317 servers defined in the current database. Only those foreign
2318 servers are shown that the current user has access to (by way of
2319 being the owner or having some privilege).
2323 <title><literal>foreign_servers
</literal> Columns
</title>
2329 <entry>Data Type
</entry>
2330 <entry>Description
</entry>
2336 <entry><literal>foreign_server_catalog
</literal></entry>
2337 <entry><type>sql_identifier
</type></entry>
2338 <entry>Name of the database that the foreign server is defined in (always the current database)
</entry>
2342 <entry><literal>foreign_server_name
</literal></entry>
2343 <entry><type>sql_identifier
</type></entry>
2344 <entry>Name of the foreign server
</entry>
2348 <entry><literal>foreign_data_wrapper_catalog
</literal></entry>
2349 <entry><type>sql_identifier
</type></entry>
2350 <entry>Name of the database that contains the foreign-data
2351 wrapper used by the foreign server (always the current database)
</entry>
2355 <entry><literal>foreign_data_wrapper_name
</literal></entry>
2356 <entry><type>sql_identifier
</type></entry>
2357 <entry>Name of the foreign-data wrapper used by the foreign server
</entry>
2361 <entry><literal>foreign_server_type
</literal></entry>
2362 <entry><type>character_data
</type></entry>
2363 <entry>Foreign server type information, if specified upon creation
</entry>
2367 <entry><literal>foreign_server_version
</literal></entry>
2368 <entry><type>character_data
</type></entry>
2369 <entry>Foreign server version information, if specified upon creation
</entry>
2373 <entry><literal>authorization_identifier
</literal></entry>
2374 <entry><type>sql_identifier
</type></entry>
2375 <entry>Name of the owner of the foreign server
</entry>
2382 <sect1 id=
"infoschema-key-column-usage">
2383 <title><literal>key_column_usage
</literal></title>
2386 The view
<literal>key_column_usage
</literal> identifies all columns
2387 in the current database that are restricted by some unique, primary
2388 key, or foreign key constraint. Check constraints are not included
2389 in this view. Only those columns are shown that the current user
2390 has access to, by way of being the owner or having some privilege.
2394 <title><literal>key_column_usage
</literal> Columns
</title>
2400 <entry>Data Type
</entry>
2401 <entry>Description
</entry>
2407 <entry><literal>constraint_catalog
</literal></entry>
2408 <entry><type>sql_identifier
</type></entry>
2409 <entry>Name of the database that contains the constraint (always the current database)
</entry>
2413 <entry><literal>constraint_schema
</literal></entry>
2414 <entry><type>sql_identifier
</type></entry>
2415 <entry>Name of the schema that contains the constraint
</entry>
2419 <entry><literal>constraint_name
</literal></entry>
2420 <entry><type>sql_identifier
</type></entry>
2421 <entry>Name of the constraint
</entry>
2425 <entry><literal>table_catalog
</literal></entry>
2426 <entry><type>sql_identifier
</type></entry>
2428 Name of the database that contains the table that contains the
2429 column that is restricted by this constraint (always the
2435 <entry><literal>table_schema
</literal></entry>
2436 <entry><type>sql_identifier
</type></entry>
2438 Name of the schema that contains the table that contains the
2439 column that is restricted by this constraint
2444 <entry><literal>table_name
</literal></entry>
2445 <entry><type>sql_identifier
</type></entry>
2447 Name of the table that contains the column that is restricted
2453 <entry><literal>column_name
</literal></entry>
2454 <entry><type>sql_identifier
</type></entry>
2456 Name of the column that is restricted by this constraint
2461 <entry><literal>ordinal_position
</literal></entry>
2462 <entry><type>cardinal_number
</type></entry>
2464 Ordinal position of the column within the constraint key (count
2470 <entry><literal>position_in_unique_constraint
</literal></entry>
2471 <entry><type>cardinal_number
</type></entry>
2473 For a foreign-key constraint, ordinal position of the referenced
2474 column within its unique constraint (count starts at
1);
2483 <sect1 id=
"infoschema-parameters">
2484 <title><literal>parameters
</literal></title>
2487 The view
<literal>parameters
</literal> contains information about
2488 the parameters (arguments) of all functions in the current database.
2489 Only those functions are shown that the current user has access to
2490 (by way of being the owner or having some privilege).
2494 <title><literal>parameters
</literal> Columns
</title>
2500 <entry>Data Type
</entry>
2501 <entry>Description
</entry>
2507 <entry><literal>specific_catalog
</literal></entry>
2508 <entry><type>sql_identifier
</type></entry>
2509 <entry>Name of the database containing the function (always the current database)
</entry>
2513 <entry><literal>specific_schema
</literal></entry>
2514 <entry><type>sql_identifier
</type></entry>
2515 <entry>Name of the schema containing the function
</entry>
2519 <entry><literal>specific_name
</literal></entry>
2520 <entry><type>sql_identifier
</type></entry>
2522 The
<quote>specific name
</quote> of the function. See
<xref
2523 linkend=
"infoschema-routines"> for more information.
2528 <entry><literal>ordinal_position
</literal></entry>
2529 <entry><type>cardinal_number
</type></entry>
2531 Ordinal position of the parameter in the argument list of the
2532 function (count starts at
1)
2537 <entry><literal>parameter_mode
</literal></entry>
2538 <entry><type>character_data
</type></entry>
2540 <literal>IN
</literal> for input parameter,
2541 <literal>OUT
</literal> for output parameter,
2542 and
<literal>INOUT
</literal> for input/output parameter.
2547 <entry><literal>is_result
</literal></entry>
2548 <entry><type>character_data
</type></entry>
2549 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
2553 <entry><literal>as_locator
</literal></entry>
2554 <entry><type>character_data
</type></entry>
2555 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
2559 <entry><literal>parameter_name
</literal></entry>
2560 <entry><type>sql_identifier
</type></entry>
2561 <entry>Name of the parameter, or null if the parameter has no name
</entry>
2565 <entry><literal>data_type
</literal></entry>
2566 <entry><type>character_data
</type></entry>
2568 Data type of the parameter, if it is a built-in type, or
2569 <literal>ARRAY
</literal> if it is some array (in that case, see
2570 the view
<literal>element_types
</literal>), else
2571 <literal>USER-DEFINED
</literal> (in that case, the type is
2572 identified in
<literal>udt_name
</literal> and associated
2578 <entry><literal>character_maximum_length
</literal></entry>
2579 <entry><type>cardinal_number
</type></entry>
2580 <entry>Always null, since this information is not applied to parameter data types in
<productname>PostgreSQL<
/></entry>
2584 <entry><literal>character_octet_length
</literal></entry>
2585 <entry><type>cardinal_number
</type></entry>
2586 <entry>Always null, since this information is not applied to parameter data types in
<productname>PostgreSQL<
/></entry>
2590 <entry><literal>character_set_catalog
</literal></entry>
2591 <entry><type>sql_identifier
</type></entry>
2592 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
2596 <entry><literal>character_set_schema
</literal></entry>
2597 <entry><type>sql_identifier
</type></entry>
2598 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
2602 <entry><literal>character_set_name
</literal></entry>
2603 <entry><type>sql_identifier
</type></entry>
2604 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
2608 <entry><literal>collation_catalog
</literal></entry>
2609 <entry><type>sql_identifier
</type></entry>
2610 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
2614 <entry><literal>collation_schema
</literal></entry>
2615 <entry><type>sql_identifier
</type></entry>
2616 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
2620 <entry><literal>collation_name
</literal></entry>
2621 <entry><type>sql_identifier
</type></entry>
2622 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
2626 <entry><literal>numeric_precision
</literal></entry>
2627 <entry><type>cardinal_number
</type></entry>
2628 <entry>Always null, since this information is not applied to parameter data types in
<productname>PostgreSQL<
/></entry>
2632 <entry><literal>numeric_precision_radix
</literal></entry>
2633 <entry><type>cardinal_number
</type></entry>
2634 <entry>Always null, since this information is not applied to parameter data types in
<productname>PostgreSQL<
/></entry>
2638 <entry><literal>numeric_scale
</literal></entry>
2639 <entry><type>cardinal_number
</type></entry>
2640 <entry>Always null, since this information is not applied to parameter data types in
<productname>PostgreSQL<
/></entry>
2644 <entry><literal>datetime_precision
</literal></entry>
2645 <entry><type>cardinal_number
</type></entry>
2646 <entry>Always null, since this information is not applied to parameter data types in
<productname>PostgreSQL<
/></entry>
2650 <entry><literal>interval_type
</literal></entry>
2651 <entry><type>character_data
</type></entry>
2652 <entry>Always null, since this information is not applied to parameter data types in
<productname>PostgreSQL<
/></entry>
2656 <entry><literal>interval_precision
</literal></entry>
2657 <entry><type>character_data
</type></entry>
2658 <entry>Always null, since this information is not applied to parameter data types in
<productname>PostgreSQL<
/></entry>
2662 <entry><literal>udt_catalog
</literal></entry>
2663 <entry><type>sql_identifier
</type></entry>
2665 Name of the database that the data type of the parameter is
2666 defined in (always the current database)
2671 <entry><literal>udt_schema
</literal></entry>
2672 <entry><type>sql_identifier
</type></entry>
2674 Name of the schema that the data type of the parameter is
2680 <entry><literal>udt_name
</literal></entry>
2681 <entry><type>sql_identifier
</type></entry>
2683 Name of the data type of the parameter
2688 <entry><literal>scope_catalog
</literal></entry>
2689 <entry><type>sql_identifier
</type></entry>
2690 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
2694 <entry><literal>scope_schema
</literal></entry>
2695 <entry><type>sql_identifier
</type></entry>
2696 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
2700 <entry><literal>scope_name
</literal></entry>
2701 <entry><type>sql_identifier
</type></entry>
2702 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
2706 <entry><literal>maximum_cardinality
</literal></entry>
2707 <entry><type>cardinal_number
</type></entry>
2708 <entry>Always null, because arrays always have unlimited maximum cardinality in
<productname>PostgreSQL<
/></entry>
2712 <entry><literal>dtd_identifier
</literal></entry>
2713 <entry><type>sql_identifier
</type></entry>
2715 An identifier of the data type descriptor of the parameter,
2716 unique among the data type descriptors pertaining to the
2717 function. This is mainly useful for joining with other
2718 instances of such identifiers. (The specific format of the
2719 identifier is not defined and not guaranteed to remain the same
2720 in future versions.)
2728 <sect1 id=
"infoschema-referential-constraints">
2729 <title><literal>referential_constraints
</literal></title>
2732 The view
<literal>referential_constraints
</literal> contains all
2733 referential (foreign key) constraints in the current database.
2734 Only those constraints are shown for which the current user has
2735 write access to the referencing table (by way of being the
2736 owner or having some privilege other than SELECT).
2740 <title><literal>referential_constraints
</literal> Columns
</title>
2746 <entry>Data Type
</entry>
2747 <entry>Description
</entry>
2753 <entry><literal>constraint_catalog
</literal></entry>
2754 <entry><literal>sql_identifier
</literal></entry>
2755 <entry>Name of the database containing the constraint (always the current database)
</entry>
2759 <entry><literal>constraint_schema
</literal></entry>
2760 <entry><literal>sql_identifier
</literal></entry>
2761 <entry>Name of the schema containing the constraint
</entry>
2765 <entry><literal>constraint_name
</literal></entry>
2766 <entry><literal>sql_identifier
</literal></entry>
2767 <entry>Name of the constraint
</entry>
2771 <entry><literal>unique_constraint_catalog
</literal></entry>
2772 <entry><literal>sql_identifier
</literal></entry>
2774 Name of the database that contains the unique or primary key
2775 constraint that the foreign key constraint references (always
2776 the current database)
2781 <entry><literal>unique_constraint_schema
</literal></entry>
2782 <entry><literal>sql_identifier
</literal></entry>
2784 Name of the schema that contains the unique or primary key
2785 constraint that the foreign key constraint references
2790 <entry><literal>unique_constraint_name
</literal></entry>
2791 <entry><literal>sql_identifier
</literal></entry>
2793 Name of the unique or primary key constraint that the foreign
2794 key constraint references
2799 <entry><literal>match_option
</literal></entry>
2800 <entry><literal>character_data
</literal></entry>
2802 Match option of the foreign key constraint:
2803 <literal>FULL
</literal>,
<literal>PARTIAL
</literal>, or
2804 <literal>NONE
</literal>.
2809 <entry><literal>update_rule
</literal></entry>
2810 <entry><literal>character_data
</literal></entry>
2812 Update rule of the foreign key constraint:
2813 <literal>CASCADE
</literal>,
<literal>SET NULL
</literal>,
2814 <literal>SET DEFAULT
</literal>,
<literal>RESTRICT
</literal>, or
2815 <literal>NO ACTION
</literal>.
2820 <entry><literal>delete_rule
</literal></entry>
2821 <entry><literal>character_data
</literal></entry>
2823 Delete rule of the foreign key constraint:
2824 <literal>CASCADE
</literal>,
<literal>SET NULL
</literal>,
2825 <literal>SET DEFAULT
</literal>,
<literal>RESTRICT
</literal>, or
2826 <literal>NO ACTION
</literal>.
2834 <sect1 id=
"infoschema-role-column-grants">
2835 <title><literal>role_column_grants
</literal></title>
2838 The view
<literal>role_column_grants
</literal> identifies all
2839 privileges granted on columns where the grantor or grantee is a
2840 currently enabled role. Further information can be found under
2841 <literal>column_privileges
</literal>.
2845 <title><literal>role_column_grants
</literal> Columns
</title>
2851 <entry>Data Type
</entry>
2852 <entry>Description
</entry>
2858 <entry><literal>grantor
</literal></entry>
2859 <entry><type>sql_identifier
</type></entry>
2860 <entry>Name of the role that granted the privilege
</entry>
2864 <entry><literal>grantee
</literal></entry>
2865 <entry><type>sql_identifier
</type></entry>
2866 <entry>Name of the role that the privilege was granted to
</entry>
2870 <entry><literal>table_catalog
</literal></entry>
2871 <entry><type>sql_identifier
</type></entry>
2872 <entry>Name of the database that contains the table that contains the column (always the current database)
</entry>
2876 <entry><literal>table_schema
</literal></entry>
2877 <entry><type>sql_identifier
</type></entry>
2878 <entry>Name of the schema that contains the table that contains the column
</entry>
2882 <entry><literal>table_name
</literal></entry>
2883 <entry><type>sql_identifier
</type></entry>
2884 <entry>Name of the table that contains the column
</entry>
2888 <entry><literal>column_name
</literal></entry>
2889 <entry><type>sql_identifier
</type></entry>
2890 <entry>Name of the column
</entry>
2894 <entry><literal>privilege_type
</literal></entry>
2895 <entry><type>character_data
</type></entry>
2897 Type of the privilege:
<literal>SELECT
</literal>,
2898 <literal>INSERT
</literal>,
<literal>UPDATE
</literal>, or
2899 <literal>REFERENCES
</literal>
2904 <entry><literal>is_grantable
</literal></entry>
2905 <entry><type>character_data
</type></entry>
2906 <entry><literal>YES
</literal> if the privilege is grantable,
<literal>NO
</literal> if not
</entry>
2913 <sect1 id=
"infoschema-role-routine-grants">
2914 <title><literal>role_routine_grants
</literal></title>
2917 The view
<literal>role_routine_grants
</literal> identifies all
2918 privileges granted on functions where the grantor or grantee is a
2919 currently enabled role. Further information can be found under
2920 <literal>routine_privileges
</literal>.
2924 <title><literal>role_routine_grants
</literal> Columns
</title>
2930 <entry>Data Type
</entry>
2931 <entry>Description
</entry>
2937 <entry><literal>grantor
</literal></entry>
2938 <entry><type>sql_identifier
</type></entry>
2939 <entry>Name of the role that granted the privilege
</entry>
2943 <entry><literal>grantee
</literal></entry>
2944 <entry><type>sql_identifier
</type></entry>
2945 <entry>Name of the role that the privilege was granted to
</entry>
2949 <entry><literal>specific_catalog
</literal></entry>
2950 <entry><type>sql_identifier
</type></entry>
2951 <entry>Name of the database containing the function (always the current database)
</entry>
2955 <entry><literal>specific_schema
</literal></entry>
2956 <entry><type>sql_identifier
</type></entry>
2957 <entry>Name of the schema containing the function
</entry>
2961 <entry><literal>specific_name
</literal></entry>
2962 <entry><type>sql_identifier
</type></entry>
2964 The
<quote>specific name
</quote> of the function. See
<xref
2965 linkend=
"infoschema-routines"> for more information.
2970 <entry><literal>routine_catalog
</literal></entry>
2971 <entry><type>sql_identifier
</type></entry>
2972 <entry>Name of the database containing the function (always the current database)
</entry>
2976 <entry><literal>routine_schema
</literal></entry>
2977 <entry><type>sql_identifier
</type></entry>
2978 <entry>Name of the schema containing the function
</entry>
2982 <entry><literal>routine_name
</literal></entry>
2983 <entry><type>sql_identifier
</type></entry>
2984 <entry>Name of the function (might be duplicated in case of overloading)
</entry>
2988 <entry><literal>privilege_type
</literal></entry>
2989 <entry><type>character_data
</type></entry>
2990 <entry>Always
<literal>EXECUTE
</literal> (the only privilege type for functions)
</entry>
2994 <entry><literal>is_grantable
</literal></entry>
2995 <entry><type>character_data
</type></entry>
2996 <entry><literal>YES
</literal> if the privilege is grantable,
<literal>NO
</literal> if not
</entry>
3003 <sect1 id=
"infoschema-role-table-grants">
3004 <title><literal>role_table_grants
</literal></title>
3007 The view
<literal>role_table_grants
</literal> identifies all
3008 privileges granted on tables or views where the grantor or grantee
3009 is a currently enabled role. Further information can be found
3010 under
<literal>table_privileges
</literal>.
3014 <title><literal>role_table_grants
</literal> Columns
</title>
3020 <entry>Data Type
</entry>
3021 <entry>Description
</entry>
3027 <entry><literal>grantor
</literal></entry>
3028 <entry><type>sql_identifier
</type></entry>
3029 <entry>Name of the role that granted the privilege
</entry>
3033 <entry><literal>grantee
</literal></entry>
3034 <entry><type>sql_identifier
</type></entry>
3035 <entry>Name of the role that the privilege was granted to
</entry>
3039 <entry><literal>table_catalog
</literal></entry>
3040 <entry><type>sql_identifier
</type></entry>
3041 <entry>Name of the database that contains the table (always the current database)
</entry>
3045 <entry><literal>table_schema
</literal></entry>
3046 <entry><type>sql_identifier
</type></entry>
3047 <entry>Name of the schema that contains the table
</entry>
3051 <entry><literal>table_name
</literal></entry>
3052 <entry><type>sql_identifier
</type></entry>
3053 <entry>Name of the table
</entry>
3057 <entry><literal>privilege_type
</literal></entry>
3058 <entry><type>character_data
</type></entry>
3060 Type of the privilege:
<literal>SELECT
</literal>,
3061 <literal>INSERT
</literal>,
<literal>UPDATE
</literal>,
3062 <literal>DELETE
</literal>,
<literal>TRUNCATE
</literal>,
3063 <literal>REFERENCES
</literal>, or
<literal>TRIGGER
</literal>
3068 <entry><literal>is_grantable
</literal></entry>
3069 <entry><type>character_data
</type></entry>
3070 <entry><literal>YES
</literal> if the privilege is grantable,
<literal>NO
</literal> if not
</entry>
3074 <entry><literal>with_hierarchy
</literal></entry>
3075 <entry><type>character_data
</type></entry>
3076 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
3083 <sect1 id=
"infoschema-role-usage-grants">
3084 <title><literal>role_usage_grants
</literal></title>
3087 The view
<literal>role_usage_grants
</literal> identifies
3088 <literal>USAGE
</literal> privileges granted on various kinds of
3089 objects where the grantor or grantee is a currently enabled role.
3090 Further information can be found under
3091 <literal>usage_privileges
</literal>.
3095 <title><literal>role_usage_grants
</literal> Columns
</title>
3101 <entry>Data Type
</entry>
3102 <entry>Description
</entry>
3108 <entry><literal>grantor
</literal></entry>
3109 <entry><type>sql_identifier
</type></entry>
3110 <entry>The name of the role that granted the privilege
</entry>
3114 <entry><literal>grantee
</literal></entry>
3115 <entry><type>sql_identifier
</type></entry>
3116 <entry>The name of the role that the privilege was granted to
</entry>
3120 <entry><literal>object_catalog
</literal></entry>
3121 <entry><type>sql_identifier
</type></entry>
3122 <entry>Name of the database containing the object (always the current database)
</entry>
3126 <entry><literal>object_schema
</literal></entry>
3127 <entry><type>sql_identifier
</type></entry>
3128 <entry>Name of the schema containing the object, if applicable,
3129 else an empty string
</entry>
3133 <entry><literal>object_name
</literal></entry>
3134 <entry><type>sql_identifier
</type></entry>
3135 <entry>Name of the object
</entry>
3139 <entry><literal>object_type
</literal></entry>
3140 <entry><type>character_data
</type></entry>
3141 <entry><literal>DOMAIN
</literal> or
<literal>FOREIGN DATA WRAPPER
</literal> or
<literal>FOREIGN SERVER
</literal></entry>
3145 <entry><literal>privilege_type
</literal></entry>
3146 <entry><type>character_data
</type></entry>
3147 <entry>Always
<literal>USAGE
</literal></entry>
3151 <entry><literal>is_grantable
</literal></entry>
3152 <entry><type>character_data
</type></entry>
3153 <entry><literal>YES
</literal> if the privilege is grantable,
<literal>NO
</literal> if not
</entry>
3160 <sect1 id=
"infoschema-routine-privileges">
3161 <title><literal>routine_privileges
</literal></title>
3164 The view
<literal>routine_privileges
</literal> identifies all
3165 privileges granted on functions to a currently enabled role or by a
3166 currently enabled role. There is one row for each combination of function,
3167 grantor, and grantee.
3171 <title><literal>routine_privileges
</literal> Columns
</title>
3177 <entry>Data Type
</entry>
3178 <entry>Description
</entry>
3184 <entry><literal>grantor
</literal></entry>
3185 <entry><type>sql_identifier
</type></entry>
3186 <entry>Name of the role that granted the privilege
</entry>
3190 <entry><literal>grantee
</literal></entry>
3191 <entry><type>sql_identifier
</type></entry>
3192 <entry>Name of the role that the privilege was granted to
</entry>
3196 <entry><literal>specific_catalog
</literal></entry>
3197 <entry><type>sql_identifier
</type></entry>
3198 <entry>Name of the database containing the function (always the current database)
</entry>
3202 <entry><literal>specific_schema
</literal></entry>
3203 <entry><type>sql_identifier
</type></entry>
3204 <entry>Name of the schema containing the function
</entry>
3208 <entry><literal>specific_name
</literal></entry>
3209 <entry><type>sql_identifier
</type></entry>
3211 The
<quote>specific name
</quote> of the function. See
<xref
3212 linkend=
"infoschema-routines"> for more information.
3217 <entry><literal>routine_catalog
</literal></entry>
3218 <entry><type>sql_identifier
</type></entry>
3219 <entry>Name of the database containing the function (always the current database)
</entry>
3223 <entry><literal>routine_schema
</literal></entry>
3224 <entry><type>sql_identifier
</type></entry>
3225 <entry>Name of the schema containing the function
</entry>
3229 <entry><literal>routine_name
</literal></entry>
3230 <entry><type>sql_identifier
</type></entry>
3231 <entry>Name of the function (might be duplicated in case of overloading)
</entry>
3235 <entry><literal>privilege_type
</literal></entry>
3236 <entry><type>character_data
</type></entry>
3237 <entry>Always
<literal>EXECUTE
</literal> (the only privilege type for functions)
</entry>
3241 <entry><literal>is_grantable
</literal></entry>
3242 <entry><type>character_data
</type></entry>
3243 <entry><literal>YES
</literal> if the privilege is grantable,
<literal>NO
</literal> if not
</entry>
3250 <sect1 id=
"infoschema-routines">
3251 <title><literal>routines
</literal></title>
3254 The view
<literal>routines
</literal> contains all functions in the
3255 current database. Only those functions are shown that the current
3256 user has access to (by way of being the owner or having some
3261 <title><literal>routines
</literal> Columns
</title>
3267 <entry>Data Type
</entry>
3268 <entry>Description
</entry>
3274 <entry><literal>specific_catalog
</literal></entry>
3275 <entry><type>sql_identifier
</type></entry>
3276 <entry>Name of the database containing the function (always the current database)
</entry>
3280 <entry><literal>specific_schema
</literal></entry>
3281 <entry><type>sql_identifier
</type></entry>
3282 <entry>Name of the schema containing the function
</entry>
3286 <entry><literal>specific_name
</literal></entry>
3287 <entry><type>sql_identifier
</type></entry>
3289 The
<quote>specific name
</quote> of the function. This is a
3290 name that uniquely identifies the function in the schema, even
3291 if the real name of the function is overloaded. The format of
3292 the specific name is not defined, it should only be used to
3293 compare it to other instances of specific routine names.
3298 <entry><literal>routine_catalog
</literal></entry>
3299 <entry><type>sql_identifier
</type></entry>
3300 <entry>Name of the database containing the function (always the current database)
</entry>
3304 <entry><literal>routine_schema
</literal></entry>
3305 <entry><type>sql_identifier
</type></entry>
3306 <entry>Name of the schema containing the function
</entry>
3310 <entry><literal>routine_name
</literal></entry>
3311 <entry><type>sql_identifier
</type></entry>
3312 <entry>Name of the function (might be duplicated in case of overloading)
</entry>
3316 <entry><literal>routine_type
</literal></entry>
3317 <entry><type>character_data
</type></entry>
3319 Always
<literal>FUNCTION
</literal> (In the future there might
3320 be other types of routines.)
3325 <entry><literal>module_catalog
</literal></entry>
3326 <entry><type>sql_identifier
</type></entry>
3327 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
3331 <entry><literal>module_schema
</literal></entry>
3332 <entry><type>sql_identifier
</type></entry>
3333 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
3337 <entry><literal>module_name
</literal></entry>
3338 <entry><type>sql_identifier
</type></entry>
3339 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
3343 <entry><literal>udt_catalog
</literal></entry>
3344 <entry><type>sql_identifier
</type></entry>
3345 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
3349 <entry><literal>udt_schema
</literal></entry>
3350 <entry><type>sql_identifier
</type></entry>
3351 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
3355 <entry><literal>udt_name
</literal></entry>
3356 <entry><type>sql_identifier
</type></entry>
3357 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
3361 <entry><literal>data_type
</literal></entry>
3362 <entry><type>character_data
</type></entry>
3364 Return data type of the function, if it is a built-in type, or
3365 <literal>ARRAY
</literal> if it is some array (in that case, see
3366 the view
<literal>element_types
</literal>), else
3367 <literal>USER-DEFINED
</literal> (in that case, the type is
3368 identified in
<literal>type_udt_name
</literal> and associated
3374 <entry><literal>character_maximum_length
</literal></entry>
3375 <entry><type>cardinal_number
</type></entry>
3376 <entry>Always null, since this information is not applied to return data types in
<productname>PostgreSQL<
/></entry>
3380 <entry><literal>character_octet_length
</literal></entry>
3381 <entry><type>cardinal_number
</type></entry>
3382 <entry>Always null, since this information is not applied to return data types in
<productname>PostgreSQL<
/></entry>
3386 <entry><literal>character_set_catalog
</literal></entry>
3387 <entry><type>sql_identifier
</type></entry>
3388 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
3392 <entry><literal>character_set_schema
</literal></entry>
3393 <entry><type>sql_identifier
</type></entry>
3394 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
3398 <entry><literal>character_set_name
</literal></entry>
3399 <entry><type>sql_identifier
</type></entry>
3400 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
3404 <entry><literal>collation_catalog
</literal></entry>
3405 <entry><type>sql_identifier
</type></entry>
3406 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
3410 <entry><literal>collation_schema
</literal></entry>
3411 <entry><type>sql_identifier
</type></entry>
3412 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
3416 <entry><literal>collation_name
</literal></entry>
3417 <entry><type>sql_identifier
</type></entry>
3418 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
3422 <entry><literal>numeric_precision
</literal></entry>
3423 <entry><type>cardinal_number
</type></entry>
3424 <entry>Always null, since this information is not applied to return data types in
<productname>PostgreSQL<
/></entry>
3428 <entry><literal>numeric_precision_radix
</literal></entry>
3429 <entry><type>cardinal_number
</type></entry>
3430 <entry>Always null, since this information is not applied to return data types in
<productname>PostgreSQL<
/></entry>
3434 <entry><literal>numeric_scale
</literal></entry>
3435 <entry><type>cardinal_number
</type></entry>
3436 <entry>Always null, since this information is not applied to return data types in
<productname>PostgreSQL<
/></entry>
3440 <entry><literal>datetime_precision
</literal></entry>
3441 <entry><type>cardinal_number
</type></entry>
3442 <entry>Always null, since this information is not applied to return data types in
<productname>PostgreSQL<
/></entry>
3446 <entry><literal>interval_type
</literal></entry>
3447 <entry><type>character_data
</type></entry>
3448 <entry>Always null, since this information is not applied to return data types in
<productname>PostgreSQL<
/></entry>
3452 <entry><literal>interval_precision
</literal></entry>
3453 <entry><type>character_data
</type></entry>
3454 <entry>Always null, since this information is not applied to return data types in
<productname>PostgreSQL<
/></entry>
3458 <entry><literal>type_udt_catalog
</literal></entry>
3459 <entry><type>sql_identifier
</type></entry>
3461 Name of the database that the return data type of the function
3462 is defined in (always the current database)
3467 <entry><literal>type_udt_schema
</literal></entry>
3468 <entry><type>sql_identifier
</type></entry>
3470 Name of the schema that the return data type of the function is
3476 <entry><literal>type_udt_name
</literal></entry>
3477 <entry><type>sql_identifier
</type></entry>
3479 Name of the return data type of the function
3484 <entry><literal>scope_catalog
</literal></entry>
3485 <entry><type>sql_identifier
</type></entry>
3486 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
3490 <entry><literal>scope_schema
</literal></entry>
3491 <entry><type>sql_identifier
</type></entry>
3492 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
3496 <entry><literal>scope_name
</literal></entry>
3497 <entry><type>sql_identifier
</type></entry>
3498 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
3502 <entry><literal>maximum_cardinality
</literal></entry>
3503 <entry><type>cardinal_number
</type></entry>
3504 <entry>Always null, because arrays always have unlimited maximum cardinality in
<productname>PostgreSQL<
/></entry>
3508 <entry><literal>dtd_identifier
</literal></entry>
3509 <entry><type>sql_identifier
</type></entry>
3511 An identifier of the data type descriptor of the return data
3512 type of this function, unique among the data type descriptors
3513 pertaining to the function. This is mainly useful for joining
3514 with other instances of such identifiers. (The specific format
3515 of the identifier is not defined and not guaranteed to remain
3516 the same in future versions.)
3521 <entry><literal>routine_body
</literal></entry>
3522 <entry><type>character_data
</type></entry>
3524 If the function is an SQL function, then
3525 <literal>SQL
</literal>, else
<literal>EXTERNAL
</literal>.
3530 <entry><literal>routine_definition
</literal></entry>
3531 <entry><type>character_data
</type></entry>
3533 The source text of the function (null if the function is not
3534 owned by a currently enabled role). (According to the SQL
3535 standard, this column is only applicable if
3536 <literal>routine_body
</literal> is
<literal>SQL
</literal>, but
3537 in
<productname>PostgreSQL
</productname> it will contain
3538 whatever source text was specified when the function was
3544 <entry><literal>external_name
</literal></entry>
3545 <entry><type>character_data
</type></entry>
3547 If this function is a C function, then the external name (link
3548 symbol) of the function; else null. (This works out to be the
3549 same value that is shown in
3550 <literal>routine_definition
</literal>.)
3555 <entry><literal>external_language
</literal></entry>
3556 <entry><type>character_data
</type></entry>
3557 <entry>The language the function is written in
</entry>
3561 <entry><literal>parameter_style
</literal></entry>
3562 <entry><type>character_data
</type></entry>
3564 Always
<literal>GENERAL
</literal> (The SQL standard defines
3565 other parameter styles, which are not available in
<productname>PostgreSQL<
/>.)
3570 <entry><literal>is_deterministic
</literal></entry>
3571 <entry><type>character_data
</type></entry>
3573 If the function is declared immutable (called deterministic in
3574 the SQL standard), then
<literal>YES
</literal>, else
3575 <literal>NO
</literal>. (You cannot query the other volatility
3576 levels available in
<productname>PostgreSQL<
/> through the information schema.)
3581 <entry><literal>sql_data_access
</literal></entry>
3582 <entry><type>character_data
</type></entry>
3584 Always
<literal>MODIFIES
</literal>, meaning that the function
3585 possibly modifies SQL data. This information is not useful for
3586 <productname>PostgreSQL<
/>.
3591 <entry><literal>is_null_call
</literal></entry>
3592 <entry><type>character_data
</type></entry>
3594 If the function automatically returns null if any of its
3595 arguments are null, then
<literal>YES
</literal>, else
3596 <literal>NO
</literal>.
3601 <entry><literal>sql_path
</literal></entry>
3602 <entry><type>character_data
</type></entry>
3603 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
3607 <entry><literal>schema_level_routine
</literal></entry>
3608 <entry><type>character_data
</type></entry>
3610 Always
<literal>YES
</literal> (The opposite would be a method
3611 of a user-defined type, which is a feature not available in
3612 <productname>PostgreSQL<
/>.)
3617 <entry><literal>max_dynamic_result_sets
</literal></entry>
3618 <entry><type>cardinal_number
</type></entry>
3619 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
3623 <entry><literal>is_user_defined_cast
</literal></entry>
3624 <entry><type>character_data
</type></entry>
3625 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
3629 <entry><literal>is_implicitly_invocable
</literal></entry>
3630 <entry><type>character_data
</type></entry>
3631 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
3635 <entry><literal>security_type
</literal></entry>
3636 <entry><type>character_data
</type></entry>
3638 If the function runs with the privileges of the current user,
3639 then
<literal>INVOKER
</literal>, if the function runs with the
3640 privileges of the user who defined it, then
3641 <literal>DEFINER
</literal>.
3646 <entry><literal>to_sql_specific_catalog
</literal></entry>
3647 <entry><type>sql_identifier
</type></entry>
3648 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
3652 <entry><literal>to_sql_specific_schema
</literal></entry>
3653 <entry><type>sql_identifier
</type></entry>
3654 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
3658 <entry><literal>to_sql_specific_name
</literal></entry>
3659 <entry><type>sql_identifier
</type></entry>
3660 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
3664 <entry><literal>as_locator
</literal></entry>
3665 <entry><type>character_data
</type></entry>
3666 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
3670 <entry><literal>created
</literal></entry>
3671 <entry><type>time_stamp
</type></entry>
3672 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
3676 <entry><literal>last_altered
</literal></entry>
3677 <entry><type>time_stamp
</type></entry>
3678 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
3682 <entry><literal>new_savepoint_level
</literal></entry>
3683 <entry><type>character_data
</type></entry>
3684 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
3688 <entry><literal>is_udt_dependent
</literal></entry>
3689 <entry><type>character_data
</type></entry>
3690 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
3694 <entry><literal>result_cast_from_data_type
</literal></entry>
3695 <entry><type>character_data
</type></entry>
3696 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
3700 <entry><literal>result_cast_as_locator
</literal></entry>
3701 <entry><type>character_data
</type></entry>
3702 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
3706 <entry><literal>result_cast_char_max_length
</literal></entry>
3707 <entry><type>cardinal_number
</type></entry>
3708 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
3712 <entry><literal>result_cast_char_octet_length
</literal></entry>
3713 <entry><type>character_data
</type></entry>
3714 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
3718 <entry><literal>result_cast_char_set_catalog
</literal></entry>
3719 <entry><type>sql_identifier
</type></entry>
3720 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
3724 <entry><literal>result_cast_char_set_schema
</literal></entry>
3725 <entry><type>sql_identifier
</type></entry>
3726 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
3730 <entry><literal>result_cast_char_set_name
</literal></entry>
3731 <entry><type>sql_identifier
</type></entry>
3732 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
3736 <entry><literal>result_cast_collation_catalog
</literal></entry>
3737 <entry><type>sql_identifier
</type></entry>
3738 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
3742 <entry><literal>result_cast_collation_schema
</literal></entry>
3743 <entry><type>sql_identifier
</type></entry>
3744 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
3748 <entry><literal>result_cast_collation_name
</literal></entry>
3749 <entry><type>sql_identifier
</type></entry>
3750 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
3754 <entry><literal>result_cast_numeric_precision
</literal></entry>
3755 <entry><type>cardinal_number
</type></entry>
3756 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
3760 <entry><literal>result_cast_numeric_precision_radix
</literal></entry>
3761 <entry><type>cardinal_number
</type></entry>
3762 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
3766 <entry><literal>result_cast_numeric_scale
</literal></entry>
3767 <entry><type>cardinal_number
</type></entry>
3768 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
3772 <entry><literal>result_cast_datetime_precision
</literal></entry>
3773 <entry><type>character_data
</type></entry>
3774 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
3778 <entry><literal>result_cast_interval_type
</literal></entry>
3779 <entry><type>character_data
</type></entry>
3780 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
3784 <entry><literal>result_cast_interval_precision
</literal></entry>
3785 <entry><type>character_data
</type></entry>
3786 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
3790 <entry><literal>result_cast_type_udt_catalog
</literal></entry>
3791 <entry><type>sql_identifier
</type></entry>
3792 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
3796 <entry><literal>result_cast_type_udt_schema
</literal></entry>
3797 <entry><type>sql_identifier
</type></entry>
3798 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
3802 <entry><literal>result_cast_type_udt_name
</literal></entry>
3803 <entry><type>sql_identifier
</type></entry>
3804 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
3808 <entry><literal>result_cast_scope_catalog
</literal></entry>
3809 <entry><type>sql_identifier
</type></entry>
3810 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
3814 <entry><literal>result_cast_scope_schema
</literal></entry>
3815 <entry><type>sql_identifier
</type></entry>
3816 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
3820 <entry><literal>result_cast_scope_name
</literal></entry>
3821 <entry><type>sql_identifier
</type></entry>
3822 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
3826 <entry><literal>result_cast_maximum_cardinality
</literal></entry>
3827 <entry><type>cardinal_number
</type></entry>
3828 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
3832 <entry><literal>result_cast_dtd_identifier
</literal></entry>
3833 <entry><type>sql_identifier
</type></entry>
3834 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
3841 <sect1 id=
"infoschema-schemata">
3842 <title><literal>schemata
</literal></title>
3845 The view
<literal>schemata
</literal> contains all schemas in the
3846 current database that are owned by a currently enabled role.
3850 <title><literal>schemata
</literal> Columns
</title>
3856 <entry>Data Type
</entry>
3857 <entry>Description
</entry>
3863 <entry><literal>catalog_name
</literal></entry>
3864 <entry><type>sql_identifier
</type></entry>
3865 <entry>Name of the database that the schema is contained in (always the current database)
</entry>
3869 <entry><literal>schema_name
</literal></entry>
3870 <entry><type>sql_identifier
</type></entry>
3871 <entry>Name of the schema
</entry>
3875 <entry><literal>schema_owner
</literal></entry>
3876 <entry><type>sql_identifier
</type></entry>
3877 <entry>Name of the owner of the schema
</entry>
3881 <entry><literal>default_character_set_catalog
</literal></entry>
3882 <entry><type>sql_identifier
</type></entry>
3883 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
3887 <entry><literal>default_character_set_schema
</literal></entry>
3888 <entry><type>sql_identifier
</type></entry>
3889 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
3893 <entry><literal>default_character_set_name
</literal></entry>
3894 <entry><type>sql_identifier
</type></entry>
3895 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
3899 <entry><literal>sql_path
</literal></entry>
3900 <entry><type>character_data
</type></entry>
3901 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
3908 <sect1 id=
"infoschema-sequences">
3909 <title><literal>sequences
</literal></title>
3912 The view
<literal>sequences
</literal> contains all sequences
3913 defined in the current database. Only those sequences are shown
3914 that the current user has access to (by way of being the owner or
3915 having some privilege).
3919 <title><literal>sequences
</literal> Columns
</title>
3925 <entry>Data Type
</entry>
3926 <entry>Description
</entry>
3932 <entry><literal>sequence_catalog
</literal></entry>
3933 <entry><type>sql_identifier
</type></entry>
3934 <entry>Name of the database that contains the sequence (always the current database)
</entry>
3938 <entry><literal>sequence_schema
</literal></entry>
3939 <entry><type>sql_identifier
</type></entry>
3940 <entry>Name of the schema that contains the sequence
</entry>
3944 <entry><literal>sequence_name
</literal></entry>
3945 <entry><type>sql_identifier
</type></entry>
3946 <entry>Name of the sequence
</entry>
3950 <entry><literal>data_type
</literal></entry>
3951 <entry><type>character_data
</type></entry>
3953 The data type of the sequence. In
3954 <productname>PostgreSQL
</productname>, this is currently always
3955 <literal>bigint
</literal>.
3960 <entry><literal>numeric_precision
</literal></entry>
3961 <entry><type>cardinal_number
</type></entry>
3963 This column contains the (declared or implicit) precision of
3964 the sequence data type (see above). The precision indicates
3965 the number of significant digits. It can be expressed in
3966 decimal (base
10) or binary (base
2) terms, as specified in the
3967 column
<literal>numeric_precision_radix
</literal>.
3972 <entry><literal>numeric_precision_radix
</literal></entry>
3973 <entry><type>cardinal_number
</type></entry>
3975 This column indicates in which base the values in the columns
3976 <literal>numeric_precision
</literal> and
3977 <literal>numeric_scale
</literal> are expressed. The value is
3983 <entry><literal>numeric_scale
</literal></entry>
3984 <entry><type>cardinal_number
</type></entry>
3986 This column contains the (declared or implicit) scale of the
3987 sequence data type (see above). The scale indicates the number
3988 of significant digits to the right of the decimal point. It
3989 can be expressed in decimal (base
10) or binary (base
2) terms,
3990 as specified in the column
3991 <literal>numeric_precision_radix
</literal>.
3996 <entry><literal>maximum_value
</literal></entry>
3997 <entry><type>cardinal_number
</type></entry>
3998 <entry>Not yet implemented
</entry>
4002 <entry><literal>minimum_value
</literal></entry>
4003 <entry><type>cardinal_number
</type></entry>
4004 <entry>Not yet implemented
</entry>
4008 <entry><literal>increment
</literal></entry>
4009 <entry><type>cardinal_number
</type></entry>
4010 <entry>Not yet implemented
</entry>
4014 <entry><literal>cycle_option
</literal></entry>
4015 <entry><type>character_data
</type></entry>
4016 <entry>Not yet implemented
</entry>
4023 <sect1 id=
"infoschema-sql-features">
4024 <title><literal>sql_features
</literal></title>
4027 The table
<literal>sql_features
</literal> contains information
4028 about which formal features defined in the SQL standard are
4029 supported by
<productname>PostgreSQL
</productname>. This is the
4030 same information that is presented in
<xref linkend=
"features">.
4031 There you can also find some additional background information.
4035 <title><literal>sql_features
</literal> Columns
</title>
4041 <entry>Data Type
</entry>
4042 <entry>Description
</entry>
4048 <entry><literal>feature_id
</literal></entry>
4049 <entry><type>character_data
</type></entry>
4050 <entry>Identifier string of the feature
</entry>
4054 <entry><literal>feature_name
</literal></entry>
4055 <entry><type>character_data
</type></entry>
4056 <entry>Descriptive name of the feature
</entry>
4060 <entry><literal>sub_feature_id
</literal></entry>
4061 <entry><type>character_data
</type></entry>
4062 <entry>Identifier string of the subfeature, or a zero-length string if not a subfeature
</entry>
4066 <entry><literal>sub_feature_name
</literal></entry>
4067 <entry><type>character_data
</type></entry>
4068 <entry>Descriptive name of the subfeature, or a zero-length string if not a subfeature
</entry>
4072 <entry><literal>is_supported
</literal></entry>
4073 <entry><type>character_data
</type></entry>
4075 <literal>YES
</literal> if the feature is fully supported by the
4076 current version of
<productname>PostgreSQL<
/>,
<literal>NO
</literal> if not
4081 <entry><literal>is_verified_by
</literal></entry>
4082 <entry><type>character_data
</type></entry>
4084 Always null, since the
<productname>PostgreSQL<
/> development group does not
4085 perform formal testing of feature conformance
4090 <entry><literal>comments
</literal></entry>
4091 <entry><type>character_data
</type></entry>
4092 <entry>Possibly a comment about the supported status of the feature
</entry>
4099 <sect1 id=
"infoschema-sql-implementation-info">
4100 <title><literal>sql_implementation_info
</literal></title>
4103 The table
<literal>sql_implementation_info
</literal> contains
4104 information about various aspects that are left
4105 implementation-defined by the SQL standard. This information is
4106 primarily intended for use in the context of the ODBC interface;
4107 users of other interfaces will probably find this information to be
4108 of little use. For this reason, the individual implementation
4109 information items are not described here; you will find them in the
4110 description of the ODBC interface.
4114 <title><literal>sql_implementation_info
</literal> Columns
</title>
4120 <entry>Data Type
</entry>
4121 <entry>Description
</entry>
4127 <entry><literal>implementation_info_id
</literal></entry>
4128 <entry><type>character_data
</type></entry>
4129 <entry>Identifier string of the implementation information item
</entry>
4133 <entry><literal>implementation_info_name
</literal></entry>
4134 <entry><type>character_data
</type></entry>
4135 <entry>Descriptive name of the implementation information item
</entry>
4139 <entry><literal>integer_value
</literal></entry>
4140 <entry><type>cardinal_number
</type></entry>
4142 Value of the implementation information item, or null if the
4143 value is contained in the column
4144 <literal>character_value
</literal>
4149 <entry><literal>character_value
</literal></entry>
4150 <entry><type>character_data
</type></entry>
4152 Value of the implementation information item, or null if the
4153 value is contained in the column
4154 <literal>integer_value
</literal>
4159 <entry><literal>comments
</literal></entry>
4160 <entry><type>character_data
</type></entry>
4161 <entry>Possibly a comment pertaining to the implementation information item
</entry>
4168 <sect1 id=
"infoschema-sql-languages">
4169 <title><literal>sql_languages
</literal></title>
4172 The table
<literal>sql_languages
</literal> contains one row for
4173 each SQL language binding that is supported by
4174 <productname>PostgreSQL
</productname>.
4175 <productname>PostgreSQL
</productname> supports direct SQL and
4176 embedded SQL in C; that is all you will learn from this table.
4180 <title><literal>sql_languages
</literal> Columns
</title>
4186 <entry>Data Type
</entry>
4187 <entry>Description
</entry>
4193 <entry><literal>sql_language_source
</literal></entry>
4194 <entry><type>character_data
</type></entry>
4196 The name of the source of the language definition; always
4197 <literal>ISO
9075</literal>, that is, the SQL standard
4202 <entry><literal>sql_language_year
</literal></entry>
4203 <entry><type>character_data
</type></entry>
4205 The year the standard referenced in
4206 <literal>sql_language_source
</literal> was approved; currently
4212 <entry><literal>sql_language_conformance
</literal></entry>
4213 <entry><type>character_data
</type></entry>
4215 The standard conformance level for the language binding. For
4216 ISO
9075:
2003 this is always
<literal>CORE
</literal>.
4221 <entry><literal>sql_language_integrity
</literal></entry>
4222 <entry><type>character_data
</type></entry>
4223 <entry>Always null (This value is relevant to an earlier version of the SQL standard.)
</entry>
4227 <entry><literal>sql_language_implementation
</literal></entry>
4228 <entry><type>character_data
</type></entry>
4229 <entry>Always null
</entry>
4233 <entry><literal>sql_language_binding_style
</literal></entry>
4234 <entry><type>character_data
</type></entry>
4236 The language binding style, either
<literal>DIRECT
</literal> or
4237 <literal>EMBEDDED
</literal>
4242 <entry><literal>sql_language_programming_language
</literal></entry>
4243 <entry><type>character_data
</type></entry>
4245 The programming language, if the binding style is
4246 <literal>EMBEDDED
</literal>, else null.
<productname>PostgreSQL<
/> only
4247 supports the language C.
4255 <sect1 id=
"infoschema-sql-packages">
4256 <title><literal>sql_packages
</literal></title>
4259 The table
<literal>sql_packages
</literal> contains information
4260 about which feature packages defined in the SQL standard are
4261 supported by
<productname>PostgreSQL
</productname>. Refer to
<xref
4262 linkend=
"features"> for background information on feature packages.
4266 <title><literal>sql_packages
</literal> Columns
</title>
4272 <entry>Data Type
</entry>
4273 <entry>Description
</entry>
4279 <entry><literal>feature_id
</literal></entry>
4280 <entry><type>character_data
</type></entry>
4281 <entry>Identifier string of the package
</entry>
4285 <entry><literal>feature_name
</literal></entry>
4286 <entry><type>character_data
</type></entry>
4287 <entry>Descriptive name of the package
</entry>
4291 <entry><literal>is_supported
</literal></entry>
4292 <entry><type>character_data
</type></entry>
4294 <literal>YES
</literal> if the package is fully supported by the
4295 current version of
<productname>PostgreSQL<
/>,
<literal>NO
</literal> if not
4300 <entry><literal>is_verified_by
</literal></entry>
4301 <entry><type>character_data
</type></entry>
4303 Always null, since the
<productname>PostgreSQL<
/> development group does not
4304 perform formal testing of feature conformance
4309 <entry><literal>comments
</literal></entry>
4310 <entry><type>character_data
</type></entry>
4311 <entry>Possibly a comment about the supported status of the package
</entry>
4318 <sect1 id=
"infoschema-sql-parts">
4319 <title><literal>sql_parts
</literal></title>
4322 The table
<literal>sql_parts
</literal> contains information about
4323 which of the several parts of the SQL standard are supported by
4324 <productname>PostgreSQL
</productname>.
4328 <title><literal>sql_parts
</literal> Columns
</title>
4334 <entry>Data Type
</entry>
4335 <entry>Description
</entry>
4341 <entry><literal>feature_id
</literal></entry>
4342 <entry><type>character_data
</type></entry>
4343 <entry>An identifier string containing the number of the part
</entry>
4347 <entry><literal>feature_name
</literal></entry>
4348 <entry><type>character_data
</type></entry>
4349 <entry>Descriptive name of the part
</entry>
4353 <entry><literal>is_supported
</literal></entry>
4354 <entry><type>character_data
</type></entry>
4356 <literal>YES
</literal> if the part is fully supported by the
4357 current version of
<productname>PostgreSQL<
/>,
4358 <literal>NO
</literal> if not
4363 <entry><literal>is_verified_by
</literal></entry>
4364 <entry><type>character_data
</type></entry>
4366 Always null, since the
<productname>PostgreSQL<
/> development group does not
4367 perform formal testing of feature conformance
4372 <entry><literal>comments
</literal></entry>
4373 <entry><type>character_data
</type></entry>
4374 <entry>Possibly a comment about the supported status of the part
</entry>
4381 <sect1 id=
"infoschema-sql-sizing">
4382 <title><literal>sql_sizing
</literal></title>
4385 The table
<literal>sql_sizing
</literal> contains information about
4386 various size limits and maximum values in
4387 <productname>PostgreSQL
</productname>. This information is
4388 primarily intended for use in the context of the ODBC interface;
4389 users of other interfaces will probably find this information to be
4390 of little use. For this reason, the individual sizing items are
4391 not described here; you will find them in the description of the
4396 <title><literal>sql_sizing
</literal> Columns
</title>
4402 <entry>Data Type
</entry>
4403 <entry>Description
</entry>
4409 <entry><literal>sizing_id
</literal></entry>
4410 <entry><type>cardinal_number
</type></entry>
4411 <entry>Identifier of the sizing item
</entry>
4415 <entry><literal>sizing_name
</literal></entry>
4416 <entry><type>character_data
</type></entry>
4417 <entry>Descriptive name of the sizing item
</entry>
4421 <entry><literal>supported_value
</literal></entry>
4422 <entry><type>cardinal_number
</type></entry>
4424 Value of the sizing item, or
0 if the size is unlimited or
4425 cannot be determined, or null if the features for which the
4426 sizing item is applicable are not supported
4431 <entry><literal>comments
</literal></entry>
4432 <entry><type>character_data
</type></entry>
4433 <entry>Possibly a comment pertaining to the sizing item
</entry>
4440 <sect1 id=
"infoschema-sql-sizing-profiles">
4441 <title><literal>sql_sizing_profiles
</literal></title>
4444 The table
<literal>sql_sizing_profiles
</literal> contains
4445 information about the
<literal>sql_sizing
</literal> values that are
4446 required by various profiles of the SQL standard.
<productname>PostgreSQL<
/> does
4447 not track any SQL profiles, so this table is empty.
4451 <title><literal>sql_sizing_profiles
</literal> Columns
</title>
4457 <entry>Data Type
</entry>
4458 <entry>Description
</entry>
4464 <entry><literal>sizing_id
</literal></entry>
4465 <entry><type>cardinal_number
</type></entry>
4466 <entry>Identifier of the sizing item
</entry>
4470 <entry><literal>sizing_name
</literal></entry>
4471 <entry><type>character_data
</type></entry>
4472 <entry>Descriptive name of the sizing item
</entry>
4476 <entry><literal>profile_id
</literal></entry>
4477 <entry><type>character_data
</type></entry>
4478 <entry>Identifier string of a profile
</entry>
4482 <entry><literal>required_value
</literal></entry>
4483 <entry><type>cardinal_number
</type></entry>
4485 The value required by the SQL profile for the sizing item, or
0
4486 if the profile places no limit on the sizing item, or null if
4487 the profile does not require any of the features for which the
4488 sizing item is applicable
4493 <entry><literal>comments
</literal></entry>
4494 <entry><type>character_data
</type></entry>
4495 <entry>Possibly a comment pertaining to the sizing item within the profile
</entry>
4502 <sect1 id=
"infoschema-table-constraints">
4503 <title><literal>table_constraints
</literal></title>
4506 The view
<literal>table_constraints
</literal> contains all
4507 constraints belonging to tables that the current user owns or has
4508 some non-SELECT privilege on.
4512 <title><literal>table_constraints
</literal> Columns
</title>
4518 <entry>Data Type
</entry>
4519 <entry>Description
</entry>
4525 <entry><literal>constraint_catalog
</literal></entry>
4526 <entry><type>sql_identifier
</type></entry>
4527 <entry>Name of the database that contains the constraint (always the current database)
</entry>
4531 <entry><literal>constraint_schema
</literal></entry>
4532 <entry><type>sql_identifier
</type></entry>
4533 <entry>Name of the schema that contains the constraint
</entry>
4537 <entry><literal>constraint_name
</literal></entry>
4538 <entry><type>sql_identifier
</type></entry>
4539 <entry>Name of the constraint
</entry>
4543 <entry><literal>table_catalog
</literal></entry>
4544 <entry><type>sql_identifier
</type></entry>
4545 <entry>Name of the database that contains the table (always the current database)
</entry>
4549 <entry><literal>table_schema
</literal></entry>
4550 <entry><type>sql_identifier
</type></entry>
4551 <entry>Name of the schema that contains the table
</entry>
4555 <entry><literal>table_name
</literal></entry>
4556 <entry><type>sql_identifier
</type></entry>
4557 <entry>Name of the table
</entry>
4561 <entry><literal>constraint_type
</literal></entry>
4562 <entry><type>character_data
</type></entry>
4564 Type of the constraint:
<literal>CHECK
</literal>,
4565 <literal>FOREIGN KEY
</literal>,
<literal>PRIMARY KEY
</literal>,
4566 or
<literal>UNIQUE
</literal>
4571 <entry><literal>is_deferrable
</literal></entry>
4572 <entry><type>character_data
</type></entry>
4573 <entry><literal>YES
</literal> if the constraint is deferrable,
<literal>NO
</literal> if not
</entry>
4577 <entry><literal>initially_deferred
</literal></entry>
4578 <entry><type>character_data
</type></entry>
4579 <entry><literal>YES
</literal> if the constraint is deferrable and initially deferred,
<literal>NO
</literal> if not
</entry>
4586 <sect1 id=
"infoschema-table-privileges">
4587 <title><literal>table_privileges
</literal></title>
4590 The view
<literal>table_privileges
</literal> identifies all
4591 privileges granted on tables or views to a currently enabled role
4592 or by a currently enabled role. There is one row for each
4593 combination of table, grantor, and grantee.
4597 <title><literal>table_privileges
</literal> Columns
</title>
4603 <entry>Data Type
</entry>
4604 <entry>Description
</entry>
4610 <entry><literal>grantor
</literal></entry>
4611 <entry><type>sql_identifier
</type></entry>
4612 <entry>Name of the role that granted the privilege
</entry>
4616 <entry><literal>grantee
</literal></entry>
4617 <entry><type>sql_identifier
</type></entry>
4618 <entry>Name of the role that the privilege was granted to
</entry>
4622 <entry><literal>table_catalog
</literal></entry>
4623 <entry><type>sql_identifier
</type></entry>
4624 <entry>Name of the database that contains the table (always the current database)
</entry>
4628 <entry><literal>table_schema
</literal></entry>
4629 <entry><type>sql_identifier
</type></entry>
4630 <entry>Name of the schema that contains the table
</entry>
4634 <entry><literal>table_name
</literal></entry>
4635 <entry><type>sql_identifier
</type></entry>
4636 <entry>Name of the table
</entry>
4640 <entry><literal>privilege_type
</literal></entry>
4641 <entry><type>character_data
</type></entry>
4643 Type of the privilege:
<literal>SELECT
</literal>,
4644 <literal>INSERT
</literal>,
<literal>UPDATE
</literal>,
4645 <literal>DELETE
</literal>,
<literal>TRUNCATE
</literal>,
4646 <literal>REFERENCES
</literal>, or
<literal>TRIGGER
</literal>
4651 <entry><literal>is_grantable
</literal></entry>
4652 <entry><type>character_data
</type></entry>
4653 <entry><literal>YES
</literal> if the privilege is grantable,
<literal>NO
</literal> if not
</entry>
4657 <entry><literal>with_hierarchy
</literal></entry>
4658 <entry><type>character_data
</type></entry>
4659 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
4666 <sect1 id=
"infoschema-tables">
4667 <title><literal>tables
</literal></title>
4670 The view
<literal>tables
</literal> contains all tables and views
4671 defined in the current database. Only those tables and views are
4672 shown that the current user has access to (by way of being the
4673 owner or having some privilege).
4677 <title><literal>tables
</literal> Columns
</title>
4683 <entry>Data Type
</entry>
4684 <entry>Description
</entry>
4690 <entry><literal>table_catalog
</literal></entry>
4691 <entry><type>sql_identifier
</type></entry>
4692 <entry>Name of the database that contains the table (always the current database)
</entry>
4696 <entry><literal>table_schema
</literal></entry>
4697 <entry><type>sql_identifier
</type></entry>
4698 <entry>Name of the schema that contains the table
</entry>
4702 <entry><literal>table_name
</literal></entry>
4703 <entry><type>sql_identifier
</type></entry>
4704 <entry>Name of the table
</entry>
4708 <entry><literal>table_type
</literal></entry>
4709 <entry><type>character_data
</type></entry>
4711 Type of the table:
<literal>BASE TABLE
</literal> for a
4712 persistent base table (the normal table type),
4713 <literal>VIEW
</literal> for a view, or
<literal>LOCAL
4714 TEMPORARY
</literal> for a temporary table
4719 <entry><literal>self_referencing_column_name
</literal></entry>
4720 <entry><type>sql_identifier
</type></entry>
4721 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
4725 <entry><literal>reference_generation
</literal></entry>
4726 <entry><type>character_data
</type></entry>
4727 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
4731 <entry><literal>user_defined_type_catalog
</literal></entry>
4732 <entry><type>sql_identifier
</type></entry>
4733 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
4737 <entry><literal>user_defined_type_schema
</literal></entry>
4738 <entry><type>sql_identifier
</type></entry>
4739 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
4743 <entry><literal>user_defined_type_name
</literal></entry>
4744 <entry><type>sql_identifier
</type></entry>
4745 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
4749 <entry><literal>is_insertable_into
</literal></entry>
4750 <entry><type>character_data
</type></entry>
4752 <literal>YES
</literal> if the table is insertable into,
4753 <literal>NO
</literal> if not (Base tables are always insertable
4754 into, views not necessarily.)
4759 <entry><literal>is_typed
</literal></entry>
4760 <entry><type>character_data
</type></entry>
4761 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
4765 <entry><literal>commit_action
</literal></entry>
4766 <entry><type>character_data
</type></entry>
4768 If the table is a temporary table, then
4769 <literal>PRESERVE
</literal>, else null. (The SQL standard
4770 defines other commit actions for temporary tables, which are
4771 not supported by
<productname>PostgreSQL<
/>.)
4779 <sect1 id=
"infoschema-triggers">
4780 <title><literal>triggers
</literal></title>
4783 The view
<literal>triggers
</literal> contains all triggers defined
4784 in the current database on tables that the current user owns or has
4785 some non-SELECT privilege on.
4789 <title><literal>triggers
</literal> Columns
</title>
4795 <entry>Data Type
</entry>
4796 <entry>Description
</entry>
4802 <entry><literal>trigger_catalog
</literal></entry>
4803 <entry><type>sql_identifier
</type></entry>
4804 <entry>Name of the database that contains the trigger (always the current database)
</entry>
4808 <entry><literal>trigger_schema
</literal></entry>
4809 <entry><type>sql_identifier
</type></entry>
4810 <entry>Name of the schema that contains the trigger
</entry>
4814 <entry><literal>trigger_name
</literal></entry>
4815 <entry><type>sql_identifier
</type></entry>
4816 <entry>Name of the trigger
</entry>
4820 <entry><literal>event_manipulation
</literal></entry>
4821 <entry><type>character_data
</type></entry>
4823 Event that fires the trigger (
<literal>INSERT
</literal>,
4824 <literal>UPDATE
</literal>, or
<literal>DELETE
</literal>)
4829 <entry><literal>event_object_catalog
</literal></entry>
4830 <entry><type>sql_identifier
</type></entry>
4832 Name of the database that contains the table that the trigger
4833 is defined on (always the current database)
4838 <entry><literal>event_object_schema
</literal></entry>
4839 <entry><type>sql_identifier
</type></entry>
4840 <entry>Name of the schema that contains the table that the trigger is defined on
</entry>
4844 <entry><literal>event_object_table
</literal></entry>
4845 <entry><type>sql_identifier
</type></entry>
4846 <entry>Name of the table that the trigger is defined on
</entry>
4850 <entry><literal>action_order
</literal></entry>
4851 <entry><type>cardinal_number
</type></entry>
4852 <entry>Not yet implemented
</entry>
4856 <entry><literal>action_condition
</literal></entry>
4857 <entry><type>character_data
</type></entry>
4858 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
4862 <entry><literal>action_statement
</literal></entry>
4863 <entry><type>character_data
</type></entry>
4865 Statement that is executed by the trigger (currently always
4866 <literal>EXECUTE PROCEDURE
4867 <replaceable>function
</replaceable>(...)
</literal>)
4872 <entry><literal>action_orientation
</literal></entry>
4873 <entry><type>character_data
</type></entry>
4875 Identifies whether the trigger fires once for each processed
4876 row or once for each statement (
<literal>ROW
</literal> or
4877 <literal>STATEMENT
</literal>)
4882 <entry><literal>condition_timing
</literal></entry>
4883 <entry><type>character_data
</type></entry>
4885 Time at which the trigger fires (
<literal>BEFORE
</literal> or
4886 <literal>AFTER
</literal>)
4891 <entry><literal>condition_reference_old_table
</literal></entry>
4892 <entry><type>sql_identifier
</type></entry>
4893 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
4897 <entry><literal>condition_reference_new_table
</literal></entry>
4898 <entry><type>sql_identifier
</type></entry>
4899 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
4903 <entry><literal>condition_reference_old_row
</literal></entry>
4904 <entry><type>sql_identifier
</type></entry>
4905 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
4909 <entry><literal>condition_reference_new_row
</literal></entry>
4910 <entry><type>sql_identifier
</type></entry>
4911 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
4915 <entry><literal>created
</literal></entry>
4916 <entry><type>time_stamp
</type></entry>
4917 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
4924 Triggers in
<productname>PostgreSQL
</productname> have two
4925 incompatibilities with the SQL standard that affect the
4926 representation in the information schema. First, trigger names are
4927 local to the table in
<productname>PostgreSQL
</productname>, rather
4928 than being independent schema objects. Therefore there can be duplicate
4929 trigger names defined in one schema, as long as they belong to
4930 different tables. (
<literal>trigger_catalog
</literal> and
4931 <literal>trigger_schema
</literal> are really the values pertaining
4932 to the table that the trigger is defined on.) Second, triggers can
4933 be defined to fire on multiple events in
4934 <productname>PostgreSQL
</productname> (e.g.,
<literal>ON INSERT OR
4935 UPDATE
</literal>), whereas the SQL standard only allows one. If a
4936 trigger is defined to fire on multiple events, it is represented as
4937 multiple rows in the information schema, one for each type of
4938 event. As a consequence of these two issues, the primary key of
4939 the view
<literal>triggers
</literal> is really
4940 <literal>(trigger_catalog, trigger_schema, trigger_name,
4941 event_object_table, event_manipulation)
</literal> instead of
4942 <literal>(trigger_catalog, trigger_schema, trigger_name)
</literal>,
4943 which is what the SQL standard specifies. Nonetheless, if you
4944 define your triggers in a manner that conforms with the SQL
4945 standard (trigger names unique in the schema and only one event
4946 type per trigger), this will not affect you.
4950 <sect1 id=
"infoschema-usage-privileges">
4951 <title><literal>usage_privileges
</literal></title>
4954 The view
<literal>usage_privileges
</literal> identifies
4955 <literal>USAGE
</literal> privileges granted on various kinds of
4956 objects to a currently enabled role or by a currently enabled role.
4957 In
<productname>PostgreSQL
</productname>, this currently applies to
4958 domains, foreign-data wrappers, and foreign servers. There is one
4959 row for each combination of object, grantor, and grantee.
4963 Since domains do not have real privileges
4964 in
<productname>PostgreSQL
</productname>, this view shows implicit
4965 non-grantable
<literal>USAGE
</literal> privileges granted by the
4966 owner to
<literal>PUBLIC
</literal> for all domains. The other
4967 object types, however, show real privileges.
4971 <title><literal>usage_privileges
</literal> Columns
</title>
4977 <entry>Data Type
</entry>
4978 <entry>Description
</entry>
4984 <entry><literal>grantor
</literal></entry>
4985 <entry><type>sql_identifier
</type></entry>
4986 <entry>Name of the role that granted the privilege
</entry>
4990 <entry><literal>grantee
</literal></entry>
4991 <entry><type>sql_identifier
</type></entry>
4992 <entry>Name of the role that the privilege was granted to
</entry>
4996 <entry><literal>object_catalog
</literal></entry>
4997 <entry><type>sql_identifier
</type></entry>
4998 <entry>Name of the database containing the object (always the current database)
</entry>
5002 <entry><literal>object_schema
</literal></entry>
5003 <entry><type>sql_identifier
</type></entry>
5004 <entry>Name of the schema containing the object, if applicable,
5005 else an empty string
</entry>
5009 <entry><literal>object_name
</literal></entry>
5010 <entry><type>sql_identifier
</type></entry>
5011 <entry>Name of the object
</entry>
5015 <entry><literal>object_type
</literal></entry>
5016 <entry><type>character_data
</type></entry>
5017 <entry><literal>DOMAIN
</literal> or
<literal>FOREIGN DATA WRAPPER
</literal> or
<literal>FOREIGN SERVER
</literal></entry>
5021 <entry><literal>privilege_type
</literal></entry>
5022 <entry><type>character_data
</type></entry>
5023 <entry>Always
<literal>USAGE
</literal></entry>
5027 <entry><literal>is_grantable
</literal></entry>
5028 <entry><type>character_data
</type></entry>
5029 <entry><literal>YES
</literal> if the privilege is grantable,
<literal>NO
</literal> if not
</entry>
5036 <sect1 id=
"infoschema-user-mapping-options">
5037 <title><literal>user_mapping_options
</literal></title>
5040 The view
<literal>user_mapping_options
</literal> contains all the
5041 options defined for user mappings in the current database. Only
5042 those user mappings are shown where the current user has access to
5043 the corresponding foreign server (by way of being the owner or
5044 having some privilege).
5048 <title><literal>user_mapping_options
</literal> Columns
</title>
5054 <entry>Data Type
</entry>
5055 <entry>Description
</entry>
5061 <entry><literal>authorization_identifier
</literal></entry>
5062 <entry><type>sql_identifier
</type></entry>
5063 <entry>Name of the user being mapped,
5064 or
<literal>PUBLIC
</literal> if the mapping is public
</entry>
5068 <entry><literal>foreign_server_catalog
</literal></entry>
5069 <entry><type>sql_identifier
</type></entry>
5070 <entry>Name of the database that the foreign server used by this
5071 mapping is defined in (always the current database)
</entry>
5075 <entry><literal>foreign_server_name
</literal></entry>
5076 <entry><type>sql_identifier
</type></entry>
5077 <entry>Name of the foreign server used by this mapping
</entry>
5081 <entry><literal>option_name
</literal></entry>
5082 <entry><type>sql_identifier
</type></entry>
5083 <entry>Name of an option
</entry>
5087 <entry><literal>option_value
</literal></entry>
5088 <entry><type>character_data
</type></entry>
5089 <entry>Value of the option. This column will show as null
5090 unless the current user is the user being mapped, or the mapping
5091 is for
<literal>PUBLIC
</literal> and the current user is the
5092 server owner, or the current user is a superuser. The intent is
5093 to protect password information stored as user mapping
5101 <sect1 id=
"infoschema-user-mappings">
5102 <title><literal>user_mappings
</literal></title>
5105 The view
<literal>user_mappings
</literal> contains all user
5106 mappings defined in the current database. Only those user mappings
5107 are shown where the current user has access to the corresponding
5108 foreign server (by way of being the owner or having some
5113 <title><literal>user_mappings
</literal> Columns
</title>
5119 <entry>Data Type
</entry>
5120 <entry>Description
</entry>
5126 <entry><literal>authorization_identifier
</literal></entry>
5127 <entry><type>sql_identifier
</type></entry>
5128 <entry>Name of the user being mapped,
5129 or
<literal>PUBLIC
</literal> if the mapping is public
</entry>
5133 <entry><literal>foreign_server_catalog
</literal></entry>
5134 <entry><type>sql_identifier
</type></entry>
5135 <entry>Name of the database that the foreign server used by this
5136 mapping is defined in (always the current database)
</entry>
5140 <entry><literal>foreign_server_name
</literal></entry>
5141 <entry><type>sql_identifier
</type></entry>
5142 <entry>Name of the foreign server used by this mapping
</entry>
5149 <sect1 id=
"infoschema-view-column-usage">
5150 <title><literal>view_column_usage
</literal></title>
5153 The view
<literal>view_column_usage
</literal> identifies all
5154 columns that are used in the query expression of a view (the
5155 <command>SELECT
</command> statement that defines the view). A
5156 column is only included if the table that contains the column is
5157 owned by a currently enabled role.
5162 Columns of system tables are not included. This should be fixed
5168 <title><literal>view_column_usage
</literal> Columns
</title>
5174 <entry>Data Type
</entry>
5175 <entry>Description
</entry>
5181 <entry><literal>view_catalog
</literal></entry>
5182 <entry><type>sql_identifier
</type></entry>
5183 <entry>Name of the database that contains the view (always the current database)
</entry>
5187 <entry><literal>view_schema
</literal></entry>
5188 <entry><type>sql_identifier
</type></entry>
5189 <entry>Name of the schema that contains the view
</entry>
5193 <entry><literal>view_name
</literal></entry>
5194 <entry><type>sql_identifier
</type></entry>
5195 <entry>Name of the view
</entry>
5199 <entry><literal>table_catalog
</literal></entry>
5200 <entry><type>sql_identifier
</type></entry>
5202 Name of the database that contains the table that contains the
5203 column that is used by the view (always the current database)
5208 <entry><literal>table_schema
</literal></entry>
5209 <entry><type>sql_identifier
</type></entry>
5211 Name of the schema that contains the table that contains the
5212 column that is used by the view
5217 <entry><literal>table_name
</literal></entry>
5218 <entry><type>sql_identifier
</type></entry>
5220 Name of the table that contains the column that is used by the
5226 <entry><literal>column_name
</literal></entry>
5227 <entry><type>sql_identifier
</type></entry>
5228 <entry>Name of the column that is used by the view
</entry>
5235 <sect1 id=
"infoschema-view-routine-usage">
5236 <title><literal>view_routine_usage
</literal></title>
5239 The view
<literal>view_routine_usage
</literal> identifies all
5240 routines (functions and procedures) that are used in the query
5241 expression of a view (the
<command>SELECT
</command> statement that
5242 defines the view). A routine is only included if that routine is
5243 owned by a currently enabled role.
5247 <title><literal>view_routine_usage
</literal> Columns
</title>
5253 <entry>Data Type
</entry>
5254 <entry>Description
</entry>
5260 <entry><literal>table_catalog
</literal></entry>
5261 <entry><literal>sql_identifier
</literal></entry>
5262 <entry>Name of the database containing the view (always the current database)
</entry>
5266 <entry><literal>table_schema
</literal></entry>
5267 <entry><literal>sql_identifier
</literal></entry>
5268 <entry>Name of the schema containing the view
</entry>
5272 <entry><literal>table_name
</literal></entry>
5273 <entry><literal>sql_identifier
</literal></entry>
5274 <entry>Name of the view
</entry>
5278 <entry><literal>specific_catalog
</literal></entry>
5279 <entry><literal>sql_identifier
</literal></entry>
5280 <entry>Name of the database containing the function (always the current database)
</entry>
5284 <entry><literal>specific_schema
</literal></entry>
5285 <entry><literal>sql_identifier
</literal></entry>
5286 <entry>Name of the schema containing the function
</entry>
5290 <entry><literal>specific_name
</literal></entry>
5291 <entry><literal>sql_identifier
</literal></entry>
5293 The
<quote>specific name
</quote> of the function. See
<xref
5294 linkend=
"infoschema-routines"> for more information.
5302 <sect1 id=
"infoschema-view-table-usage">
5303 <title><literal>view_table_usage
</literal></title>
5306 The view
<literal>view_table_usage
</literal> identifies all tables
5307 that are used in the query expression of a view (the
5308 <command>SELECT
</command> statement that defines the view). A
5309 table is only included if that table is owned by a currently
5315 System tables are not included. This should be fixed sometime.
5320 <title><literal>view_table_usage
</literal> Columns
</title>
5326 <entry>Data Type
</entry>
5327 <entry>Description
</entry>
5333 <entry><literal>view_catalog
</literal></entry>
5334 <entry><type>sql_identifier
</type></entry>
5335 <entry>Name of the database that contains the view (always the current database)
</entry>
5339 <entry><literal>view_schema
</literal></entry>
5340 <entry><type>sql_identifier
</type></entry>
5341 <entry>Name of the schema that contains the view
</entry>
5345 <entry><literal>view_name
</literal></entry>
5346 <entry><type>sql_identifier
</type></entry>
5347 <entry>Name of the view
</entry>
5351 <entry><literal>table_catalog
</literal></entry>
5352 <entry><type>sql_identifier
</type></entry>
5354 Name of the database that contains the table that is
5355 used by the view (always the current database)
5360 <entry><literal>table_schema
</literal></entry>
5361 <entry><type>sql_identifier
</type></entry>
5363 Name of the schema that contains the table that is used by the
5369 <entry><literal>table_name
</literal></entry>
5370 <entry><type>sql_identifier
</type></entry>
5372 Name of the table that is used by the view
5380 <sect1 id=
"infoschema-views">
5381 <title><literal>views
</literal></title>
5384 The view
<literal>views
</literal> contains all views defined in the
5385 current database. Only those views are shown that the current user
5386 has access to (by way of being the owner or having some privilege).
5390 <title><literal>views
</literal> Columns
</title>
5396 <entry>Data Type
</entry>
5397 <entry>Description
</entry>
5403 <entry><literal>table_catalog
</literal></entry>
5404 <entry><type>sql_identifier
</type></entry>
5405 <entry>Name of the database that contains the view (always the current database)
</entry>
5409 <entry><literal>table_schema
</literal></entry>
5410 <entry><type>sql_identifier
</type></entry>
5411 <entry>Name of the schema that contains the view
</entry>
5415 <entry><literal>table_name
</literal></entry>
5416 <entry><type>sql_identifier
</type></entry>
5417 <entry>Name of the view
</entry>
5421 <entry><literal>view_definition
</literal></entry>
5422 <entry><type>character_data
</type></entry>
5424 Query expression defining the view (null if the view is not
5425 owned by a currently enabled role)
5430 <entry><literal>check_option
</literal></entry>
5431 <entry><type>character_data
</type></entry>
5432 <entry>Applies to a feature not available in
<productname>PostgreSQL<
/></entry>
5436 <entry><literal>is_updatable
</literal></entry>
5437 <entry><type>character_data
</type></entry>
5439 <literal>YES
</literal> if the view is updatable (allows
5440 <command>UPDATE
</command> and
<command>DELETE
</command>),
5441 <literal>NO
</literal> if not
5446 <entry><literal>is_insertable_into
</literal></entry>
5447 <entry><type>character_data
</type></entry>
5449 <literal>YES
</literal> if the view is insertable into (allows
5450 <command>INSERT
</command>),
<literal>NO
</literal> if not