1 <!-- $PostgreSQL: pgsql/doc/src/sgml/information_schema.sgml,v 1.33 2007/02/20 23:14:19 momjian Exp $ -->
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 (this
347 should not be of concern to
348 <productname>PostgreSQL</productname> users); null for all
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, or
399 interval type, the declared precision; null for all other data
400 types or if no precision was declared.
405 <entry><literal>interval_type</literal></entry>
406 <entry><type>character_data</type></entry>
407 <entry>Not yet implemented</entry>
411 <entry><literal>interval_precision</literal></entry>
412 <entry><type>character_data</type></entry>
413 <entry>Not yet implemented</entry>
417 <entry><literal>attribute_udt_catalog</literal></entry>
418 <entry><type>sql_identifier</type></entry>
420 Name of the database that the attribute data type is defined in
421 (always the current database)
426 <entry><literal>attribute_udt_schema</literal></entry>
427 <entry><type>sql_identifier</type></entry>
429 Name of the schema that the attribute data type is defined in
434 <entry><literal>attribute_udt_name</literal></entry>
435 <entry><type>sql_identifier</type></entry>
437 Name of the attribute data type
442 <entry><literal>scope_catalog</literal></entry>
443 <entry><type>sql_identifier</type></entry>
444 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
448 <entry><literal>scope_schema</literal></entry>
449 <entry><type>sql_identifier</type></entry>
450 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
454 <entry><literal>scope_name</literal></entry>
455 <entry><type>sql_identifier</type></entry>
456 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
460 <entry><literal>maximum_cardinality</literal></entry>
461 <entry><type>cardinal_number</type></entry>
462 <entry>Always null, because arrays always have unlimited maximum cardinality in <productname>PostgreSQL</></entry>
466 <entry><literal>dtd_identifier</literal></entry>
467 <entry><type>sql_identifier</type></entry>
469 An identifier of the data type descriptor of the column, unique
470 among the data type descriptors pertaining to the table. This
471 is mainly useful for joining with other instances of such
472 identifiers. (The specific format of the identifier is not
473 defined and not guaranteed to remain the same in future
479 <entry><literal>is_derived_reference_attribute</literal></entry>
480 <entry><type>character_data</type></entry>
481 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
488 See also under <xref linkend="infoschema-columns">, a similarly
489 structured view, for further information on some of the columns.
493 <sect1 id="infoschema-check-constraint-routine-usage">
494 <title><literal>check_constraint_routine_usage</literal></title>
497 The view <literal>check_constraint_routine_usage</literal>
498 identifies routines (functions and procedures) that are used by a
499 check constraint. Only those routines are shown that are owned by
500 a currently enabled role.
504 <title><literal>check_constraint_routine_usage</literal> Columns</title>
510 <entry>Data Type</entry>
511 <entry>Description</entry>
517 <entry><literal>constraint_catalog</literal></entry>
518 <entry><literal>sql_identifier</literal></entry>
519 <entry>Name of the database containing the constraint (always the current database)</entry>
523 <entry><literal>constraint_schema</literal></entry>
524 <entry><literal>sql_identifier</literal></entry>
525 <entry>Name of the schema containing the constraint</entry>
529 <entry><literal>constraint_name</literal></entry>
530 <entry><literal>sql_identifier</literal></entry>
531 <entry>Name of the constraint</entry>
535 <entry><literal>specific_catalog</literal></entry>
536 <entry><literal>sql_identifier</literal></entry>
537 <entry>Name of the database containing the function (always the current database)</entry>
541 <entry><literal>specific_schema</literal></entry>
542 <entry><literal>sql_identifier</literal></entry>
543 <entry>Name of the schema containing the function</entry>
547 <entry><literal>specific_name</literal></entry>
548 <entry><literal>sql_identifier</literal></entry>
550 The <quote>specific name</quote> of the function. See <xref
551 linkend="infoschema-routines"> for more information.
559 <sect1 id="infoschema-check-constraints">
560 <title><literal>check_constraints</literal></title>
563 The view <literal>check_constraints</literal> contains all check
564 constraints, either defined on a table or on a domain, that are
565 owned by a currently enabled role. (The owner of the table or
566 domain is the owner of the constraint.)
570 <title><literal>check_constraints</literal> Columns</title>
576 <entry>Data Type</entry>
577 <entry>Description</entry>
583 <entry><literal>constraint_catalog</literal></entry>
584 <entry><literal>sql_identifier</literal></entry>
585 <entry>Name of the database containing the constraint (always the current database)</entry>
589 <entry><literal>constraint_schema</literal></entry>
590 <entry><literal>sql_identifier</literal></entry>
591 <entry>Name of the schema containing the constraint</entry>
595 <entry><literal>constraint_name</literal></entry>
596 <entry><literal>sql_identifier</literal></entry>
597 <entry>Name of the constraint</entry>
601 <entry><literal>check_clause</literal></entry>
602 <entry><literal>character_data</literal></entry>
603 <entry>The check expression of the check constraint</entry>
610 <sect1 id="infoschema-column-domain-usage">
611 <title><literal>column_domain_usage</literal></title>
614 The view <literal>column_domain_usage</literal> identifies all
615 columns (of a table or a view) that make use of some domain defined
616 in the current database and owned by a currently enabled role.
620 <title><literal>column_domain_usage</literal> Columns</title>
626 <entry>Data Type</entry>
627 <entry>Description</entry>
633 <entry><literal>domain_catalog</literal></entry>
634 <entry><type>sql_identifier</type></entry>
635 <entry>Name of the database containing the domain (always the current database)</entry>
639 <entry><literal>domain_schema</literal></entry>
640 <entry><type>sql_identifier</type></entry>
641 <entry>Name of the schema containing the domain</entry>
645 <entry><literal>domain_name</literal></entry>
646 <entry><type>sql_identifier</type></entry>
647 <entry>Name of the domain</entry>
651 <entry><literal>table_catalog</literal></entry>
652 <entry><type>sql_identifier</type></entry>
653 <entry>Name of the database containing the table (always the current database)</entry>
657 <entry><literal>table_schema</literal></entry>
658 <entry><type>sql_identifier</type></entry>
659 <entry>Name of the schema containing the table</entry>
663 <entry><literal>table_name</literal></entry>
664 <entry><type>sql_identifier</type></entry>
665 <entry>Name of the table</entry>
669 <entry><literal>column_name</literal></entry>
670 <entry><type>sql_identifier</type></entry>
671 <entry>Name of the column</entry>
678 <sect1 id="infoschema-column-privileges">
679 <title><literal>column_privileges</literal></title>
682 The view <literal>column_privileges</literal> identifies all
683 privileges granted on columns to a currently enabled role or by a
684 currently enabled role. There is one row for each combination of
685 column, grantor, and grantee.
689 In <productname>PostgreSQL</productname>, you can only grant
690 privileges on entire tables, not individual columns. Therefore,
691 this view contains the same information as
692 <literal>table_privileges</literal>, just represented through one
693 row for each column in each appropriate table, but it only covers
694 privilege types where column granularity is possible:
695 <literal>SELECT</literal>, <literal>INSERT</literal>,
696 <literal>UPDATE</literal>, <literal>REFERENCES</literal>. If you
697 want to make your applications fit for possible future
698 developments, it is generally the right choice to use this view
699 instead of <literal>table_privileges</literal> if one of those
700 privilege types is concerned.
704 <title><literal>column_privileges</literal> Columns</title>
710 <entry>Data Type</entry>
711 <entry>Description</entry>
717 <entry><literal>grantor</literal></entry>
718 <entry><type>sql_identifier</type></entry>
719 <entry>Name of the role that granted the privilege</entry>
723 <entry><literal>grantee</literal></entry>
724 <entry><type>sql_identifier</type></entry>
725 <entry>Name of the role that the privilege was granted to</entry>
729 <entry><literal>table_catalog</literal></entry>
730 <entry><type>sql_identifier</type></entry>
731 <entry>Name of the database that contains the table that contains the column (always the current database)</entry>
735 <entry><literal>table_schema</literal></entry>
736 <entry><type>sql_identifier</type></entry>
737 <entry>Name of the schema that contains the table that contains the column</entry>
741 <entry><literal>table_name</literal></entry>
742 <entry><type>sql_identifier</type></entry>
743 <entry>Name of the table that contains the column</entry>
747 <entry><literal>column_name</literal></entry>
748 <entry><type>sql_identifier</type></entry>
749 <entry>Name of the column</entry>
753 <entry><literal>privilege_type</literal></entry>
754 <entry><type>character_data</type></entry>
756 Type of the privilege: <literal>SELECT</literal>,
757 <literal>INSERT</literal>, <literal>UPDATE</literal>, or
758 <literal>REFERENCES</literal>
763 <entry><literal>is_grantable</literal></entry>
764 <entry><type>character_data</type></entry>
765 <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
772 <sect1 id="infoschema-column-udt-usage">
773 <title><literal>column_udt_usage</literal></title>
776 The view <literal>column_udt_usage</literal> identifies all columns
777 that use data types owned by a currently enabled role. Note that in
778 <productname>PostgreSQL</productname>, built-in data types behave
779 like user-defined types, so they are included here as well. See
780 also <xref linkend="infoschema-columns"> for details.
784 <title><literal>column_udt_usage</literal> Columns</title>
790 <entry>Data Type</entry>
791 <entry>Description</entry>
797 <entry><literal>udt_catalog</literal></entry>
798 <entry><type>sql_identifier</type></entry>
800 Name of the database that the column data type (the underlying
801 type of the domain, if applicable) is defined in (always the
807 <entry><literal>udt_schema</literal></entry>
808 <entry><type>sql_identifier</type></entry>
810 Name of the schema that the column data type (the underlying
811 type of the domain, if applicable) is defined in
816 <entry><literal>udt_name</literal></entry>
817 <entry><type>sql_identifier</type></entry>
819 Name of the column data type (the underlying type of the
820 domain, if applicable)
825 <entry><literal>table_catalog</literal></entry>
826 <entry><type>sql_identifier</type></entry>
827 <entry>Name of the database containing the table (always the current database)</entry>
831 <entry><literal>table_schema</literal></entry>
832 <entry><type>sql_identifier</type></entry>
833 <entry>Name of the schema containing the table</entry>
837 <entry><literal>table_name</literal></entry>
838 <entry><type>sql_identifier</type></entry>
839 <entry>Name of the table</entry>
843 <entry><literal>column_name</literal></entry>
844 <entry><type>sql_identifier</type></entry>
845 <entry>Name of the column</entry>
852 <sect1 id="infoschema-columns">
853 <title><literal>columns</literal></title>
856 The view <literal>columns</literal> contains information about all
857 table columns (or view columns) in the database. System columns
858 (<literal>oid</>, etc.) are not included. Only those columns are
859 shown that the current user has access to (by way of being the
860 owner or having some privilege).
864 <title><literal>columns</literal> Columns</title>
870 <entry>Data Type</entry>
871 <entry>Description</entry>
877 <entry><literal>table_catalog</literal></entry>
878 <entry><type>sql_identifier</type></entry>
879 <entry>Name of the database containing the table (always the current database)</entry>
883 <entry><literal>table_schema</literal></entry>
884 <entry><type>sql_identifier</type></entry>
885 <entry>Name of the schema containing the table</entry>
889 <entry><literal>table_name</literal></entry>
890 <entry><type>sql_identifier</type></entry>
891 <entry>Name of the table</entry>
895 <entry><literal>column_name</literal></entry>
896 <entry><type>sql_identifier</type></entry>
897 <entry>Name of the column</entry>
901 <entry><literal>ordinal_position</literal></entry>
902 <entry><type>cardinal_number</type></entry>
903 <entry>Ordinal position of the column within the table (count starts at 1)</entry>
907 <entry><literal>column_default</literal></entry>
908 <entry><type>character_data</type></entry>
909 <entry>Default expression of the column</entry>
913 <entry><literal>is_nullable</literal></entry>
914 <entry><type>character_data</type></entry>
916 <literal>YES</literal> if the column is possibly nullable,
917 <literal>NO</literal> if it is known not nullable. A not-null
918 constraint is one way a column can be known not nullable, but
924 <entry><literal>data_type</literal></entry>
925 <entry><type>character_data</type></entry>
927 Data type of the column, if it is a built-in type, or
928 <literal>ARRAY</literal> if it is some array (in that case, see
929 the view <literal>element_types</literal>), else
930 <literal>USER-DEFINED</literal> (in that case, the type is
931 identified in <literal>udt_name</literal> and associated
932 columns). If the column is based on a domain, this column
933 refers to the type underlying the domain (and the domain is
934 identified in <literal>domain_name</literal> and associated
940 <entry><literal>character_maximum_length</literal></entry>
941 <entry><type>cardinal_number</type></entry>
943 If <literal>data_type</literal> identifies a character or bit
944 string type, the declared maximum length; null for all other
945 data types or if no maximum length was declared.
950 <entry><literal>character_octet_length</literal></entry>
951 <entry><type>cardinal_number</type></entry>
953 If <literal>data_type</literal> identifies a character type,
954 the maximum possible length in octets (bytes) of a datum (this
955 should not be of concern to <productname>PostgreSQL</productname> users); null for all
961 <entry><literal>numeric_precision</literal></entry>
962 <entry><type>cardinal_number</type></entry>
964 If <literal>data_type</literal> identifies a numeric type, this
965 column contains the (declared or implicit) precision of the
966 type for this column. The precision indicates the number of
967 significant digits. It can be expressed in decimal (base 10)
968 or binary (base 2) terms, as specified in the column
969 <literal>numeric_precision_radix</literal>. For all other data
970 types, this column is null.
975 <entry><literal>numeric_precision_radix</literal></entry>
976 <entry><type>cardinal_number</type></entry>
978 If <literal>data_type</literal> identifies a numeric type, this
979 column indicates in which base the values in the columns
980 <literal>numeric_precision</literal> and
981 <literal>numeric_scale</literal> are expressed. The value is
982 either 2 or 10. For all other data types, this column is null.
987 <entry><literal>numeric_scale</literal></entry>
988 <entry><type>cardinal_number</type></entry>
990 If <literal>data_type</literal> identifies an exact numeric
991 type, this column contains the (declared or implicit) scale of
992 the type for this column. The scale indicates the number of
993 significant digits to the right of the decimal point. It can
994 be expressed in decimal (base 10) or binary (base 2) terms, as
995 specified in the column
996 <literal>numeric_precision_radix</literal>. For all other data
997 types, this column is null.
1002 <entry><literal>datetime_precision</literal></entry>
1003 <entry><type>cardinal_number</type></entry>
1005 If <literal>data_type</literal> identifies a date, time, or
1006 interval type, the declared precision; null for all other data
1007 types or if no precision was declared.
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 (this should not be of concern to
1693 <productname>PostgreSQL</productname> users); null for all
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 column.
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 column.
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 the domain has a date, time, or interval type, the declared
1779 precision; null for all other data types or if no precision was
1785 <entry><literal>interval_type</literal></entry>
1786 <entry><type>character_data</type></entry>
1787 <entry>Not yet implemented</entry>
1791 <entry><literal>interval_precision</literal></entry>
1792 <entry><type>character_data</type></entry>
1793 <entry>Not yet implemented</entry>
1797 <entry><literal>domain_default</literal></entry>
1798 <entry><type>character_data</type></entry>
1799 <entry>Default expression of the domain</entry>
1803 <entry><literal>udt_catalog</literal></entry>
1804 <entry><type>sql_identifier</type></entry>
1805 <entry>Name of the database that the domain data type is defined in (always the current database)</entry>
1809 <entry><literal>udt_schema</literal></entry>
1810 <entry><type>sql_identifier</type></entry>
1811 <entry>Name of the schema that the domain data type is defined in</entry>
1815 <entry><literal>udt_name</literal></entry>
1816 <entry><type>sql_identifier</type></entry>
1817 <entry>Name of the domain data type</entry>
1821 <entry><literal>scope_catalog</literal></entry>
1822 <entry><type>sql_identifier</type></entry>
1823 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1827 <entry><literal>scope_schema</literal></entry>
1828 <entry><type>sql_identifier</type></entry>
1829 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1833 <entry><literal>scope_name</literal></entry>
1834 <entry><type>sql_identifier</type></entry>
1835 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1839 <entry><literal>maximum_cardinality</literal></entry>
1840 <entry><type>cardinal_number</type></entry>
1841 <entry>Always null, because arrays always have unlimited maximum cardinality in <productname>PostgreSQL</></entry>
1845 <entry><literal>dtd_identifier</literal></entry>
1846 <entry><type>sql_identifier</type></entry>
1848 An identifier of the data type descriptor of the domain, unique
1849 among the data type descriptors pertaining to the domain (which
1850 is trivial, because a domain only contains one data type
1851 descriptor). This is mainly useful for joining with other
1852 instances of such identifiers. (The specific format of the
1853 identifier is not defined and not guaranteed to remain the same
1854 in future versions.)
1862 <sect1 id="infoschema-element-types">
1863 <title><literal>element_types</literal></title>
1866 The view <literal>element_types</literal> contains the data type
1867 descriptors of the elements of arrays. When a table column,
1868 domain, function parameter, or function return value is defined to
1869 be of an array type, the respective information schema view only
1870 contains <literal>ARRAY</literal> in the column
1871 <literal>data_type</literal>. To obtain information on the element
1872 type of the array, you can join the respective view with this view.
1873 For example, to show the columns of a table with data types and
1874 array element types, if applicable, you could do:
1876 SELECT c.column_name, c.data_type, e.data_type AS element_type
1877 FROM information_schema.columns c LEFT JOIN information_schema.element_types e
1878 ON ((c.table_catalog, c.table_schema, c.table_name, 'TABLE', c.dtd_identifier)
1879 = (e.object_catalog, e.object_schema, e.object_name, e.object_type, e.dtd_identifier))
1880 WHERE c.table_schema = '...' AND c.table_name = '...'
1881 ORDER BY c.ordinal_position;
1883 This view only includes objects that the current user has access
1884 to, by way of being the owner or having some privilege.
1888 <title><literal>element_types</literal> Columns</title>
1894 <entry>Data Type</entry>
1895 <entry>Description</entry>
1901 <entry><literal>object_catalog</literal></entry>
1902 <entry><type>sql_identifier</type></entry>
1904 Name of the database that contains the object that uses the
1905 array being described (always the current database)
1910 <entry><literal>object_schema</literal></entry>
1911 <entry><type>sql_identifier</type></entry>
1913 Name of the schema that contains the object that uses the array
1919 <entry><literal>object_name</literal></entry>
1920 <entry><type>sql_identifier</type></entry>
1922 Name of the object that uses the array being described
1927 <entry><literal>object_type</literal></entry>
1928 <entry><type>character_data</type></entry>
1930 The type of the object that uses the array being described: one
1931 of <literal>TABLE</literal> (the array is used by a column of
1932 that table), <literal>DOMAIN</literal> (the array is used by
1933 that domain), <literal>ROUTINE</literal> (the array is used by
1934 a parameter or the return data type of that function).
1939 <entry><literal>dtd_identifier</literal></entry>
1940 <entry><type>sql_identifier</type></entry>
1942 The identifier of the data type descriptor of the array being
1948 <entry><literal>data_type</literal></entry>
1949 <entry><type>character_data</type></entry>
1951 Data type of the array elements, if it is a built-in type, else
1952 <literal>USER-DEFINED</literal> (in that case, the type is
1953 identified in <literal>udt_name</literal> and associated
1959 <entry><literal>character_maximum_length</literal></entry>
1960 <entry><type>cardinal_number</type></entry>
1961 <entry>Always null, since this information is not applied to array element data types in <productname>PostgreSQL</></entry>
1965 <entry><literal>character_octet_length</literal></entry>
1966 <entry><type>cardinal_number</type></entry>
1967 <entry>Always null, since this information is not applied to array element data types in <productname>PostgreSQL</></entry>
1971 <entry><literal>character_set_catalog</literal></entry>
1972 <entry><type>sql_identifier</type></entry>
1973 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1977 <entry><literal>character_set_schema</literal></entry>
1978 <entry><type>sql_identifier</type></entry>
1979 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1983 <entry><literal>character_set_name</literal></entry>
1984 <entry><type>sql_identifier</type></entry>
1985 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1989 <entry><literal>collation_catalog</literal></entry>
1990 <entry><type>sql_identifier</type></entry>
1991 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1995 <entry><literal>collation_schema</literal></entry>
1996 <entry><type>sql_identifier</type></entry>
1997 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2001 <entry><literal>collation_name</literal></entry>
2002 <entry><type>sql_identifier</type></entry>
2003 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2007 <entry><literal>numeric_precision</literal></entry>
2008 <entry><type>cardinal_number</type></entry>
2009 <entry>Always null, since this information is not applied to array element data types in <productname>PostgreSQL</></entry>
2013 <entry><literal>numeric_precision_radix</literal></entry>
2014 <entry><type>cardinal_number</type></entry>
2015 <entry>Always null, since this information is not applied to array element data types in <productname>PostgreSQL</></entry>
2019 <entry><literal>numeric_scale</literal></entry>
2020 <entry><type>cardinal_number</type></entry>
2021 <entry>Always null, since this information is not applied to array element data types in <productname>PostgreSQL</></entry>
2025 <entry><literal>datetime_precision</literal></entry>
2026 <entry><type>cardinal_number</type></entry>
2027 <entry>Always null, since this information is not applied to array element data types in <productname>PostgreSQL</></entry>
2031 <entry><literal>interval_type</literal></entry>
2032 <entry><type>character_data</type></entry>
2033 <entry>Always null, since this information is not applied to array element data types in <productname>PostgreSQL</></entry>
2037 <entry><literal>interval_precision</literal></entry>
2038 <entry><type>character_data</type></entry>
2039 <entry>Always null, since this information is not applied to array element data types in <productname>PostgreSQL</></entry>
2043 <entry><literal>domain_default</literal></entry>
2044 <entry><type>character_data</type></entry>
2045 <entry>Not yet implemented</entry>
2049 <entry><literal>udt_catalog</literal></entry>
2050 <entry><type>sql_identifier</type></entry>
2052 Name of the database that the data type of the elements is
2053 defined in (always the current database)
2058 <entry><literal>udt_schema</literal></entry>
2059 <entry><type>sql_identifier</type></entry>
2061 Name of the schema that the data type of the elements is
2067 <entry><literal>udt_name</literal></entry>
2068 <entry><type>sql_identifier</type></entry>
2070 Name of the data type of the elements
2075 <entry><literal>scope_catalog</literal></entry>
2076 <entry><type>sql_identifier</type></entry>
2077 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2081 <entry><literal>scope_schema</literal></entry>
2082 <entry><type>sql_identifier</type></entry>
2083 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2087 <entry><literal>scope_name</literal></entry>
2088 <entry><type>sql_identifier</type></entry>
2089 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2093 <entry><literal>maximum_cardinality</literal></entry>
2094 <entry><type>cardinal_number</type></entry>
2095 <entry>Always null, because arrays always have unlimited maximum cardinality in <productname>PostgreSQL</></entry>
2103 <sect1 id="infoschema-enabled-roles">
2104 <title><literal>enabled_roles</literal></title>
2107 The view <literal>enabled_roles</literal> identifies the currently
2108 <quote>enabled roles</quote>. The enabled roles are recursively
2109 defined as the current user together with all roles that have been
2110 granted to the enabled roles with automatic inheritance. In other
2111 words, these are all roles that the current user has direct or
2112 indirect, automatically inheriting membership in.
2113 <indexterm><primary>enabled role</primary></indexterm>
2114 <indexterm><primary>role</primary><secondary>enabled</secondary></indexterm>
2118 For permission checking, the set of <quote>applicable roles</quote>
2119 is applied, which can be broader than the set of enabled roles. So
2120 generally, it is better to use the view
2121 <literal>applicable_roles</literal> instead of this one; see also
2126 <title><literal>enabled_roles</literal> Columns</title>
2132 <entry>Data Type</entry>
2133 <entry>Description</entry>
2139 <entry><literal>role_name</literal></entry>
2140 <entry><type>sql_identifier</type></entry>
2141 <entry>Name of a role</entry>
2148 <sect1 id="infoschema-key-column-usage">
2149 <title><literal>key_column_usage</literal></title>
2152 The view <literal>key_column_usage</literal> identifies all columns
2153 in the current database that are restricted by some unique, primary
2154 key, or foreign key constraint. Check constraints are not included
2155 in this view. Only those columns are shown that the current user
2156 has access to, by way of being the owner or having some privilege.
2160 <title><literal>key_column_usage</literal> Columns</title>
2166 <entry>Data Type</entry>
2167 <entry>Description</entry>
2173 <entry><literal>constraint_catalog</literal></entry>
2174 <entry><type>sql_identifier</type></entry>
2175 <entry>Name of the database that contains the constraint (always the current database)</entry>
2179 <entry><literal>constraint_schema</literal></entry>
2180 <entry><type>sql_identifier</type></entry>
2181 <entry>Name of the schema that contains the constraint</entry>
2185 <entry><literal>constraint_name</literal></entry>
2186 <entry><type>sql_identifier</type></entry>
2187 <entry>Name of the constraint</entry>
2191 <entry><literal>table_catalog</literal></entry>
2192 <entry><type>sql_identifier</type></entry>
2194 Name of the database that contains the table that contains the
2195 column that is restricted by some constraint (always the
2201 <entry><literal>table_schema</literal></entry>
2202 <entry><type>sql_identifier</type></entry>
2204 Name of the schema that contains the table that contains the
2205 column that is restricted by some constraint
2210 <entry><literal>table_name</literal></entry>
2211 <entry><type>sql_identifier</type></entry>
2213 Name of the table that contains the column that is restricted
2219 <entry><literal>column_name</literal></entry>
2220 <entry><type>sql_identifier</type></entry>
2222 Name of the column that is restricted by some constraint
2227 <entry><literal>ordinal_position</literal></entry>
2228 <entry><type>cardinal_number</type></entry>
2230 Ordinal position of the column within the constraint key (count
2236 <entry><literal>position_in_unique_constraint</literal></entry>
2237 <entry><type>cardinal_number</type></entry>
2247 <sect1 id="infoschema-parameters">
2248 <title><literal>parameters</literal></title>
2251 The view <literal>parameters</literal> contains information about
2252 the parameters (arguments) of all functions in the current database.
2253 Only those functions are shown that the current user has access to
2254 (by way of being the owner or having some privilege).
2258 <title><literal>parameters</literal> Columns</title>
2264 <entry>Data Type</entry>
2265 <entry>Description</entry>
2271 <entry><literal>specific_catalog</literal></entry>
2272 <entry><type>sql_identifier</type></entry>
2273 <entry>Name of the database containing the function (always the current database)</entry>
2277 <entry><literal>specific_schema</literal></entry>
2278 <entry><type>sql_identifier</type></entry>
2279 <entry>Name of the schema containing the function</entry>
2283 <entry><literal>specific_name</literal></entry>
2284 <entry><type>sql_identifier</type></entry>
2286 The <quote>specific name</quote> of the function. See <xref
2287 linkend="infoschema-routines"> for more information.
2292 <entry><literal>ordinal_position</literal></entry>
2293 <entry><type>cardinal_number</type></entry>
2295 Ordinal position of the parameter in the argument list of the
2296 function (count starts at 1)
2301 <entry><literal>parameter_mode</literal></entry>
2302 <entry><type>character_data</type></entry>
2304 <literal>IN</literal> for input parameter,
2305 <literal>OUT</literal> for output parameter,
2306 and <literal>INOUT</literal> for input/output parameter.
2311 <entry><literal>is_result</literal></entry>
2312 <entry><type>character_data</type></entry>
2313 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2317 <entry><literal>as_locator</literal></entry>
2318 <entry><type>character_data</type></entry>
2319 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2323 <entry><literal>parameter_name</literal></entry>
2324 <entry><type>sql_identifier</type></entry>
2325 <entry>Name of the parameter, or null if the parameter has no name</entry>
2329 <entry><literal>data_type</literal></entry>
2330 <entry><type>character_data</type></entry>
2332 Data type of the parameter, if it is a built-in type, or
2333 <literal>ARRAY</literal> if it is some array (in that case, see
2334 the view <literal>element_types</literal>), else
2335 <literal>USER-DEFINED</literal> (in that case, the type is
2336 identified in <literal>udt_name</literal> and associated
2342 <entry><literal>character_maximum_length</literal></entry>
2343 <entry><type>cardinal_number</type></entry>
2344 <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</></entry>
2348 <entry><literal>character_octet_length</literal></entry>
2349 <entry><type>cardinal_number</type></entry>
2350 <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</></entry>
2354 <entry><literal>character_set_catalog</literal></entry>
2355 <entry><type>sql_identifier</type></entry>
2356 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2360 <entry><literal>character_set_schema</literal></entry>
2361 <entry><type>sql_identifier</type></entry>
2362 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2366 <entry><literal>character_set_name</literal></entry>
2367 <entry><type>sql_identifier</type></entry>
2368 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2372 <entry><literal>collation_catalog</literal></entry>
2373 <entry><type>sql_identifier</type></entry>
2374 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2378 <entry><literal>collation_schema</literal></entry>
2379 <entry><type>sql_identifier</type></entry>
2380 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2384 <entry><literal>collation_name</literal></entry>
2385 <entry><type>sql_identifier</type></entry>
2386 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2390 <entry><literal>numeric_precision</literal></entry>
2391 <entry><type>cardinal_number</type></entry>
2392 <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</></entry>
2396 <entry><literal>numeric_precision_radix</literal></entry>
2397 <entry><type>cardinal_number</type></entry>
2398 <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</></entry>
2402 <entry><literal>numeric_scale</literal></entry>
2403 <entry><type>cardinal_number</type></entry>
2404 <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</></entry>
2408 <entry><literal>datetime_precision</literal></entry>
2409 <entry><type>cardinal_number</type></entry>
2410 <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</></entry>
2414 <entry><literal>interval_type</literal></entry>
2415 <entry><type>character_data</type></entry>
2416 <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</></entry>
2420 <entry><literal>interval_precision</literal></entry>
2421 <entry><type>character_data</type></entry>
2422 <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</></entry>
2426 <entry><literal>udt_catalog</literal></entry>
2427 <entry><type>sql_identifier</type></entry>
2429 Name of the database that the data type of the parameter is
2430 defined in (always the current database)
2435 <entry><literal>udt_schema</literal></entry>
2436 <entry><type>sql_identifier</type></entry>
2438 Name of the schema that the data type of the parameter is
2444 <entry><literal>udt_name</literal></entry>
2445 <entry><type>sql_identifier</type></entry>
2447 Name of the data type of the parameter
2452 <entry><literal>scope_catalog</literal></entry>
2453 <entry><type>sql_identifier</type></entry>
2454 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2458 <entry><literal>scope_schema</literal></entry>
2459 <entry><type>sql_identifier</type></entry>
2460 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2464 <entry><literal>scope_name</literal></entry>
2465 <entry><type>sql_identifier</type></entry>
2466 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2470 <entry><literal>maximum_cardinality</literal></entry>
2471 <entry><type>cardinal_number</type></entry>
2472 <entry>Always null, because arrays always have unlimited maximum cardinality in <productname>PostgreSQL</></entry>
2476 <entry><literal>dtd_identifier</literal></entry>
2477 <entry><type>sql_identifier</type></entry>
2479 An identifier of the data type descriptor of the parameter,
2480 unique among the data type descriptors pertaining to the
2481 function. This is mainly useful for joining with other
2482 instances of such identifiers. (The specific format of the
2483 identifier is not defined and not guaranteed to remain the same
2484 in future versions.)
2492 <sect1 id="infoschema-referential-constraints">
2493 <title><literal>referential_constraints</literal></title>
2496 The view <literal>referential_constraints</literal> contains all
2497 referential (foreign key) constraints in the current database that
2498 belong to a table owned by a currently enabled role.
2502 <title><literal>referential_constraints</literal> Columns</title>
2508 <entry>Data Type</entry>
2509 <entry>Description</entry>
2515 <entry><literal>constraint_catalog</literal></entry>
2516 <entry><literal>sql_identifier</literal></entry>
2517 <entry>Name of the database containing the constraint (always the current database)</entry>
2521 <entry><literal>constraint_schema</literal></entry>
2522 <entry><literal>sql_identifier</literal></entry>
2523 <entry>Name of the schema containing the constraint</entry>
2527 <entry><literal>constraint_name</literal></entry>
2528 <entry><literal>sql_identifier</literal></entry>
2529 <entry>Name of the constraint</entry>
2533 <entry><literal>unique_constraint_catalog</literal></entry>
2534 <entry><literal>sql_identifier</literal></entry>
2536 Name of the database that contains the unique or primary key
2537 constraint that the foreign key constraint references (always
2538 the current database)
2543 <entry><literal>unique_constraint_schema</literal></entry>
2544 <entry><literal>sql_identifier</literal></entry>
2546 Name of the schema that contains the unique or primary key
2547 constraint that the foreign key constraint references
2552 <entry><literal>unique_constraint_name</literal></entry>
2553 <entry><literal>sql_identifier</literal></entry>
2555 Name of the unique or primary key constraint that the foreign
2556 key constraint references
2561 <entry><literal>match_option</literal></entry>
2562 <entry><literal>character_data</literal></entry>
2564 Match option of the foreign key constraint:
2565 <literal>FULL</literal>, <literal>PARTIAL</literal>, or
2566 <literal>NONE</literal>.
2571 <entry><literal>update_rule</literal></entry>
2572 <entry><literal>character_data</literal></entry>
2574 Update rule of the foreign key constraint:
2575 <literal>CASCADE</literal>, <literal>SET NULL</literal>,
2576 <literal>SET DEFAULT</literal>, <literal>RESTRICT</literal>, or
2577 <literal>NO ACTION</literal>.
2582 <entry><literal>delete_rule</literal></entry>
2583 <entry><literal>character_data</literal></entry>
2585 Delete rule of the foreign key constraint:
2586 <literal>CASCADE</literal>, <literal>SET NULL</literal>,
2587 <literal>SET DEFAULT</literal>, <literal>RESTRICT</literal>, or
2588 <literal>NO ACTION</literal>.
2596 <sect1 id="infoschema-role-column-grants">
2597 <title><literal>role_column_grants</literal></title>
2600 The view <literal>role_column_grants</literal> identifies all
2601 privileges granted on columns where the grantor or grantee is a
2602 currently enabled role. Further information can be found under
2603 <literal>column_privileges</literal>.
2607 <title><literal>role_column_grants</literal> Columns</title>
2613 <entry>Data Type</entry>
2614 <entry>Description</entry>
2620 <entry><literal>grantor</literal></entry>
2621 <entry><type>sql_identifier</type></entry>
2622 <entry>Name of the role that granted the privilege</entry>
2626 <entry><literal>grantee</literal></entry>
2627 <entry><type>sql_identifier</type></entry>
2628 <entry>Name of the role that the privilege was granted to</entry>
2632 <entry><literal>table_catalog</literal></entry>
2633 <entry><type>sql_identifier</type></entry>
2634 <entry>Name of the database that contains the table that contains the column (always the current database)</entry>
2638 <entry><literal>table_schema</literal></entry>
2639 <entry><type>sql_identifier</type></entry>
2640 <entry>Name of the schema that contains the table that contains the column</entry>
2644 <entry><literal>table_name</literal></entry>
2645 <entry><type>sql_identifier</type></entry>
2646 <entry>Name of the table that contains the column</entry>
2650 <entry><literal>column_name</literal></entry>
2651 <entry><type>sql_identifier</type></entry>
2652 <entry>Name of the column</entry>
2656 <entry><literal>privilege_type</literal></entry>
2657 <entry><type>character_data</type></entry>
2659 Type of the privilege: <literal>SELECT</literal>,
2660 <literal>INSERT</literal>, <literal>UPDATE</literal>, or
2661 <literal>REFERENCES</literal>
2666 <entry><literal>is_grantable</literal></entry>
2667 <entry><type>character_data</type></entry>
2668 <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
2675 <sect1 id="infoschema-role-routine-grants">
2676 <title><literal>role_routine_grants</literal></title>
2679 The view <literal>role_routine_grants</literal> identifies all
2680 privileges granted on functions where the grantor or grantee is a
2681 currently enabled role. Further information can be found under
2682 <literal>routine_privileges</literal>.
2686 <title><literal>role_routine_grants</literal> Columns</title>
2692 <entry>Data Type</entry>
2693 <entry>Description</entry>
2699 <entry><literal>grantor</literal></entry>
2700 <entry><type>sql_identifier</type></entry>
2701 <entry>Name of the role that granted the privilege</entry>
2705 <entry><literal>grantee</literal></entry>
2706 <entry><type>sql_identifier</type></entry>
2707 <entry>Name of the role that the privilege was granted to</entry>
2711 <entry><literal>specific_catalog</literal></entry>
2712 <entry><type>sql_identifier</type></entry>
2713 <entry>Name of the database containing the function (always the current database)</entry>
2717 <entry><literal>specific_schema</literal></entry>
2718 <entry><type>sql_identifier</type></entry>
2719 <entry>Name of the schema containing the function</entry>
2723 <entry><literal>specific_name</literal></entry>
2724 <entry><type>sql_identifier</type></entry>
2726 The <quote>specific name</quote> of the function. See <xref
2727 linkend="infoschema-routines"> for more information.
2732 <entry><literal>routine_catalog</literal></entry>
2733 <entry><type>sql_identifier</type></entry>
2734 <entry>Name of the database containing the function (always the current database)</entry>
2738 <entry><literal>routine_schema</literal></entry>
2739 <entry><type>sql_identifier</type></entry>
2740 <entry>Name of the schema containing the function</entry>
2744 <entry><literal>routine_name</literal></entry>
2745 <entry><type>sql_identifier</type></entry>
2746 <entry>Name of the function (might be duplicated in case of overloading)</entry>
2750 <entry><literal>privilege_type</literal></entry>
2751 <entry><type>character_data</type></entry>
2752 <entry>Always <literal>EXECUTE</literal> (the only privilege type for functions)</entry>
2756 <entry><literal>is_grantable</literal></entry>
2757 <entry><type>character_data</type></entry>
2758 <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
2765 <sect1 id="infoschema-role-table-grants">
2766 <title><literal>role_table_grants</literal></title>
2769 The view <literal>role_table_grants</literal> identifies all
2770 privileges granted on tables or views where the grantor or grantee
2771 is a currently enabled role. Further information can be found
2772 under <literal>table_privileges</literal>.
2776 <title><literal>role_table_grants</literal> Columns</title>
2782 <entry>Data Type</entry>
2783 <entry>Description</entry>
2789 <entry><literal>grantor</literal></entry>
2790 <entry><type>sql_identifier</type></entry>
2791 <entry>Name of the role that granted the privilege</entry>
2795 <entry><literal>grantee</literal></entry>
2796 <entry><type>sql_identifier</type></entry>
2797 <entry>Name of the role that the privilege was granted to</entry>
2801 <entry><literal>table_catalog</literal></entry>
2802 <entry><type>sql_identifier</type></entry>
2803 <entry>Name of the database that contains the table (always the current database)</entry>
2807 <entry><literal>table_schema</literal></entry>
2808 <entry><type>sql_identifier</type></entry>
2809 <entry>Name of the schema that contains the table</entry>
2813 <entry><literal>table_name</literal></entry>
2814 <entry><type>sql_identifier</type></entry>
2815 <entry>Name of the table</entry>
2819 <entry><literal>privilege_type</literal></entry>
2820 <entry><type>character_data</type></entry>
2822 Type of the privilege: <literal>SELECT</literal>,
2823 <literal>DELETE</literal>, <literal>INSERT</literal>,
2824 <literal>UPDATE</literal>, <literal>REFERENCES</literal>,
2825 or <literal>TRIGGER</literal>
2830 <entry><literal>is_grantable</literal></entry>
2831 <entry><type>character_data</type></entry>
2832 <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
2836 <entry><literal>with_hierarchy</literal></entry>
2837 <entry><type>character_data</type></entry>
2838 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2845 <sect1 id="infoschema-role-usage-grants">
2846 <title><literal>role_usage_grants</literal></title>
2849 The view <literal>role_usage_grants</literal> is meant to identify
2850 <literal>USAGE</literal> privileges granted on various kinds of
2851 objects to a currently enabled role or by a currently enabled role.
2852 In <productname>PostgreSQL</productname>, this currently only
2853 applies to domains, and since domains do not have real privileges
2854 in <productname>PostgreSQL</productname>, this view is empty.
2855 Further information can be found under
2856 <literal>usage_privileges</literal>. In the future, this view might
2857 contain more useful information.
2861 <title><literal>role_usage_grants</literal> Columns</title>
2867 <entry>Data Type</entry>
2868 <entry>Description</entry>
2874 <entry><literal>grantor</literal></entry>
2875 <entry><type>sql_identifier</type></entry>
2876 <entry>In the future, the name of the role that granted the privilege</entry>
2880 <entry><literal>grantee</literal></entry>
2881 <entry><type>sql_identifier</type></entry>
2882 <entry>In the future, the name of the role that the privilege was granted to</entry>
2886 <entry><literal>object_catalog</literal></entry>
2887 <entry><type>sql_identifier</type></entry>
2888 <entry>Name of the database containing the object (always the current database)</entry>
2892 <entry><literal>object_schema</literal></entry>
2893 <entry><type>sql_identifier</type></entry>
2894 <entry>Name of the schema containing the object</entry>
2898 <entry><literal>object_name</literal></entry>
2899 <entry><type>sql_identifier</type></entry>
2900 <entry>Name of the object</entry>
2904 <entry><literal>object_type</literal></entry>
2905 <entry><type>character_data</type></entry>
2906 <entry>In the future, the type of the object</entry>
2910 <entry><literal>privilege_type</literal></entry>
2911 <entry><type>character_data</type></entry>
2912 <entry>Always <literal>USAGE</literal></entry>
2916 <entry><literal>is_grantable</literal></entry>
2917 <entry><type>character_data</type></entry>
2918 <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
2925 <sect1 id="infoschema-routine-privileges">
2926 <title><literal>routine_privileges</literal></title>
2929 The view <literal>routine_privileges</literal> identifies all
2930 privileges granted to a currently enabled role or by a currently
2931 enabled role. There is one row for each combination of function,
2932 grantor, and grantee.
2936 <title><literal>routine_privileges</literal> Columns</title>
2942 <entry>Data Type</entry>
2943 <entry>Description</entry>
2949 <entry><literal>grantor</literal></entry>
2950 <entry><type>sql_identifier</type></entry>
2951 <entry>Name of the role that granted the privilege</entry>
2955 <entry><literal>grantee</literal></entry>
2956 <entry><type>sql_identifier</type></entry>
2957 <entry>Name of the role that the privilege was granted to</entry>
2961 <entry><literal>specific_catalog</literal></entry>
2962 <entry><type>sql_identifier</type></entry>
2963 <entry>Name of the database containing the function (always the current database)</entry>
2967 <entry><literal>specific_schema</literal></entry>
2968 <entry><type>sql_identifier</type></entry>
2969 <entry>Name of the schema containing the function</entry>
2973 <entry><literal>specific_name</literal></entry>
2974 <entry><type>sql_identifier</type></entry>
2976 The <quote>specific name</quote> of the function. See <xref
2977 linkend="infoschema-routines"> for more information.
2982 <entry><literal>routine_catalog</literal></entry>
2983 <entry><type>sql_identifier</type></entry>
2984 <entry>Name of the database containing the function (always the current database)</entry>
2988 <entry><literal>routine_schema</literal></entry>
2989 <entry><type>sql_identifier</type></entry>
2990 <entry>Name of the schema containing the function</entry>
2994 <entry><literal>routine_name</literal></entry>
2995 <entry><type>sql_identifier</type></entry>
2996 <entry>Name of the function (might be duplicated in case of overloading)</entry>
3000 <entry><literal>privilege_type</literal></entry>
3001 <entry><type>character_data</type></entry>
3002 <entry>Always <literal>EXECUTE</literal> (the only privilege type for functions)</entry>
3006 <entry><literal>is_grantable</literal></entry>
3007 <entry><type>character_data</type></entry>
3008 <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
3015 <sect1 id="infoschema-routines">
3016 <title><literal>routines</literal></title>
3019 The view <literal>routines</literal> contains all functions in the
3020 current database. Only those functions are shown that the current
3021 user has access to (by way of being the owner or having some
3026 <title><literal>routines</literal> Columns</title>
3032 <entry>Data Type</entry>
3033 <entry>Description</entry>
3039 <entry><literal>specific_catalog</literal></entry>
3040 <entry><type>sql_identifier</type></entry>
3041 <entry>Name of the database containing the function (always the current database)</entry>
3045 <entry><literal>specific_schema</literal></entry>
3046 <entry><type>sql_identifier</type></entry>
3047 <entry>Name of the schema containing the function</entry>
3051 <entry><literal>specific_name</literal></entry>
3052 <entry><type>sql_identifier</type></entry>
3054 The <quote>specific name</quote> of the function. This is a
3055 name that uniquely identifies the function in the schema, even
3056 if the real name of the function is overloaded. The format of
3057 the specific name is not defined, it should only be used to
3058 compare it to other instances of specific routine names.
3063 <entry><literal>routine_catalog</literal></entry>
3064 <entry><type>sql_identifier</type></entry>
3065 <entry>Name of the database containing the function (always the current database)</entry>
3069 <entry><literal>routine_schema</literal></entry>
3070 <entry><type>sql_identifier</type></entry>
3071 <entry>Name of the schema containing the function</entry>
3075 <entry><literal>routine_name</literal></entry>
3076 <entry><type>sql_identifier</type></entry>
3077 <entry>Name of the function (might be duplicated in case of overloading)</entry>
3081 <entry><literal>routine_type</literal></entry>
3082 <entry><type>character_data</type></entry>
3084 Always <literal>FUNCTION</literal> (In the future there might
3085 be other types of routines.)
3090 <entry><literal>module_catalog</literal></entry>
3091 <entry><type>sql_identifier</type></entry>
3092 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3096 <entry><literal>module_schema</literal></entry>
3097 <entry><type>sql_identifier</type></entry>
3098 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3102 <entry><literal>module_name</literal></entry>
3103 <entry><type>sql_identifier</type></entry>
3104 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3108 <entry><literal>udt_catalog</literal></entry>
3109 <entry><type>sql_identifier</type></entry>
3110 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3114 <entry><literal>udt_schema</literal></entry>
3115 <entry><type>sql_identifier</type></entry>
3116 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3120 <entry><literal>udt_name</literal></entry>
3121 <entry><type>sql_identifier</type></entry>
3122 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3126 <entry><literal>data_type</literal></entry>
3127 <entry><type>character_data</type></entry>
3129 Return data type of the function, if it is a built-in type, or
3130 <literal>ARRAY</literal> if it is some array (in that case, see
3131 the view <literal>element_types</literal>), else
3132 <literal>USER-DEFINED</literal> (in that case, the type is
3133 identified in <literal>type_udt_name</literal> and associated
3139 <entry><literal>character_maximum_length</literal></entry>
3140 <entry><type>cardinal_number</type></entry>
3141 <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
3145 <entry><literal>character_octet_length</literal></entry>
3146 <entry><type>cardinal_number</type></entry>
3147 <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
3151 <entry><literal>character_set_catalog</literal></entry>
3152 <entry><type>sql_identifier</type></entry>
3153 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3157 <entry><literal>character_set_schema</literal></entry>
3158 <entry><type>sql_identifier</type></entry>
3159 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3163 <entry><literal>character_set_name</literal></entry>
3164 <entry><type>sql_identifier</type></entry>
3165 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3169 <entry><literal>collation_catalog</literal></entry>
3170 <entry><type>sql_identifier</type></entry>
3171 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3175 <entry><literal>collation_schema</literal></entry>
3176 <entry><type>sql_identifier</type></entry>
3177 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3181 <entry><literal>collation_name</literal></entry>
3182 <entry><type>sql_identifier</type></entry>
3183 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3187 <entry><literal>numeric_precision</literal></entry>
3188 <entry><type>cardinal_number</type></entry>
3189 <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
3193 <entry><literal>numeric_precision_radix</literal></entry>
3194 <entry><type>cardinal_number</type></entry>
3195 <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
3199 <entry><literal>numeric_scale</literal></entry>
3200 <entry><type>cardinal_number</type></entry>
3201 <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
3205 <entry><literal>datetime_precision</literal></entry>
3206 <entry><type>cardinal_number</type></entry>
3207 <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
3211 <entry><literal>interval_type</literal></entry>
3212 <entry><type>character_data</type></entry>
3213 <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
3217 <entry><literal>interval_precision</literal></entry>
3218 <entry><type>character_data</type></entry>
3219 <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
3223 <entry><literal>type_udt_catalog</literal></entry>
3224 <entry><type>sql_identifier</type></entry>
3226 Name of the database that the return data type of the function
3227 is defined in (always the current database)
3232 <entry><literal>type_udt_schema</literal></entry>
3233 <entry><type>sql_identifier</type></entry>
3235 Name of the schema that the return data type of the function is
3241 <entry><literal>type_udt_name</literal></entry>
3242 <entry><type>sql_identifier</type></entry>
3244 Name of the return data type of the function
3249 <entry><literal>scope_catalog</literal></entry>
3250 <entry><type>sql_identifier</type></entry>
3251 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3255 <entry><literal>scope_schema</literal></entry>
3256 <entry><type>sql_identifier</type></entry>
3257 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3261 <entry><literal>scope_name</literal></entry>
3262 <entry><type>sql_identifier</type></entry>
3263 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3267 <entry><literal>maximum_cardinality</literal></entry>
3268 <entry><type>cardinal_number</type></entry>
3269 <entry>Always null, because arrays always have unlimited maximum cardinality in <productname>PostgreSQL</></entry>
3273 <entry><literal>dtd_identifier</literal></entry>
3274 <entry><type>sql_identifier</type></entry>
3276 An identifier of the data type descriptor of the return data
3277 type of this function, unique among the data type descriptors
3278 pertaining to the function. This is mainly useful for joining
3279 with other instances of such identifiers. (The specific format
3280 of the identifier is not defined and not guaranteed to remain
3281 the same in future versions.)
3286 <entry><literal>routine_body</literal></entry>
3287 <entry><type>character_data</type></entry>
3289 If the function is an SQL function, then
3290 <literal>SQL</literal>, else <literal>EXTERNAL</literal>.
3295 <entry><literal>routine_definition</literal></entry>
3296 <entry><type>character_data</type></entry>
3298 The source text of the function (null if the function is not
3299 owned by a currently enabled role). (According to the SQL
3300 standard, this column is only applicable if
3301 <literal>routine_body</literal> is <literal>SQL</literal>, but
3302 in <productname>PostgreSQL</productname> it will contain
3303 whatever source text was specified when the function was
3309 <entry><literal>external_name</literal></entry>
3310 <entry><type>character_data</type></entry>
3312 If this function is a C function, then the external name (link
3313 symbol) of the function; else null. (This works out to be the
3314 same value that is shown in
3315 <literal>routine_definition</literal>.)
3320 <entry><literal>external_language</literal></entry>
3321 <entry><type>character_data</type></entry>
3322 <entry>The language the function is written in</entry>
3326 <entry><literal>parameter_style</literal></entry>
3327 <entry><type>character_data</type></entry>
3329 Always <literal>GENERAL</literal> (The SQL standard defines
3330 other parameter styles, which are not available in <productname>PostgreSQL</>.)
3335 <entry><literal>is_deterministic</literal></entry>
3336 <entry><type>character_data</type></entry>
3338 If the function is declared immutable (called deterministic in
3339 the SQL standard), then <literal>YES</literal>, else
3340 <literal>NO</literal>. (You cannot query the other volatility
3341 levels available in <productname>PostgreSQL</> through the information schema.)
3346 <entry><literal>sql_data_access</literal></entry>
3347 <entry><type>character_data</type></entry>
3349 Always <literal>MODIFIES</literal>, meaning that the function
3350 possibly modifies SQL data. This information is not useful for
3351 <productname>PostgreSQL</>.
3356 <entry><literal>is_null_call</literal></entry>
3357 <entry><type>character_data</type></entry>
3359 If the function automatically returns null if any of its
3360 arguments are null, then <literal>YES</literal>, else
3361 <literal>NO</literal>.
3366 <entry><literal>sql_path</literal></entry>
3367 <entry><type>character_data</type></entry>
3368 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3372 <entry><literal>schema_level_routine</literal></entry>
3373 <entry><type>character_data</type></entry>
3375 Always <literal>YES</literal> (The opposite would be a method
3376 of a user-defined type, which is a feature not available in
3377 <productname>PostgreSQL</>.)
3382 <entry><literal>max_dynamic_result_sets</literal></entry>
3383 <entry><type>cardinal_number</type></entry>
3384 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3388 <entry><literal>is_user_defined_cast</literal></entry>
3389 <entry><type>character_data</type></entry>
3390 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3394 <entry><literal>is_implicitly_invocable</literal></entry>
3395 <entry><type>character_data</type></entry>
3396 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3400 <entry><literal>security_type</literal></entry>
3401 <entry><type>character_data</type></entry>
3403 If the function runs with the privileges of the current user,
3404 then <literal>INVOKER</literal>, if the function runs with the
3405 privileges of the user who defined it, then
3406 <literal>DEFINER</literal>.
3411 <entry><literal>to_sql_specific_catalog</literal></entry>
3412 <entry><type>sql_identifier</type></entry>
3413 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3417 <entry><literal>to_sql_specific_schema</literal></entry>
3418 <entry><type>sql_identifier</type></entry>
3419 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3423 <entry><literal>to_sql_specific_name</literal></entry>
3424 <entry><type>sql_identifier</type></entry>
3425 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3429 <entry><literal>as_locator</literal></entry>
3430 <entry><type>character_data</type></entry>
3431 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3435 <entry><literal>created</literal></entry>
3436 <entry><type>time_stamp</type></entry>
3437 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3441 <entry><literal>last_altered</literal></entry>
3442 <entry><type>time_stamp</type></entry>
3443 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3447 <entry><literal>new_savepoint_level</literal></entry>
3448 <entry><type>character_data</type></entry>
3449 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3453 <entry><literal>is_udt_dependent</literal></entry>
3454 <entry><type>character_data</type></entry>
3455 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3459 <entry><literal>result_cast_from_data_type</literal></entry>
3460 <entry><type>character_data</type></entry>
3461 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3465 <entry><literal>result_cast_as_locator</literal></entry>
3466 <entry><type>character_data</type></entry>
3467 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3471 <entry><literal>result_cast_char_max_length</literal></entry>
3472 <entry><type>cardinal_number</type></entry>
3473 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3477 <entry><literal>result_cast_char_octet_length</literal></entry>
3478 <entry><type>character_data</type></entry>
3479 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3483 <entry><literal>result_cast_char_set_catalog</literal></entry>
3484 <entry><type>sql_identifier</type></entry>
3485 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3489 <entry><literal>result_cast_char_set_schema</literal></entry>
3490 <entry><type>sql_identifier</type></entry>
3491 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3495 <entry><literal>result_cast_char_set_name</literal></entry>
3496 <entry><type>sql_identifier</type></entry>
3497 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3501 <entry><literal>result_cast_collation_catalog</literal></entry>
3502 <entry><type>sql_identifier</type></entry>
3503 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3507 <entry><literal>result_cast_collation_schema</literal></entry>
3508 <entry><type>sql_identifier</type></entry>
3509 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3513 <entry><literal>result_cast_collation_name</literal></entry>
3514 <entry><type>sql_identifier</type></entry>
3515 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3519 <entry><literal>result_cast_numeric_precision</literal></entry>
3520 <entry><type>cardinal_number</type></entry>
3521 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3525 <entry><literal>result_cast_numeric_precision_radix</literal></entry>
3526 <entry><type>cardinal_number</type></entry>
3527 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3531 <entry><literal>result_cast_numeric_scale</literal></entry>
3532 <entry><type>cardinal_number</type></entry>
3533 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3537 <entry><literal>result_cast_datetime_precision</literal></entry>
3538 <entry><type>character_data</type></entry>
3539 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3543 <entry><literal>result_cast_interval_type</literal></entry>
3544 <entry><type>character_data</type></entry>
3545 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3549 <entry><literal>result_cast_interval_precision</literal></entry>
3550 <entry><type>character_data</type></entry>
3551 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3555 <entry><literal>result_cast_type_udt_catalog</literal></entry>
3556 <entry><type>sql_identifier</type></entry>
3557 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3561 <entry><literal>result_cast_type_udt_schema</literal></entry>
3562 <entry><type>sql_identifier</type></entry>
3563 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3567 <entry><literal>result_cast_type_udt_name</literal></entry>
3568 <entry><type>sql_identifier</type></entry>
3569 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3573 <entry><literal>result_cast_scope_catalog</literal></entry>
3574 <entry><type>sql_identifier</type></entry>
3575 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3579 <entry><literal>result_cast_scope_schema</literal></entry>
3580 <entry><type>sql_identifier</type></entry>
3581 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3585 <entry><literal>result_cast_scope_name</literal></entry>
3586 <entry><type>sql_identifier</type></entry>
3587 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3591 <entry><literal>result_cast_maximum_cardinality</literal></entry>
3592 <entry><type>cardinal_number</type></entry>
3593 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3597 <entry><literal>result_cast_dtd_identifier</literal></entry>
3598 <entry><type>sql_identifier</type></entry>
3599 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3606 <sect1 id="infoschema-schemata">
3607 <title><literal>schemata</literal></title>
3610 The view <literal>schemata</literal> contains all schemas in the
3611 current database that are owned by a currently enabled role.
3615 <title><literal>schemata</literal> Columns</title>
3621 <entry>Data Type</entry>
3622 <entry>Description</entry>
3628 <entry><literal>catalog_name</literal></entry>
3629 <entry><type>sql_identifier</type></entry>
3630 <entry>Name of the database that the schema is contained in (always the current database)</entry>
3634 <entry><literal>schema_name</literal></entry>
3635 <entry><type>sql_identifier</type></entry>
3636 <entry>Name of the schema</entry>
3640 <entry><literal>schema_owner</literal></entry>
3641 <entry><type>sql_identifier</type></entry>
3642 <entry>Name of the owner of the schema</entry>
3646 <entry><literal>default_character_set_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>default_character_set_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>default_character_set_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>sql_path</literal></entry>
3665 <entry><type>character_data</type></entry>
3666 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3673 <sect1 id="infoschema-sequences">
3674 <title><literal>sequences</literal></title>
3677 The view <literal>sequences</literal> contains all sequences
3678 defined in the current database. Only those sequences are shown
3679 that the current user has access to (by way of being the owner or
3680 having some privilege).
3684 <title><literal>sequences</literal> Columns</title>
3690 <entry>Data Type</entry>
3691 <entry>Description</entry>
3697 <entry><literal>sequence_catalog</literal></entry>
3698 <entry><type>sql_identifier</type></entry>
3699 <entry>Name of the database that contains the sequence (always the current database)</entry>
3703 <entry><literal>sequence_schema</literal></entry>
3704 <entry><type>sql_identifier</type></entry>
3705 <entry>Name of the schema that contains the sequence</entry>
3709 <entry><literal>sequence_name</literal></entry>
3710 <entry><type>sql_identifier</type></entry>
3711 <entry>Name of the sequence</entry>
3715 <entry><literal>data_type</literal></entry>
3716 <entry><type>character_data</type></entry>
3718 The data type of the sequence. In
3719 <productname>PostgreSQL</productname>, this is currently always
3720 <literal>bigint</literal>.
3725 <entry><literal>numeric_precision</literal></entry>
3726 <entry><type>cardinal_number</type></entry>
3728 This column contains the (declared or implicit) precision of
3729 the sequence data type (see above). The precision indicates
3730 the number of significant digits. It can be expressed in
3731 decimal (base 10) or binary (base 2) terms, as specified in the
3732 column <literal>numeric_precision_radix</literal>.
3737 <entry><literal>numeric_precision_radix</literal></entry>
3738 <entry><type>cardinal_number</type></entry>
3740 This column indicates in which base the values in the columns
3741 <literal>numeric_precision</literal> and
3742 <literal>numeric_scale</literal> are expressed. The value is
3748 <entry><literal>numeric_scale</literal></entry>
3749 <entry><type>cardinal_number</type></entry>
3751 This column contains the (declared or implicit) scale of the
3752 sequence data type (see above). The scale indicates the number
3753 of significant digits to the right of the decimal point. It
3754 can be expressed in decimal (base 10) or binary (base 2) terms,
3755 as specified in the column
3756 <literal>numeric_precision_radix</literal>.
3761 <entry><literal>maximum_value</literal></entry>
3762 <entry><type>cardinal_number</type></entry>
3763 <entry>Not yet implemented</entry>
3767 <entry><literal>minimum_value</literal></entry>
3768 <entry><type>cardinal_number</type></entry>
3769 <entry>Not yet implemented</entry>
3773 <entry><literal>increment</literal></entry>
3774 <entry><type>cardinal_number</type></entry>
3775 <entry>Not yet implemented</entry>
3779 <entry><literal>cycle_option</literal></entry>
3780 <entry><type>character_data</type></entry>
3781 <entry>Not yet implemented</entry>
3788 <sect1 id="infoschema-sql-features">
3789 <title><literal>sql_features</literal></title>
3792 The table <literal>sql_features</literal> contains information
3793 about which formal features defined in the SQL standard are
3794 supported by <productname>PostgreSQL</productname>. This is the
3795 same information that is presented in <xref linkend="features">.
3796 There you can also find some additional background information.
3800 <title><literal>sql_features</literal> Columns</title>
3806 <entry>Data Type</entry>
3807 <entry>Description</entry>
3813 <entry><literal>feature_id</literal></entry>
3814 <entry><type>character_data</type></entry>
3815 <entry>Identifier string of the feature</entry>
3819 <entry><literal>feature_name</literal></entry>
3820 <entry><type>character_data</type></entry>
3821 <entry>Descriptive name of the feature</entry>
3825 <entry><literal>sub_feature_id</literal></entry>
3826 <entry><type>character_data</type></entry>
3827 <entry>Identifier string of the subfeature, or a zero-length string if not a subfeature</entry>
3831 <entry><literal>sub_feature_name</literal></entry>
3832 <entry><type>character_data</type></entry>
3833 <entry>Descriptive name of the subfeature, or a zero-length string if not a subfeature</entry>
3837 <entry><literal>is_supported</literal></entry>
3838 <entry><type>character_data</type></entry>
3840 <literal>YES</literal> if the feature is fully supported by the
3841 current version of <productname>PostgreSQL</>, <literal>NO</literal> if not
3846 <entry><literal>is_verified_by</literal></entry>
3847 <entry><type>character_data</type></entry>
3849 Always null, since the <productname>PostgreSQL</> development group does not
3850 perform formal testing of feature conformance
3855 <entry><literal>comments</literal></entry>
3856 <entry><type>character_data</type></entry>
3857 <entry>Possibly a comment about the supported status of the feature</entry>
3864 <sect1 id="infoschema-sql-implementation-info">
3865 <title><literal>sql_implementation_info</literal></title>
3868 The table <literal>sql_implementation_info</literal> contains
3869 information about various aspects that are left
3870 implementation-defined by the SQL standard. This information is
3871 primarily intended for use in the context of the ODBC interface;
3872 users of other interfaces will probably find this information to be
3873 of little use. For this reason, the individual implementation
3874 information items are not described here; you will find them in the
3875 description of the ODBC interface.
3879 <title><literal>sql_implementation_info</literal> Columns</title>
3885 <entry>Data Type</entry>
3886 <entry>Description</entry>
3892 <entry><literal>implementation_info_id</literal></entry>
3893 <entry><type>character_data</type></entry>
3894 <entry>Identifier string of the implementation information item</entry>
3898 <entry><literal>implementation_info_name</literal></entry>
3899 <entry><type>character_data</type></entry>
3900 <entry>Descriptive name of the implementation information item</entry>
3904 <entry><literal>integer_value</literal></entry>
3905 <entry><type>cardinal_number</type></entry>
3907 Value of the implementation information item, or null if the
3908 value is contained in the column
3909 <literal>character_value</literal>
3914 <entry><literal>character_value</literal></entry>
3915 <entry><type>character_data</type></entry>
3917 Value of the implementation information item, or null if the
3918 value is contained in the column
3919 <literal>integer_value</literal>
3924 <entry><literal>comments</literal></entry>
3925 <entry><type>character_data</type></entry>
3926 <entry>Possibly a comment pertaining to the implementation information item</entry>
3933 <sect1 id="infoschema-sql-languages">
3934 <title><literal>sql_languages</literal></title>
3937 The table <literal>sql_languages</literal> contains one row for
3938 each SQL language binding that is supported by
3939 <productname>PostgreSQL</productname>.
3940 <productname>PostgreSQL</productname> supports direct SQL and
3941 embedded SQL in C; that is all you will learn from this table.
3945 <title><literal>sql_languages</literal> Columns</title>
3951 <entry>Data Type</entry>
3952 <entry>Description</entry>
3958 <entry><literal>sql_language_source</literal></entry>
3959 <entry><type>character_data</type></entry>
3961 The name of the source of the language definition; always
3962 <literal>ISO 9075</literal>, that is, the SQL standard
3967 <entry><literal>sql_language_year</literal></entry>
3968 <entry><type>character_data</type></entry>
3970 The year the standard referenced in
3971 <literal>sql_language_source</literal> was approved; currently
3977 <entry><literal>sql_language_conformance</literal></entry>
3978 <entry><type>character_data</type></entry>
3980 The standard conformance level for the language binding. For
3981 ISO 9075:2003 this is always <literal>CORE</literal>.
3986 <entry><literal>sql_language_integrity</literal></entry>
3987 <entry><type>character_data</type></entry>
3988 <entry>Always null (This value is relevant to an earlier version of the SQL standard.)</entry>
3992 <entry><literal>sql_language_implementation</literal></entry>
3993 <entry><type>character_data</type></entry>
3994 <entry>Always null</entry>
3998 <entry><literal>sql_language_binding_style</literal></entry>
3999 <entry><type>character_data</type></entry>
4001 The language binding style, either <literal>DIRECT</literal> or
4002 <literal>EMBEDDED</literal>
4007 <entry><literal>sql_language_programming_language</literal></entry>
4008 <entry><type>character_data</type></entry>
4010 The programming language, if the binding style is
4011 <literal>EMBEDDED</literal>, else null. <productname>PostgreSQL</> only
4012 supports the language C.
4020 <sect1 id="infoschema-sql-packages">
4021 <title><literal>sql_packages</literal></title>
4024 The table <literal>sql_packages</literal> contains information
4025 about which feature packages defined in the SQL standard are
4026 supported by <productname>PostgreSQL</productname>. Refer to <xref
4027 linkend="features"> for background information on feature packages.
4031 <title><literal>sql_packages</literal> Columns</title>
4037 <entry>Data Type</entry>
4038 <entry>Description</entry>
4044 <entry><literal>feature_id</literal></entry>
4045 <entry><type>character_data</type></entry>
4046 <entry>Identifier string of the package</entry>
4050 <entry><literal>feature_name</literal></entry>
4051 <entry><type>character_data</type></entry>
4052 <entry>Descriptive name of the package</entry>
4056 <entry><literal>is_supported</literal></entry>
4057 <entry><type>character_data</type></entry>
4059 <literal>YES</literal> if the package is fully supported by the
4060 current version of <productname>PostgreSQL</>, <literal>NO</literal> if not
4065 <entry><literal>is_verified_by</literal></entry>
4066 <entry><type>character_data</type></entry>
4068 Always null, since the <productname>PostgreSQL</> development group does not
4069 perform formal testing of feature conformance
4074 <entry><literal>comments</literal></entry>
4075 <entry><type>character_data</type></entry>
4076 <entry>Possibly a comment about the supported status of the package</entry>
4083 <sect1 id="infoschema-sql-parts">
4084 <title><literal>sql_parts</literal></title>
4087 The table <literal>sql_parts</literal> contains information about
4088 which of the several parts of the SQL standard are supported by
4089 <productname>PostgreSQL</productname>.
4093 <title><literal>sql_parts</literal> Columns</title>
4099 <entry>Data Type</entry>
4100 <entry>Description</entry>
4106 <entry><literal>feature_id</literal></entry>
4107 <entry><type>character_data</type></entry>
4108 <entry>An identifier string containing the number of the part</entry>
4112 <entry><literal>feature_name</literal></entry>
4113 <entry><type>character_data</type></entry>
4114 <entry>Descriptive name of the part</entry>
4118 <entry><literal>is_supported</literal></entry>
4119 <entry><type>character_data</type></entry>
4121 <literal>YES</literal> if the part is fully supported by the
4122 current version of <productname>PostgreSQL</>,
4123 <literal>NO</literal> if not
4128 <entry><literal>is_verified_by</literal></entry>
4129 <entry><type>character_data</type></entry>
4131 Always null, since the <productname>PostgreSQL</> development group does not
4132 perform formal testing of feature conformance
4137 <entry><literal>comments</literal></entry>
4138 <entry><type>character_data</type></entry>
4139 <entry>Possibly a comment about the supported status of the part</entry>
4146 <sect1 id="infoschema-sql-sizing">
4147 <title><literal>sql_sizing</literal></title>
4150 The table <literal>sql_sizing</literal> contains information about
4151 various size limits and maximum values in
4152 <productname>PostgreSQL</productname>. This information is
4153 primarily intended for use in the context of the ODBC interface;
4154 users of other interfaces will probably find this information to be
4155 of little use. For this reason, the individual sizing items are
4156 not described here; you will find them in the description of the
4161 <title><literal>sql_sizing</literal> Columns</title>
4167 <entry>Data Type</entry>
4168 <entry>Description</entry>
4174 <entry><literal>sizing_id</literal></entry>
4175 <entry><type>cardinal_number</type></entry>
4176 <entry>Identifier of the sizing item</entry>
4180 <entry><literal>sizing_name</literal></entry>
4181 <entry><type>character_data</type></entry>
4182 <entry>Descriptive name of the sizing item</entry>
4186 <entry><literal>supported_value</literal></entry>
4187 <entry><type>cardinal_number</type></entry>
4189 Value of the sizing item, or 0 if the size is unlimited or
4190 cannot be determined, or null if the features for which the
4191 sizing item is applicable are not supported
4196 <entry><literal>comments</literal></entry>
4197 <entry><type>character_data</type></entry>
4198 <entry>Possibly a comment pertaining to the sizing item</entry>
4205 <sect1 id="infoschema-sql-sizing-profiles">
4206 <title><literal>sql_sizing_profiles</literal></title>
4209 The table <literal>sql_sizing_profiles</literal> contains
4210 information about the <literal>sql_sizing</literal> values that are
4211 required by various profiles of the SQL standard. <productname>PostgreSQL</> does
4212 not track any SQL profiles, so this table is empty.
4216 <title><literal>sql_sizing_profiles</literal> Columns</title>
4222 <entry>Data Type</entry>
4223 <entry>Description</entry>
4229 <entry><literal>sizing_id</literal></entry>
4230 <entry><type>cardinal_number</type></entry>
4231 <entry>Identifier of the sizing item</entry>
4235 <entry><literal>sizing_name</literal></entry>
4236 <entry><type>character_data</type></entry>
4237 <entry>Descriptive name of the sizing item</entry>
4241 <entry><literal>profile_id</literal></entry>
4242 <entry><type>character_data</type></entry>
4243 <entry>Identifier string of a profile</entry>
4247 <entry><literal>required_value</literal></entry>
4248 <entry><type>cardinal_number</type></entry>
4250 The value required by the SQL profile for the sizing item, or 0
4251 if the profile places no limit on the sizing item, or null if
4252 the profile does not require any of the features for which the
4253 sizing item is applicable
4258 <entry><literal>comments</literal></entry>
4259 <entry><type>character_data</type></entry>
4260 <entry>Possibly a comment pertaining to the sizing item within the profile</entry>
4267 <sect1 id="infoschema-table-constraints">
4268 <title><literal>table_constraints</literal></title>
4271 The view <literal>table_constraints</literal> contains all
4272 constraints belonging to tables that the current user owns or has
4277 <title><literal>table_constraints</literal> Columns</title>
4283 <entry>Data Type</entry>
4284 <entry>Description</entry>
4290 <entry><literal>constraint_catalog</literal></entry>
4291 <entry><type>sql_identifier</type></entry>
4292 <entry>Name of the database that contains the constraint (always the current database)</entry>
4296 <entry><literal>constraint_schema</literal></entry>
4297 <entry><type>sql_identifier</type></entry>
4298 <entry>Name of the schema that contains the constraint</entry>
4302 <entry><literal>constraint_name</literal></entry>
4303 <entry><type>sql_identifier</type></entry>
4304 <entry>Name of the constraint</entry>
4308 <entry><literal>table_catalog</literal></entry>
4309 <entry><type>sql_identifier</type></entry>
4310 <entry>Name of the database that contains the table (always the current database)</entry>
4314 <entry><literal>table_schema</literal></entry>
4315 <entry><type>sql_identifier</type></entry>
4316 <entry>Name of the schema that contains the table</entry>
4320 <entry><literal>table_name</literal></entry>
4321 <entry><type>sql_identifier</type></entry>
4322 <entry>Name of the table</entry>
4326 <entry><literal>constraint_type</literal></entry>
4327 <entry><type>character_data</type></entry>
4329 Type of the constraint: <literal>CHECK</literal>,
4330 <literal>FOREIGN KEY</literal>, <literal>PRIMARY KEY</literal>,
4331 or <literal>UNIQUE</literal>
4336 <entry><literal>is_deferrable</literal></entry>
4337 <entry><type>character_data</type></entry>
4338 <entry><literal>YES</literal> if the constraint is deferrable, <literal>NO</literal> if not</entry>
4342 <entry><literal>initially_deferred</literal></entry>
4343 <entry><type>character_data</type></entry>
4344 <entry><literal>YES</literal> if the constraint is deferrable and initially deferred, <literal>NO</literal> if not</entry>
4351 <sect1 id="infoschema-table-privileges">
4352 <title><literal>table_privileges</literal></title>
4355 The view <literal>table_privileges</literal> identifies all
4356 privileges granted on tables or views to a currently enabled role
4357 or by a currently enabled role. There is one row for each
4358 combination of table, grantor, and grantee.
4362 <title><literal>table_privileges</literal> Columns</title>
4368 <entry>Data Type</entry>
4369 <entry>Description</entry>
4375 <entry><literal>grantor</literal></entry>
4376 <entry><type>sql_identifier</type></entry>
4377 <entry>Name of the role that granted the privilege</entry>
4381 <entry><literal>grantee</literal></entry>
4382 <entry><type>sql_identifier</type></entry>
4383 <entry>Name of the role that the privilege was granted to</entry>
4387 <entry><literal>table_catalog</literal></entry>
4388 <entry><type>sql_identifier</type></entry>
4389 <entry>Name of the database that contains the table (always the current database)</entry>
4393 <entry><literal>table_schema</literal></entry>
4394 <entry><type>sql_identifier</type></entry>
4395 <entry>Name of the schema that contains the table</entry>
4399 <entry><literal>table_name</literal></entry>
4400 <entry><type>sql_identifier</type></entry>
4401 <entry>Name of the table</entry>
4405 <entry><literal>privilege_type</literal></entry>
4406 <entry><type>character_data</type></entry>
4408 Type of the privilege: <literal>SELECT</literal>,
4409 <literal>DELETE</literal>, <literal>INSERT</literal>,
4410 <literal>UPDATE</literal>, <literal>REFERENCES</literal>,
4411 or <literal>TRIGGER</literal>
4416 <entry><literal>is_grantable</literal></entry>
4417 <entry><type>character_data</type></entry>
4418 <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
4422 <entry><literal>with_hierarchy</literal></entry>
4423 <entry><type>character_data</type></entry>
4424 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4431 <sect1 id="infoschema-tables">
4432 <title><literal>tables</literal></title>
4435 The view <literal>tables</literal> contains all tables and views
4436 defined in the current database. Only those tables and views are
4437 shown that the current user has access to (by way of being the
4438 owner or having some privilege).
4442 <title><literal>tables</literal> Columns</title>
4448 <entry>Data Type</entry>
4449 <entry>Description</entry>
4455 <entry><literal>table_catalog</literal></entry>
4456 <entry><type>sql_identifier</type></entry>
4457 <entry>Name of the database that contains the table (always the current database)</entry>
4461 <entry><literal>table_schema</literal></entry>
4462 <entry><type>sql_identifier</type></entry>
4463 <entry>Name of the schema that contains the table</entry>
4467 <entry><literal>table_name</literal></entry>
4468 <entry><type>sql_identifier</type></entry>
4469 <entry>Name of the table</entry>
4473 <entry><literal>table_type</literal></entry>
4474 <entry><type>character_data</type></entry>
4476 Type of the table: <literal>BASE TABLE</literal> for a
4477 persistent base table (the normal table type),
4478 <literal>VIEW</literal> for a view, or <literal>LOCAL
4479 TEMPORARY</literal> for a temporary table
4484 <entry><literal>self_referencing_column_name</literal></entry>
4485 <entry><type>sql_identifier</type></entry>
4486 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4490 <entry><literal>reference_generation</literal></entry>
4491 <entry><type>character_data</type></entry>
4492 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4496 <entry><literal>user_defined_type_catalog</literal></entry>
4497 <entry><type>sql_identifier</type></entry>
4498 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4502 <entry><literal>user_defined_type_schema</literal></entry>
4503 <entry><type>sql_identifier</type></entry>
4504 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4508 <entry><literal>user_defined_type_name</literal></entry>
4509 <entry><type>sql_identifier</type></entry>
4510 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4514 <entry><literal>is_insertable_into</literal></entry>
4515 <entry><type>character_data</type></entry>
4517 <literal>YES</literal> if the table is insertable into,
4518 <literal>NO</literal> if not (Base tables are always insertable
4519 into, views not necessarily.)
4524 <entry><literal>is_typed</literal></entry>
4525 <entry><type>character_data</type></entry>
4526 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4530 <entry><literal>commit_action</literal></entry>
4531 <entry><type>character_data</type></entry>
4533 If the table is a temporary table, then
4534 <literal>PRESERVE</literal>, else null. (The SQL standard
4535 defines other commit actions for temporary tables, which are
4536 not supported by <productname>PostgreSQL</>.)
4544 <sect1 id="infoschema-triggers">
4545 <title><literal>triggers</literal></title>
4548 The view <literal>triggers</literal> contains all triggers defined
4549 in the current database on tables that the current user owns or has
4554 <title><literal>triggers</literal> Columns</title>
4560 <entry>Data Type</entry>
4561 <entry>Description</entry>
4567 <entry><literal>trigger_catalog</literal></entry>
4568 <entry><type>sql_identifier</type></entry>
4569 <entry>Name of the database that contains the trigger (always the current database)</entry>
4573 <entry><literal>trigger_schema</literal></entry>
4574 <entry><type>sql_identifier</type></entry>
4575 <entry>Name of the schema that contains the trigger</entry>
4579 <entry><literal>trigger_name</literal></entry>
4580 <entry><type>sql_identifier</type></entry>
4581 <entry>Name of the trigger</entry>
4585 <entry><literal>event_manipulation</literal></entry>
4586 <entry><type>character_data</type></entry>
4588 Event that fires the trigger (<literal>INSERT</literal>,
4589 <literal>UPDATE</literal>, or <literal>DELETE</literal>)
4594 <entry><literal>event_object_catalog</literal></entry>
4595 <entry><type>sql_identifier</type></entry>
4597 Name of the database that contains the table that the trigger
4598 is defined on (always the current database)
4603 <entry><literal>event_object_schema</literal></entry>
4604 <entry><type>sql_identifier</type></entry>
4605 <entry>Name of the schema that contains the table that the trigger is defined on</entry>
4609 <entry><literal>event_object_table</literal></entry>
4610 <entry><type>sql_identifier</type></entry>
4611 <entry>Name of the table that the trigger is defined on</entry>
4615 <entry><literal>action_order</literal></entry>
4616 <entry><type>cardinal_number</type></entry>
4617 <entry>Not yet implemented</entry>
4621 <entry><literal>action_condition</literal></entry>
4622 <entry><type>character_data</type></entry>
4623 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4627 <entry><literal>action_statement</literal></entry>
4628 <entry><type>character_data</type></entry>
4630 Statement that is executed by the trigger (currently always
4631 <literal>EXECUTE PROCEDURE
4632 <replaceable>function</replaceable>(...)</literal>)
4637 <entry><literal>action_orientation</literal></entry>
4638 <entry><type>character_data</type></entry>
4640 Identifies whether the trigger fires once for each processed
4641 row or once for each statement (<literal>ROW</literal> or
4642 <literal>STATEMENT</literal>)
4647 <entry><literal>condition_timing</literal></entry>
4648 <entry><type>character_data</type></entry>
4650 Time at which the trigger fires (<literal>BEFORE</literal> or
4651 <literal>AFTER</literal>)
4656 <entry><literal>condition_reference_old_table</literal></entry>
4657 <entry><type>sql_identifier</type></entry>
4658 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4662 <entry><literal>condition_reference_new_table</literal></entry>
4663 <entry><type>sql_identifier</type></entry>
4664 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4668 <entry><literal>condition_reference_old_row</literal></entry>
4669 <entry><type>sql_identifier</type></entry>
4670 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4674 <entry><literal>condition_reference_new_row</literal></entry>
4675 <entry><type>sql_identifier</type></entry>
4676 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4680 <entry><literal>created</literal></entry>
4681 <entry><type>time_stamp</type></entry>
4682 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4689 Triggers in <productname>PostgreSQL</productname> have two
4690 incompatibilities with the SQL standard that affect the
4691 representation in the information schema. First, trigger names are
4692 local to the table in <productname>PostgreSQL</productname>, rather
4693 than being independent schema objects. Therefore there can be duplicate
4694 trigger names defined in one schema, as long as they belong to
4695 different tables. (<literal>trigger_catalog</literal> and
4696 <literal>trigger_schema</literal> are really the values pertaining
4697 to the table that the trigger is defined on.) Second, triggers can
4698 be defined to fire on multiple events in
4699 <productname>PostgreSQL</productname> (e.g., <literal>ON INSERT OR
4700 UPDATE</literal>), whereas the SQL standard only allows one. If a
4701 trigger is defined to fire on multiple events, it is represented as
4702 multiple rows in the information schema, one for each type of
4703 event. As a consequence of these two issues, the primary key of
4704 the view <literal>triggers</literal> is really
4705 <literal>(trigger_catalog, trigger_schema, trigger_name,
4706 event_object_table, event_manipulation)</literal> instead of
4707 <literal>(trigger_catalog, trigger_schema, trigger_name)</literal>,
4708 which is what the SQL standard specifies. Nonetheless, if you
4709 define your triggers in a manner that conforms with the SQL
4710 standard (trigger names unique in the schema and only one event
4711 type per trigger), this will not affect you.
4715 <sect1 id="infoschema-usage-privileges">
4716 <title><literal>usage_privileges</literal></title>
4719 The view <literal>usage_privileges</literal> is meant to identify
4720 <literal>USAGE</literal> privileges granted on various kinds of
4721 objects to a currently enabled role or by a currently enabled role.
4722 In <productname>PostgreSQL</productname>, this currently only
4723 applies to domains, and since domains do not have real privileges
4724 in <productname>PostgreSQL</productname>, this view shows implicit
4725 <literal>USAGE</literal> privileges granted to
4726 <literal>PUBLIC</literal> for all domains. In the future, this
4727 view might contain more useful information.
4731 <title><literal>usage_privileges</literal> Columns</title>
4737 <entry>Data Type</entry>
4738 <entry>Description</entry>
4744 <entry><literal>grantor</literal></entry>
4745 <entry><type>sql_identifier</type></entry>
4746 <entry>Currently set to the name of the owner of the object</entry>
4750 <entry><literal>grantee</literal></entry>
4751 <entry><type>sql_identifier</type></entry>
4752 <entry>Currently always <literal>PUBLIC</literal></entry>
4756 <entry><literal>object_catalog</literal></entry>
4757 <entry><type>sql_identifier</type></entry>
4758 <entry>Name of the database containing the object (always the current database)</entry>
4762 <entry><literal>object_schema</literal></entry>
4763 <entry><type>sql_identifier</type></entry>
4764 <entry>Name of the schema containing the object</entry>
4768 <entry><literal>object_name</literal></entry>
4769 <entry><type>sql_identifier</type></entry>
4770 <entry>Name of the object</entry>
4774 <entry><literal>object_type</literal></entry>
4775 <entry><type>character_data</type></entry>
4776 <entry>Currently always <literal>DOMAIN</literal></entry>
4780 <entry><literal>privilege_type</literal></entry>
4781 <entry><type>character_data</type></entry>
4782 <entry>Always <literal>USAGE</literal></entry>
4786 <entry><literal>is_grantable</literal></entry>
4787 <entry><type>character_data</type></entry>
4788 <entry>Currently always <literal>NO</literal></entry>
4795 <sect1 id="infoschema-view-column-usage">
4796 <title><literal>view_column_usage</literal></title>
4799 The view <literal>view_column_usage</literal> identifies all
4800 columns that are used in the query expression of a view (the
4801 <command>SELECT</command> statement that defines the view). A
4802 column is only included if the table that contains the column is
4803 owned by a currently enabled role.
4808 Columns of system tables are not included. This should be fixed
4814 <title><literal>view_column_usage</literal> Columns</title>
4820 <entry>Data Type</entry>
4821 <entry>Description</entry>
4827 <entry><literal>view_catalog</literal></entry>
4828 <entry><type>sql_identifier</type></entry>
4829 <entry>Name of the database that contains the view (always the current database)</entry>
4833 <entry><literal>view_schema</literal></entry>
4834 <entry><type>sql_identifier</type></entry>
4835 <entry>Name of the schema that contains the view</entry>
4839 <entry><literal>view_name</literal></entry>
4840 <entry><type>sql_identifier</type></entry>
4841 <entry>Name of the view</entry>
4845 <entry><literal>table_catalog</literal></entry>
4846 <entry><type>sql_identifier</type></entry>
4848 Name of the database that contains the table that contains the
4849 column that is used by the view (always the current database)
4854 <entry><literal>table_schema</literal></entry>
4855 <entry><type>sql_identifier</type></entry>
4857 Name of the schema that contains the table that contains the
4858 column that is used by the view
4863 <entry><literal>table_name</literal></entry>
4864 <entry><type>sql_identifier</type></entry>
4866 Name of the table that contains the column that is used by the
4872 <entry><literal>column_name</literal></entry>
4873 <entry><type>sql_identifier</type></entry>
4874 <entry>Name of the column that is used by the view</entry>
4881 <sect1 id="infoschema-view-routine-usage">
4882 <title><literal>view_routine_usage</literal></title>
4885 The view <literal>view_routine_usage</literal> identifies all
4886 routines (functions and procedures) that are used in the query
4887 expression of a view (the <command>SELECT</command> statement that
4888 defines the view). A routine is only included if that routine is
4889 owned by a currently enabled role.
4893 <title><literal>view_routine_usage</literal> Columns</title>
4899 <entry>Data Type</entry>
4900 <entry>Description</entry>
4906 <entry><literal>table_catalog</literal></entry>
4907 <entry><literal>sql_identifier</literal></entry>
4908 <entry>Name of the database containing the view (always the current database)</entry>
4912 <entry><literal>table_schema</literal></entry>
4913 <entry><literal>sql_identifier</literal></entry>
4914 <entry>Name of the schema containing the view</entry>
4918 <entry><literal>table_name</literal></entry>
4919 <entry><literal>sql_identifier</literal></entry>
4920 <entry>Name of the view</entry>
4924 <entry><literal>specific_catalog</literal></entry>
4925 <entry><literal>sql_identifier</literal></entry>
4926 <entry>Name of the database containing the function (always the current database)</entry>
4930 <entry><literal>specific_schema</literal></entry>
4931 <entry><literal>sql_identifier</literal></entry>
4932 <entry>Name of the schema containing the function</entry>
4936 <entry><literal>specific_name</literal></entry>
4937 <entry><literal>sql_identifier</literal></entry>
4939 The <quote>specific name</quote> of the function. See <xref
4940 linkend="infoschema-routines"> for more information.
4948 <sect1 id="infoschema-view-table-usage">
4949 <title><literal>view_table_usage</literal></title>
4952 The view <literal>view_table_usage</literal> identifies all tables
4953 that are used in the query expression of a view (the
4954 <command>SELECT</command> statement that defines the view). A
4955 table is only included if that table is owned by a currently
4961 System tables are not included. This should be fixed sometime.
4966 <title><literal>view_table_usage</literal> Columns</title>
4972 <entry>Data Type</entry>
4973 <entry>Description</entry>
4979 <entry><literal>view_catalog</literal></entry>
4980 <entry><type>sql_identifier</type></entry>
4981 <entry>Name of the database that contains the view (always the current database)</entry>
4985 <entry><literal>view_schema</literal></entry>
4986 <entry><type>sql_identifier</type></entry>
4987 <entry>Name of the schema that contains the view</entry>
4991 <entry><literal>view_name</literal></entry>
4992 <entry><type>sql_identifier</type></entry>
4993 <entry>Name of the view</entry>
4997 <entry><literal>table_catalog</literal></entry>
4998 <entry><type>sql_identifier</type></entry>
5000 Name of the database that contains the table that is
5001 used by the view (always the current database)
5006 <entry><literal>table_schema</literal></entry>
5007 <entry><type>sql_identifier</type></entry>
5009 Name of the schema that contains the table that is used by the
5015 <entry><literal>table_name</literal></entry>
5016 <entry><type>sql_identifier</type></entry>
5018 Name of the table that is used by the view
5026 <sect1 id="infoschema-views">
5027 <title><literal>views</literal></title>
5030 The view <literal>views</literal> contains all views defined in the
5031 current database. Only those views are shown that the current user
5032 has access to (by way of being the owner or having some privilege).
5036 <title><literal>views</literal> Columns</title>
5042 <entry>Data Type</entry>
5043 <entry>Description</entry>
5049 <entry><literal>table_catalog</literal></entry>
5050 <entry><type>sql_identifier</type></entry>
5051 <entry>Name of the database that contains the view (always the current database)</entry>
5055 <entry><literal>table_schema</literal></entry>
5056 <entry><type>sql_identifier</type></entry>
5057 <entry>Name of the schema that contains the view</entry>
5061 <entry><literal>table_name</literal></entry>
5062 <entry><type>sql_identifier</type></entry>
5063 <entry>Name of the view</entry>
5067 <entry><literal>view_definition</literal></entry>
5068 <entry><type>character_data</type></entry>
5070 Query expression defining the view (null if the view is not
5071 owned by a currently enabled role)
5076 <entry><literal>check_option</literal></entry>
5077 <entry><type>character_data</type></entry>
5078 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5082 <entry><literal>is_updatable</literal></entry>
5083 <entry><type>character_data</type></entry>
5085 <literal>YES</literal> if the view is updatable (allows
5086 <command>UPDATE</command> and <command>DELETE</command>),
5087 <literal>NO</literal> if not
5092 <entry><literal>is_insertable_into</literal></entry>
5093 <entry><type>character_data</type></entry>
5095 <literal>YES</literal> if the view is insertable into (allows
5096 <command>INSERT</command>), <literal>NO</literal> if not