1 <!-- $PostgreSQL: pgsql/doc/src/sgml/information_schema.sgml,v 1.41 2009/07/13 20:25:57 petere 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 <term><type>yes_or_no</type></term>
104 A character string domain that contains
105 either <literal>YES</literal> or <literal>NO</literal>. This
106 is used to represent Boolean (true/false) data in the
107 information schema. (The information schema was invented
108 before the type <type>boolean</type> was added to the SQL
109 standard, so this convention is necessary to keep the
110 information schema backward compatible.)
116 Every column in the information schema has one of these five types.
120 <sect1 id="infoschema-information-schema-catalog-name">
121 <title><literal>information_schema_catalog_name</literal></title>
124 <literal>information_schema_catalog_name</literal> is a table that
125 always contains one row and one column containing the name of the
126 current database (current catalog, in SQL terminology).
130 <title><literal>information_schema_catalog_name</literal> Columns</title>
136 <entry>Data Type</entry>
137 <entry>Description</entry>
143 <entry><literal>catalog_name</literal></entry>
144 <entry><type>sql_identifier</type></entry>
145 <entry>Name of the database that contains this information schema</entry>
152 <sect1 id="infoschema-administrable-role-authorizations">
153 <title><literal>administrable_role_authorizations</literal></title>
156 The view <literal>administrable_role_authorizations</literal>
157 identifies all roles that the current user has the admin option
162 <title><literal>administrable_role_authorizations</literal> Columns</title>
168 <entry>Data Type</entry>
169 <entry>Description</entry>
175 <entry><literal>grantee</literal></entry>
176 <entry><type>sql_identifier</type></entry>
178 Name of the role to which this role membership was granted (can
179 be the current user, or a different role in case of nested role
185 <entry><literal>role_name</literal></entry>
186 <entry><type>sql_identifier</type></entry>
187 <entry>Name of a role</entry>
191 <entry><literal>is_grantable</literal></entry>
192 <entry><type>yes_or_no</type></entry>
193 <entry>Always <literal>YES</literal></entry>
200 <sect1 id="infoschema-applicable-roles">
201 <title><literal>applicable_roles</literal></title>
204 The view <literal>applicable_roles</literal> identifies all roles
205 whose privileges the current user can use. This means there is
206 some chain of role grants from the current user to the role in
207 question. The current user itself is also an applicable role. The
208 set of applicable roles is generally used for permission checking.
209 <indexterm><primary>applicable role</primary></indexterm>
210 <indexterm><primary>role</primary><secondary>applicable</secondary></indexterm>
214 <title><literal>applicable_roles</literal> Columns</title>
220 <entry>Data Type</entry>
221 <entry>Description</entry>
227 <entry><literal>grantee</literal></entry>
228 <entry><type>sql_identifier</type></entry>
230 Name of the role to which this role membership was granted (can
231 be the current user, or a different role in case of nested role
237 <entry><literal>role_name</literal></entry>
238 <entry><type>sql_identifier</type></entry>
239 <entry>Name of a role</entry>
243 <entry><literal>is_grantable</literal></entry>
244 <entry><type>yes_or_no</type></entry>
246 <literal>YES</literal> if the grantee has the admin option on
247 the role, <literal>NO</literal> if not
255 <sect1 id="infoschema-attributes">
256 <title><literal>attributes</literal></title>
259 The view <literal>attributes</literal> contains information about
260 the attributes of composite data types defined in the database.
261 (Note that the view does not give information about table columns,
262 which are sometimes called attributes in PostgreSQL contexts.)
266 <title><literal>attributes</literal> Columns</title>
272 <entry>Data Type</entry>
273 <entry>Description</entry>
279 <entry><literal>udt_catalog</literal></entry>
280 <entry><type>sql_identifier</type></entry>
281 <entry>Name of the database containing the data type (always the current database)</entry>
285 <entry><literal>udt_schema</literal></entry>
286 <entry><type>sql_identifier</type></entry>
287 <entry>Name of the schema containing the data type</entry>
291 <entry><literal>udt_name</literal></entry>
292 <entry><type>sql_identifier</type></entry>
293 <entry>Name of the data type</entry>
297 <entry><literal>attribute_name</literal></entry>
298 <entry><type>sql_identifier</type></entry>
299 <entry>Name of the attribute</entry>
303 <entry><literal>ordinal_position</literal></entry>
304 <entry><type>cardinal_number</type></entry>
305 <entry>Ordinal position of the attribute within the data type (count starts at 1)</entry>
309 <entry><literal>attribute_default</literal></entry>
310 <entry><type>character_data</type></entry>
311 <entry>Default expression of the attribute</entry>
315 <entry><literal>is_nullable</literal></entry>
316 <entry><type>yes_or_no</type></entry>
318 <literal>YES</literal> if the attribute is possibly nullable,
319 <literal>NO</literal> if it is known not nullable.
324 <entry><literal>data_type</literal></entry>
325 <entry><type>character_data</type></entry>
327 Data type of the attribute, if it is a built-in type, or
328 <literal>ARRAY</literal> if it is some array (in that case, see
329 the view <literal>element_types</literal>), else
330 <literal>USER-DEFINED</literal> (in that case, the type is
331 identified in <literal>attribute_udt_name</literal> and
337 <entry><literal>character_maximum_length</literal></entry>
338 <entry><type>cardinal_number</type></entry>
340 If <literal>data_type</literal> identifies a character or bit
341 string type, the declared maximum length; null for all other
342 data types or if no maximum length was declared.
347 <entry><literal>character_octet_length</literal></entry>
348 <entry><type>cardinal_number</type></entry>
350 If <literal>data_type</literal> identifies a character type,
351 the maximum possible length in octets (bytes) of a datum; null
352 for all other data types. The maximum octet length depends on
353 the declared character maximum length (see above) and the
359 <entry><literal>numeric_precision</literal></entry>
360 <entry><type>cardinal_number</type></entry>
362 If <literal>data_type</literal> identifies a numeric type, this
363 column contains the (declared or implicit) precision of the
364 type for this attribute. The precision indicates the number of
365 significant digits. It can be expressed in decimal (base 10)
366 or binary (base 2) terms, as specified in the column
367 <literal>numeric_precision_radix</literal>. For all other data
368 types, this column is null.
373 <entry><literal>numeric_precision_radix</literal></entry>
374 <entry><type>cardinal_number</type></entry>
376 If <literal>data_type</literal> identifies a numeric type, this
377 column indicates in which base the values in the columns
378 <literal>numeric_precision</literal> and
379 <literal>numeric_scale</literal> are expressed. The value is
380 either 2 or 10. For all other data types, this column is null.
385 <entry><literal>numeric_scale</literal></entry>
386 <entry><type>cardinal_number</type></entry>
388 If <literal>data_type</literal> identifies an exact numeric
389 type, this column contains the (declared or implicit) scale of
390 the type for this attribute. The scale indicates the number of
391 significant digits to the right of the decimal point. It can
392 be expressed in decimal (base 10) or binary (base 2) terms, as
393 specified in the column
394 <literal>numeric_precision_radix</literal>. For all other data
395 types, this column is null.
400 <entry><literal>datetime_precision</literal></entry>
401 <entry><type>cardinal_number</type></entry>
403 If <literal>data_type</literal> identifies a date, time,
404 timestamp, or interval type, this column contains the (declared
405 or implicit) fractional seconds precision of the type for this
406 attribute, that is, the number of decimal digits maintained
407 following the decimal point in the seconds value. For all
408 other data types, this column is null.
413 <entry><literal>interval_type</literal></entry>
414 <entry><type>character_data</type></entry>
415 <entry>Not yet implemented</entry>
419 <entry><literal>interval_precision</literal></entry>
420 <entry><type>character_data</type></entry>
421 <entry>Not yet implemented</entry>
425 <entry><literal>attribute_udt_catalog</literal></entry>
426 <entry><type>sql_identifier</type></entry>
428 Name of the database that the attribute data type is defined in
429 (always the current database)
434 <entry><literal>attribute_udt_schema</literal></entry>
435 <entry><type>sql_identifier</type></entry>
437 Name of the schema that the attribute data type is defined in
442 <entry><literal>attribute_udt_name</literal></entry>
443 <entry><type>sql_identifier</type></entry>
445 Name of the attribute data type
450 <entry><literal>scope_catalog</literal></entry>
451 <entry><type>sql_identifier</type></entry>
452 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
456 <entry><literal>scope_schema</literal></entry>
457 <entry><type>sql_identifier</type></entry>
458 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
462 <entry><literal>scope_name</literal></entry>
463 <entry><type>sql_identifier</type></entry>
464 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
468 <entry><literal>maximum_cardinality</literal></entry>
469 <entry><type>cardinal_number</type></entry>
470 <entry>Always null, because arrays always have unlimited maximum cardinality in <productname>PostgreSQL</></entry>
474 <entry><literal>dtd_identifier</literal></entry>
475 <entry><type>sql_identifier</type></entry>
477 An identifier of the data type descriptor of the column, unique
478 among the data type descriptors pertaining to the table. This
479 is mainly useful for joining with other instances of such
480 identifiers. (The specific format of the identifier is not
481 defined and not guaranteed to remain the same in future
487 <entry><literal>is_derived_reference_attribute</literal></entry>
488 <entry><type>yes_or_no</type></entry>
489 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
496 See also under <xref linkend="infoschema-columns">, a similarly
497 structured view, for further information on some of the columns.
501 <sect1 id="infoschema-check-constraint-routine-usage">
502 <title><literal>check_constraint_routine_usage</literal></title>
505 The view <literal>check_constraint_routine_usage</literal>
506 identifies routines (functions and procedures) that are used by a
507 check constraint. Only those routines are shown that are owned by
508 a currently enabled role.
512 <title><literal>check_constraint_routine_usage</literal> Columns</title>
518 <entry>Data Type</entry>
519 <entry>Description</entry>
525 <entry><literal>constraint_catalog</literal></entry>
526 <entry><literal>sql_identifier</literal></entry>
527 <entry>Name of the database containing the constraint (always the current database)</entry>
531 <entry><literal>constraint_schema</literal></entry>
532 <entry><literal>sql_identifier</literal></entry>
533 <entry>Name of the schema containing the constraint</entry>
537 <entry><literal>constraint_name</literal></entry>
538 <entry><literal>sql_identifier</literal></entry>
539 <entry>Name of the constraint</entry>
543 <entry><literal>specific_catalog</literal></entry>
544 <entry><literal>sql_identifier</literal></entry>
545 <entry>Name of the database containing the function (always the current database)</entry>
549 <entry><literal>specific_schema</literal></entry>
550 <entry><literal>sql_identifier</literal></entry>
551 <entry>Name of the schema containing the function</entry>
555 <entry><literal>specific_name</literal></entry>
556 <entry><literal>sql_identifier</literal></entry>
558 The <quote>specific name</quote> of the function. See <xref
559 linkend="infoschema-routines"> for more information.
567 <sect1 id="infoschema-check-constraints">
568 <title><literal>check_constraints</literal></title>
571 The view <literal>check_constraints</literal> contains all check
572 constraints, either defined on a table or on a domain, that are
573 owned by a currently enabled role. (The owner of the table or
574 domain is the owner of the constraint.)
578 <title><literal>check_constraints</literal> Columns</title>
584 <entry>Data Type</entry>
585 <entry>Description</entry>
591 <entry><literal>constraint_catalog</literal></entry>
592 <entry><literal>sql_identifier</literal></entry>
593 <entry>Name of the database containing the constraint (always the current database)</entry>
597 <entry><literal>constraint_schema</literal></entry>
598 <entry><literal>sql_identifier</literal></entry>
599 <entry>Name of the schema containing the constraint</entry>
603 <entry><literal>constraint_name</literal></entry>
604 <entry><literal>sql_identifier</literal></entry>
605 <entry>Name of the constraint</entry>
609 <entry><literal>check_clause</literal></entry>
610 <entry><literal>character_data</literal></entry>
611 <entry>The check expression of the check constraint</entry>
618 <sect1 id="infoschema-column-domain-usage">
619 <title><literal>column_domain_usage</literal></title>
622 The view <literal>column_domain_usage</literal> identifies all
623 columns (of a table or a view) that make use of some domain defined
624 in the current database and owned by a currently enabled role.
628 <title><literal>column_domain_usage</literal> Columns</title>
634 <entry>Data Type</entry>
635 <entry>Description</entry>
641 <entry><literal>domain_catalog</literal></entry>
642 <entry><type>sql_identifier</type></entry>
643 <entry>Name of the database containing the domain (always the current database)</entry>
647 <entry><literal>domain_schema</literal></entry>
648 <entry><type>sql_identifier</type></entry>
649 <entry>Name of the schema containing the domain</entry>
653 <entry><literal>domain_name</literal></entry>
654 <entry><type>sql_identifier</type></entry>
655 <entry>Name of the domain</entry>
659 <entry><literal>table_catalog</literal></entry>
660 <entry><type>sql_identifier</type></entry>
661 <entry>Name of the database containing the table (always the current database)</entry>
665 <entry><literal>table_schema</literal></entry>
666 <entry><type>sql_identifier</type></entry>
667 <entry>Name of the schema containing the table</entry>
671 <entry><literal>table_name</literal></entry>
672 <entry><type>sql_identifier</type></entry>
673 <entry>Name of the table</entry>
677 <entry><literal>column_name</literal></entry>
678 <entry><type>sql_identifier</type></entry>
679 <entry>Name of the column</entry>
686 <sect1 id="infoschema-column-privileges">
687 <title><literal>column_privileges</literal></title>
690 The view <literal>column_privileges</literal> identifies all
691 privileges granted on columns to a currently enabled role or by a
692 currently enabled role. There is one row for each combination of
693 column, grantor, and grantee.
697 If a privilege has been granted on an entire table, it will show up in
698 this view as a grant for each column, but only for the
699 privilege types where column granularity is possible:
700 <literal>SELECT</literal>, <literal>INSERT</literal>,
701 <literal>UPDATE</literal>, <literal>REFERENCES</literal>.
705 <title><literal>column_privileges</literal> Columns</title>
711 <entry>Data Type</entry>
712 <entry>Description</entry>
718 <entry><literal>grantor</literal></entry>
719 <entry><type>sql_identifier</type></entry>
720 <entry>Name of the role that granted the privilege</entry>
724 <entry><literal>grantee</literal></entry>
725 <entry><type>sql_identifier</type></entry>
726 <entry>Name of the role that the privilege was granted to</entry>
730 <entry><literal>table_catalog</literal></entry>
731 <entry><type>sql_identifier</type></entry>
732 <entry>Name of the database that contains the table that contains the column (always the current database)</entry>
736 <entry><literal>table_schema</literal></entry>
737 <entry><type>sql_identifier</type></entry>
738 <entry>Name of the schema that contains the table that contains the column</entry>
742 <entry><literal>table_name</literal></entry>
743 <entry><type>sql_identifier</type></entry>
744 <entry>Name of the table that contains the column</entry>
748 <entry><literal>column_name</literal></entry>
749 <entry><type>sql_identifier</type></entry>
750 <entry>Name of the column</entry>
754 <entry><literal>privilege_type</literal></entry>
755 <entry><type>character_data</type></entry>
757 Type of the privilege: <literal>SELECT</literal>,
758 <literal>INSERT</literal>, <literal>UPDATE</literal>, or
759 <literal>REFERENCES</literal>
764 <entry><literal>is_grantable</literal></entry>
765 <entry><type>yes_or_no</type></entry>
766 <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
773 <sect1 id="infoschema-column-udt-usage">
774 <title><literal>column_udt_usage</literal></title>
777 The view <literal>column_udt_usage</literal> identifies all columns
778 that use data types owned by a currently enabled role. Note that in
779 <productname>PostgreSQL</productname>, built-in data types behave
780 like user-defined types, so they are included here as well. See
781 also <xref linkend="infoschema-columns"> for details.
785 <title><literal>column_udt_usage</literal> Columns</title>
791 <entry>Data Type</entry>
792 <entry>Description</entry>
798 <entry><literal>udt_catalog</literal></entry>
799 <entry><type>sql_identifier</type></entry>
801 Name of the database that the column data type (the underlying
802 type of the domain, if applicable) is defined in (always the
808 <entry><literal>udt_schema</literal></entry>
809 <entry><type>sql_identifier</type></entry>
811 Name of the schema that the column data type (the underlying
812 type of the domain, if applicable) is defined in
817 <entry><literal>udt_name</literal></entry>
818 <entry><type>sql_identifier</type></entry>
820 Name of the column data type (the underlying type of the
821 domain, if applicable)
826 <entry><literal>table_catalog</literal></entry>
827 <entry><type>sql_identifier</type></entry>
828 <entry>Name of the database containing the table (always the current database)</entry>
832 <entry><literal>table_schema</literal></entry>
833 <entry><type>sql_identifier</type></entry>
834 <entry>Name of the schema containing the table</entry>
838 <entry><literal>table_name</literal></entry>
839 <entry><type>sql_identifier</type></entry>
840 <entry>Name of the table</entry>
844 <entry><literal>column_name</literal></entry>
845 <entry><type>sql_identifier</type></entry>
846 <entry>Name of the column</entry>
853 <sect1 id="infoschema-columns">
854 <title><literal>columns</literal></title>
857 The view <literal>columns</literal> contains information about all
858 table columns (or view columns) in the database. System columns
859 (<literal>oid</>, etc.) are not included. Only those columns are
860 shown that the current user has access to (by way of being the
861 owner or having some privilege).
865 <title><literal>columns</literal> Columns</title>
871 <entry>Data Type</entry>
872 <entry>Description</entry>
878 <entry><literal>table_catalog</literal></entry>
879 <entry><type>sql_identifier</type></entry>
880 <entry>Name of the database containing the table (always the current database)</entry>
884 <entry><literal>table_schema</literal></entry>
885 <entry><type>sql_identifier</type></entry>
886 <entry>Name of the schema containing the table</entry>
890 <entry><literal>table_name</literal></entry>
891 <entry><type>sql_identifier</type></entry>
892 <entry>Name of the table</entry>
896 <entry><literal>column_name</literal></entry>
897 <entry><type>sql_identifier</type></entry>
898 <entry>Name of the column</entry>
902 <entry><literal>ordinal_position</literal></entry>
903 <entry><type>cardinal_number</type></entry>
904 <entry>Ordinal position of the column within the table (count starts at 1)</entry>
908 <entry><literal>column_default</literal></entry>
909 <entry><type>character_data</type></entry>
910 <entry>Default expression of the column</entry>
914 <entry><literal>is_nullable</literal></entry>
915 <entry><type>yes_or_no</type></entry>
917 <literal>YES</literal> if the column is possibly nullable,
918 <literal>NO</literal> if it is known not nullable. A not-null
919 constraint is one way a column can be known not nullable, but
925 <entry><literal>data_type</literal></entry>
926 <entry><type>character_data</type></entry>
928 Data type of the column, if it is a built-in type, or
929 <literal>ARRAY</literal> if it is some array (in that case, see
930 the view <literal>element_types</literal>), else
931 <literal>USER-DEFINED</literal> (in that case, the type is
932 identified in <literal>udt_name</literal> and associated
933 columns). If the column is based on a domain, this column
934 refers to the type underlying the domain (and the domain is
935 identified in <literal>domain_name</literal> and associated
941 <entry><literal>character_maximum_length</literal></entry>
942 <entry><type>cardinal_number</type></entry>
944 If <literal>data_type</literal> identifies a character or bit
945 string type, the declared maximum length; null for all other
946 data types or if no maximum length was declared.
951 <entry><literal>character_octet_length</literal></entry>
952 <entry><type>cardinal_number</type></entry>
954 If <literal>data_type</literal> identifies a character type,
955 the maximum possible length in octets (bytes) of a datum; null
956 for all other data types. The maximum octet length depends on
957 the declared character maximum length (see above) and the
963 <entry><literal>numeric_precision</literal></entry>
964 <entry><type>cardinal_number</type></entry>
966 If <literal>data_type</literal> identifies a numeric type, this
967 column contains the (declared or implicit) precision of the
968 type for this column. The precision indicates the number of
969 significant digits. It can be expressed in decimal (base 10)
970 or binary (base 2) terms, as specified in the column
971 <literal>numeric_precision_radix</literal>. For all other data
972 types, this column is null.
977 <entry><literal>numeric_precision_radix</literal></entry>
978 <entry><type>cardinal_number</type></entry>
980 If <literal>data_type</literal> identifies a numeric type, this
981 column indicates in which base the values in the columns
982 <literal>numeric_precision</literal> and
983 <literal>numeric_scale</literal> are expressed. The value is
984 either 2 or 10. For all other data types, this column is null.
989 <entry><literal>numeric_scale</literal></entry>
990 <entry><type>cardinal_number</type></entry>
992 If <literal>data_type</literal> identifies an exact numeric
993 type, this column contains the (declared or implicit) scale of
994 the type for this column. The scale indicates the number of
995 significant digits to the right of the decimal point. It can
996 be expressed in decimal (base 10) or binary (base 2) terms, as
997 specified in the column
998 <literal>numeric_precision_radix</literal>. For all other data
999 types, this column is null.
1004 <entry><literal>datetime_precision</literal></entry>
1005 <entry><type>cardinal_number</type></entry>
1007 If <literal>data_type</literal> identifies a date, time,
1008 timestamp, or interval type, this column contains the (declared
1009 or implicit) fractional seconds precision of the type for this
1010 column, that is, the number of decimal digits maintained
1011 following the decimal point in the seconds value. For all
1012 other data types, this column is null.
1017 <entry><literal>interval_type</literal></entry>
1018 <entry><type>character_data</type></entry>
1019 <entry>Not yet implemented</entry>
1023 <entry><literal>interval_precision</literal></entry>
1024 <entry><type>character_data</type></entry>
1025 <entry>Not yet implemented</entry>
1029 <entry><literal>character_set_catalog</literal></entry>
1030 <entry><type>sql_identifier</type></entry>
1031 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1035 <entry><literal>character_set_schema</literal></entry>
1036 <entry><type>sql_identifier</type></entry>
1037 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1041 <entry><literal>character_set_name</literal></entry>
1042 <entry><type>sql_identifier</type></entry>
1043 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1047 <entry><literal>collation_catalog</literal></entry>
1048 <entry><type>sql_identifier</type></entry>
1049 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1053 <entry><literal>collation_schema</literal></entry>
1054 <entry><type>sql_identifier</type></entry>
1055 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1059 <entry><literal>collation_name</literal></entry>
1060 <entry><type>sql_identifier</type></entry>
1061 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1065 <entry><literal>domain_catalog</literal></entry>
1066 <entry><type>sql_identifier</type></entry>
1068 If the column has a domain type, the name of the database that
1069 the domain is defined in (always the current database), else
1075 <entry><literal>domain_schema</literal></entry>
1076 <entry><type>sql_identifier</type></entry>
1078 If the column has a domain type, the name of the schema that
1079 the domain is defined in, else null.
1084 <entry><literal>domain_name</literal></entry>
1085 <entry><type>sql_identifier</type></entry>
1086 <entry>If the column has a domain type, the name of the domain, else null.</entry>
1090 <entry><literal>udt_catalog</literal></entry>
1091 <entry><type>sql_identifier</type></entry>
1093 Name of the database that the column data type (the underlying
1094 type of the domain, if applicable) is defined in (always the
1100 <entry><literal>udt_schema</literal></entry>
1101 <entry><type>sql_identifier</type></entry>
1103 Name of the schema that the column data type (the underlying
1104 type of the domain, if applicable) is defined in
1109 <entry><literal>udt_name</literal></entry>
1110 <entry><type>sql_identifier</type></entry>
1112 Name of the column data type (the underlying type of the
1113 domain, if applicable)
1118 <entry><literal>scope_catalog</literal></entry>
1119 <entry><type>sql_identifier</type></entry>
1120 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1124 <entry><literal>scope_schema</literal></entry>
1125 <entry><type>sql_identifier</type></entry>
1126 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1130 <entry><literal>scope_name</literal></entry>
1131 <entry><type>sql_identifier</type></entry>
1132 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1136 <entry><literal>maximum_cardinality</literal></entry>
1137 <entry><type>cardinal_number</type></entry>
1138 <entry>Always null, because arrays always have unlimited maximum cardinality in <productname>PostgreSQL</></entry>
1142 <entry><literal>dtd_identifier</literal></entry>
1143 <entry><type>sql_identifier</type></entry>
1145 An identifier of the data type descriptor of the column, unique
1146 among the data type descriptors pertaining to the table. This
1147 is mainly useful for joining with other instances of such
1148 identifiers. (The specific format of the identifier is not
1149 defined and not guaranteed to remain the same in future
1155 <entry><literal>is_self_referencing</literal></entry>
1156 <entry><type>yes_or_no</type></entry>
1157 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1161 <entry><literal>is_identity</literal></entry>
1162 <entry><type>yes_or_no</type></entry>
1163 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1167 <entry><literal>identity_generation</literal></entry>
1168 <entry><type>character_data</type></entry>
1169 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1173 <entry><literal>identity_start</literal></entry>
1174 <entry><type>character_data</type></entry>
1175 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1179 <entry><literal>identity_increment</literal></entry>
1180 <entry><type>character_data</type></entry>
1181 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1185 <entry><literal>identity_maximum</literal></entry>
1186 <entry><type>character_data</type></entry>
1187 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1191 <entry><literal>identity_minimum</literal></entry>
1192 <entry><type>character_data</type></entry>
1193 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1197 <entry><literal>identity_cycle</literal></entry>
1198 <entry><type>yes_or_no</type></entry>
1199 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1203 <entry><literal>is_generated</literal></entry>
1204 <entry><type>character_data</type></entry>
1205 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1209 <entry><literal>generation_expression</literal></entry>
1210 <entry><type>character_data</type></entry>
1211 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1215 <entry><literal>is_updatable</literal></entry>
1216 <entry><type>yes_or_no</type></entry>
1218 <literal>YES</literal> if the column is updatable,
1219 <literal>NO</literal> if not (Columns in base tables are always
1220 updatable, columns in views not necessarily)
1228 Since data types can be defined in a variety of ways in SQL, and
1229 <productname>PostgreSQL</productname> contains additional ways to
1230 define data types, their representation in the information schema
1231 can be somewhat difficult. The column <literal>data_type</literal>
1232 is supposed to identify the underlying built-in type of the column.
1233 In <productname>PostgreSQL</productname>, this means that the type
1234 is defined in the system catalog schema
1235 <literal>pg_catalog</literal>. This column might be useful if the
1236 application can handle the well-known built-in types specially (for
1237 example, format the numeric types differently or use the data in
1238 the precision columns). The columns <literal>udt_name</literal>,
1239 <literal>udt_schema</literal>, and <literal>udt_catalog</literal>
1240 always identify the underlying data type of the column, even if the
1241 column is based on a domain. (Since
1242 <productname>PostgreSQL</productname> treats built-in types like
1243 user-defined types, built-in types appear here as well. This is an
1244 extension of the SQL standard.) These columns should be used if an
1245 application wants to process data differently according to the
1246 type, because in that case it wouldn't matter if the column is
1247 really based on a domain. If the column is based on a domain, the
1248 identity of the domain is stored in the columns
1249 <literal>domain_name</literal>, <literal>domain_schema</literal>,
1250 and <literal>domain_catalog</literal>. If you want to pair up
1251 columns with their associated data types and treat domains as
1252 separate types, you could write <literal>coalesce(domain_name,
1253 udt_name)</literal>, etc.
1257 <sect1 id="infoschema-constraint-column-usage">
1258 <title><literal>constraint_column_usage</literal></title>
1261 The view <literal>constraint_column_usage</literal> identifies all
1262 columns in the current database that are used by some constraint.
1263 Only those columns are shown that are contained in a table owned by
1264 a currently enabled role. For a check constraint, this view
1265 identifies the columns that are used in the check expression. For
1266 a foreign key constraint, this view identifies the columns that the
1267 foreign key references. For a unique or primary key constraint,
1268 this view identifies the constrained columns.
1272 <title><literal>constraint_column_usage</literal> Columns</title>
1278 <entry>Data Type</entry>
1279 <entry>Description</entry>
1285 <entry><literal>table_catalog</literal></entry>
1286 <entry><type>sql_identifier</type></entry>
1288 Name of the database that contains the table that contains the
1289 column that is used by some constraint (always the current
1295 <entry><literal>table_schema</literal></entry>
1296 <entry><type>sql_identifier</type></entry>
1298 Name of the schema that contains the table that contains the
1299 column that is used by some constraint
1304 <entry><literal>table_name</literal></entry>
1305 <entry><type>sql_identifier</type></entry>
1307 Name of the table that contains the column that is used by some
1313 <entry><literal>column_name</literal></entry>
1314 <entry><type>sql_identifier</type></entry>
1316 Name of the column that is used by some constraint
1321 <entry><literal>constraint_catalog</literal></entry>
1322 <entry><type>sql_identifier</type></entry>
1323 <entry>Name of the database that contains the constraint (always the current database)</entry>
1327 <entry><literal>constraint_schema</literal></entry>
1328 <entry><type>sql_identifier</type></entry>
1329 <entry>Name of the schema that contains the constraint</entry>
1333 <entry><literal>constraint_name</literal></entry>
1334 <entry><type>sql_identifier</type></entry>
1335 <entry>Name of the constraint</entry>
1342 <sect1 id="infoschema-constraint-table-usage">
1343 <title><literal>constraint_table_usage</literal></title>
1346 The view <literal>constraint_table_usage</literal> identifies all
1347 tables in the current database that are used by some constraint and
1348 are owned by a currently enabled role. (This is different from the
1349 view <literal>table_constraints</literal>, which identifies all
1350 table constraints along with the table they are defined on.) For a
1351 foreign key constraint, this view identifies the table that the
1352 foreign key references. For a unique or primary key constraint,
1353 this view simply identifies the table the constraint belongs to.
1354 Check constraints and not-null constraints are not included in this
1359 <title><literal>constraint_table_usage</literal> Columns</title>
1365 <entry>Data Type</entry>
1366 <entry>Description</entry>
1372 <entry><literal>table_catalog</literal></entry>
1373 <entry><type>sql_identifier</type></entry>
1375 Name of the database that contains the table that is used by
1376 some constraint (always the current database)
1381 <entry><literal>table_schema</literal></entry>
1382 <entry><type>sql_identifier</type></entry>
1384 Name of the schema that contains the table that is used by some
1390 <entry><literal>table_name</literal></entry>
1391 <entry><type>sql_identifier</type></entry>
1392 <entry>Name of the table that is used by some constraint</entry>
1396 <entry><literal>constraint_catalog</literal></entry>
1397 <entry><type>sql_identifier</type></entry>
1398 <entry>Name of the database that contains the constraint (always the current database)</entry>
1402 <entry><literal>constraint_schema</literal></entry>
1403 <entry><type>sql_identifier</type></entry>
1404 <entry>Name of the schema that contains the constraint</entry>
1408 <entry><literal>constraint_name</literal></entry>
1409 <entry><type>sql_identifier</type></entry>
1410 <entry>Name of the constraint</entry>
1417 <sect1 id="infoschema-data-type-privileges">
1418 <title><literal>data_type_privileges</literal></title>
1421 The view <literal>data_type_privileges</literal> identifies all
1422 data type descriptors that the current user has access to, by way
1423 of being the owner of the described object or having some privilege
1424 for it. A data type descriptor is generated whenever a data type
1425 is used in the definition of a table column, a domain, or a
1426 function (as parameter or return type) and stores some information
1427 about how the data type is used in that instance (for example, the
1428 declared maximum length, if applicable). Each data type
1429 descriptor is assigned an arbitrary identifier that is unique
1430 among the data type descriptor identifiers assigned for one object
1431 (table, domain, function). This view is probably not useful for
1432 applications, but it is used to define some other views in the
1437 <title><literal>data_type_privileges</literal> Columns</title>
1443 <entry>Data Type</entry>
1444 <entry>Description</entry>
1450 <entry><literal>object_catalog</literal></entry>
1451 <entry><type>sql_identifier</type></entry>
1452 <entry>Name of the database that contains the described object (always the current database)</entry>
1456 <entry><literal>object_schema</literal></entry>
1457 <entry><type>sql_identifier</type></entry>
1458 <entry>Name of the schema that contains the described object</entry>
1462 <entry><literal>object_name</literal></entry>
1463 <entry><type>sql_identifier</type></entry>
1464 <entry>Name of the described object</entry>
1468 <entry><literal>object_type</literal></entry>
1469 <entry><type>character_data</type></entry>
1471 The type of the described object: one of
1472 <literal>TABLE</literal> (the data type descriptor pertains to
1473 a column of that table), <literal>DOMAIN</literal> (the data
1474 type descriptors pertains to that domain),
1475 <literal>ROUTINE</literal> (the data type descriptor pertains
1476 to a parameter or the return data type of that function).
1481 <entry><literal>dtd_identifier</literal></entry>
1482 <entry><type>sql_identifier</type></entry>
1484 The identifier of the data type descriptor, which is unique
1485 among the data type descriptors for that same object.
1493 <sect1 id="infoschema-domain-constraints">
1494 <title><literal>domain_constraints</literal></title>
1497 The view <literal>domain_constraints</literal> contains all
1498 constraints belonging to domains defined in the current database.
1502 <title><literal>domain_constraints</literal> Columns</title>
1508 <entry>Data Type</entry>
1509 <entry>Description</entry>
1515 <entry><literal>constraint_catalog</literal></entry>
1516 <entry><type>sql_identifier</type></entry>
1517 <entry>Name of the database that contains the constraint (always the current database)</entry>
1521 <entry><literal>constraint_schema</literal></entry>
1522 <entry><type>sql_identifier</type></entry>
1523 <entry>Name of the schema that contains the constraint</entry>
1527 <entry><literal>constraint_name</literal></entry>
1528 <entry><type>sql_identifier</type></entry>
1529 <entry>Name of the constraint</entry>
1533 <entry><literal>domain_catalog</literal></entry>
1534 <entry><type>sql_identifier</type></entry>
1535 <entry>Name of the database that contains the domain (always the current database)</entry>
1539 <entry><literal>domain_schema</literal></entry>
1540 <entry><type>sql_identifier</type></entry>
1541 <entry>Name of the schema that contains the domain</entry>
1545 <entry><literal>domain_name</literal></entry>
1546 <entry><type>sql_identifier</type></entry>
1547 <entry>Name of the domain</entry>
1551 <entry><literal>is_deferrable</literal></entry>
1552 <entry><type>yes_or_no</type></entry>
1553 <entry><literal>YES</literal> if the constraint is deferrable, <literal>NO</literal> if not</entry>
1557 <entry><literal>initially_deferred</literal></entry>
1558 <entry><type>yes_or_no</type></entry>
1559 <entry><literal>YES</literal> if the constraint is deferrable and initially deferred, <literal>NO</literal> if not</entry>
1566 <sect1 id="infoschema-domain-udt-usage">
1567 <title><literal>domain_udt_usage</literal></title>
1570 The view <literal>domain_udt_usage</literal> identifies all domains
1571 that are based on data types owned by a currently enabled role.
1572 Note that in <productname>PostgreSQL</productname>, built-in data
1573 types behave like user-defined types, so they are included here as
1578 <title><literal>domain_udt_usage</literal> Columns</title>
1584 <entry>Data Type</entry>
1585 <entry>Description</entry>
1591 <entry><literal>udt_catalog</literal></entry>
1592 <entry><type>sql_identifier</type></entry>
1593 <entry>Name of the database that the domain data type is defined in (always the current database)</entry>
1597 <entry><literal>udt_schema</literal></entry>
1598 <entry><type>sql_identifier</type></entry>
1599 <entry>Name of the schema that the domain data type is defined in</entry>
1603 <entry><literal>udt_name</literal></entry>
1604 <entry><type>sql_identifier</type></entry>
1605 <entry>Name of the domain data type</entry>
1609 <entry><literal>domain_catalog</literal></entry>
1610 <entry><type>sql_identifier</type></entry>
1611 <entry>Name of the database that contains the domain (always the current database)</entry>
1615 <entry><literal>domain_schema</literal></entry>
1616 <entry><type>sql_identifier</type></entry>
1617 <entry>Name of the schema that contains the domain</entry>
1621 <entry><literal>domain_name</literal></entry>
1622 <entry><type>sql_identifier</type></entry>
1623 <entry>Name of the domain</entry>
1630 <sect1 id="infoschema-domains">
1631 <title><literal>domains</literal></title>
1634 The view <literal>domains</literal> contains all domains defined in
1635 the current database.
1639 <title><literal>domains</literal> Columns</title>
1645 <entry>Data Type</entry>
1646 <entry>Description</entry>
1652 <entry><literal>domain_catalog</literal></entry>
1653 <entry><type>sql_identifier</type></entry>
1654 <entry>Name of the database that contains the domain (always the current database)</entry>
1658 <entry><literal>domain_schema</literal></entry>
1659 <entry><type>sql_identifier</type></entry>
1660 <entry>Name of the schema that contains the domain</entry>
1664 <entry><literal>domain_name</literal></entry>
1665 <entry><type>sql_identifier</type></entry>
1666 <entry>Name of the domain</entry>
1670 <entry><literal>data_type</literal></entry>
1671 <entry><type>character_data</type></entry>
1673 Data type of the domain, if it is a built-in type, or
1674 <literal>ARRAY</literal> if it is some array (in that case, see
1675 the view <literal>element_types</literal>), else
1676 <literal>USER-DEFINED</literal> (in that case, the type is
1677 identified in <literal>udt_name</literal> and associated
1683 <entry><literal>character_maximum_length</literal></entry>
1684 <entry><type>cardinal_number</type></entry>
1686 If the domain has a character or bit string type, the declared
1687 maximum length; null for all other data types or if no maximum
1688 length was declared.
1693 <entry><literal>character_octet_length</literal></entry>
1694 <entry><type>cardinal_number</type></entry>
1696 If the domain has a character type, the maximum possible length
1697 in octets (bytes) of a datum; null for all other data types.
1698 The maximum octet length depends on the declared character
1699 maximum length (see above) and the server encoding.
1704 <entry><literal>character_set_catalog</literal></entry>
1705 <entry><type>sql_identifier</type></entry>
1706 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1710 <entry><literal>character_set_schema</literal></entry>
1711 <entry><type>sql_identifier</type></entry>
1712 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1716 <entry><literal>character_set_name</literal></entry>
1717 <entry><type>sql_identifier</type></entry>
1718 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1722 <entry><literal>collation_catalog</literal></entry>
1723 <entry><type>sql_identifier</type></entry>
1724 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1728 <entry><literal>collation_schema</literal></entry>
1729 <entry><type>sql_identifier</type></entry>
1730 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1734 <entry><literal>collation_name</literal></entry>
1735 <entry><type>sql_identifier</type></entry>
1736 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1740 <entry><literal>numeric_precision</literal></entry>
1741 <entry><type>cardinal_number</type></entry>
1743 If the domain has a numeric type, this column contains the
1744 (declared or implicit) precision of the type for this domain.
1745 The precision indicates the number of significant digits. It
1746 can be expressed in decimal (base 10) or binary (base 2) terms,
1747 as specified in the column
1748 <literal>numeric_precision_radix</literal>. For all other data
1749 types, this column is null.
1754 <entry><literal>numeric_precision_radix</literal></entry>
1755 <entry><type>cardinal_number</type></entry>
1757 If the domain has a numeric type, this column indicates in
1758 which base the values in the columns
1759 <literal>numeric_precision</literal> and
1760 <literal>numeric_scale</literal> are expressed. The value is
1761 either 2 or 10. For all other data types, this column is null.
1766 <entry><literal>numeric_scale</literal></entry>
1767 <entry><type>cardinal_number</type></entry>
1769 If the domain has an exact numeric type, this column contains
1770 the (declared or implicit) scale of the type for this domain.
1771 The scale indicates the number of significant digits to the
1772 right of the decimal point. It can be expressed in decimal
1773 (base 10) or binary (base 2) terms, as specified in the column
1774 <literal>numeric_precision_radix</literal>. For all other data
1775 types, this column is null.
1780 <entry><literal>datetime_precision</literal></entry>
1781 <entry><type>cardinal_number</type></entry>
1783 If <literal>data_type</literal> identifies a date, time,
1784 timestamp, or interval type, this column contains the (declared
1785 or implicit) fractional seconds precision of the type for this
1786 domain, that is, the number of decimal digits maintained
1787 following the decimal point in the seconds value. For all
1788 other data types, this column is null.
1793 <entry><literal>interval_type</literal></entry>
1794 <entry><type>character_data</type></entry>
1795 <entry>Not yet implemented</entry>
1799 <entry><literal>interval_precision</literal></entry>
1800 <entry><type>character_data</type></entry>
1801 <entry>Not yet implemented</entry>
1805 <entry><literal>domain_default</literal></entry>
1806 <entry><type>character_data</type></entry>
1807 <entry>Default expression of the domain</entry>
1811 <entry><literal>udt_catalog</literal></entry>
1812 <entry><type>sql_identifier</type></entry>
1813 <entry>Name of the database that the domain data type is defined in (always the current database)</entry>
1817 <entry><literal>udt_schema</literal></entry>
1818 <entry><type>sql_identifier</type></entry>
1819 <entry>Name of the schema that the domain data type is defined in</entry>
1823 <entry><literal>udt_name</literal></entry>
1824 <entry><type>sql_identifier</type></entry>
1825 <entry>Name of the domain data type</entry>
1829 <entry><literal>scope_catalog</literal></entry>
1830 <entry><type>sql_identifier</type></entry>
1831 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1835 <entry><literal>scope_schema</literal></entry>
1836 <entry><type>sql_identifier</type></entry>
1837 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1841 <entry><literal>scope_name</literal></entry>
1842 <entry><type>sql_identifier</type></entry>
1843 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1847 <entry><literal>maximum_cardinality</literal></entry>
1848 <entry><type>cardinal_number</type></entry>
1849 <entry>Always null, because arrays always have unlimited maximum cardinality in <productname>PostgreSQL</></entry>
1853 <entry><literal>dtd_identifier</literal></entry>
1854 <entry><type>sql_identifier</type></entry>
1856 An identifier of the data type descriptor of the domain, unique
1857 among the data type descriptors pertaining to the domain (which
1858 is trivial, because a domain only contains one data type
1859 descriptor). This is mainly useful for joining with other
1860 instances of such identifiers. (The specific format of the
1861 identifier is not defined and not guaranteed to remain the same
1862 in future versions.)
1870 <sect1 id="infoschema-element-types">
1871 <title><literal>element_types</literal></title>
1874 The view <literal>element_types</literal> contains the data type
1875 descriptors of the elements of arrays. When a table column,
1876 domain, function parameter, or function return value is defined to
1877 be of an array type, the respective information schema view only
1878 contains <literal>ARRAY</literal> in the column
1879 <literal>data_type</literal>. To obtain information on the element
1880 type of the array, you can join the respective view with this view.
1881 For example, to show the columns of a table with data types and
1882 array element types, if applicable, you could do:
1884 SELECT c.column_name, c.data_type, e.data_type AS element_type
1885 FROM information_schema.columns c LEFT JOIN information_schema.element_types e
1886 ON ((c.table_catalog, c.table_schema, c.table_name, 'TABLE', c.dtd_identifier)
1887 = (e.object_catalog, e.object_schema, e.object_name, e.object_type, e.dtd_identifier))
1888 WHERE c.table_schema = '...' AND c.table_name = '...'
1889 ORDER BY c.ordinal_position;
1891 This view only includes objects that the current user has access
1892 to, by way of being the owner or having some privilege.
1896 <title><literal>element_types</literal> Columns</title>
1902 <entry>Data Type</entry>
1903 <entry>Description</entry>
1909 <entry><literal>object_catalog</literal></entry>
1910 <entry><type>sql_identifier</type></entry>
1912 Name of the database that contains the object that uses the
1913 array being described (always the current database)
1918 <entry><literal>object_schema</literal></entry>
1919 <entry><type>sql_identifier</type></entry>
1921 Name of the schema that contains the object that uses the array
1927 <entry><literal>object_name</literal></entry>
1928 <entry><type>sql_identifier</type></entry>
1930 Name of the object that uses the array being described
1935 <entry><literal>object_type</literal></entry>
1936 <entry><type>character_data</type></entry>
1938 The type of the object that uses the array being described: one
1939 of <literal>TABLE</literal> (the array is used by a column of
1940 that table), <literal>DOMAIN</literal> (the array is used by
1941 that domain), <literal>ROUTINE</literal> (the array is used by
1942 a parameter or the return data type of that function).
1947 <entry><literal>dtd_identifier</literal></entry>
1948 <entry><type>sql_identifier</type></entry>
1950 The identifier of the data type descriptor of the array being
1956 <entry><literal>data_type</literal></entry>
1957 <entry><type>character_data</type></entry>
1959 Data type of the array elements, if it is a built-in type, else
1960 <literal>USER-DEFINED</literal> (in that case, the type is
1961 identified in <literal>udt_name</literal> and associated
1967 <entry><literal>character_maximum_length</literal></entry>
1968 <entry><type>cardinal_number</type></entry>
1969 <entry>Always null, since this information is not applied to array element data types in <productname>PostgreSQL</></entry>
1973 <entry><literal>character_octet_length</literal></entry>
1974 <entry><type>cardinal_number</type></entry>
1975 <entry>Always null, since this information is not applied to array element data types in <productname>PostgreSQL</></entry>
1979 <entry><literal>character_set_catalog</literal></entry>
1980 <entry><type>sql_identifier</type></entry>
1981 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1985 <entry><literal>character_set_schema</literal></entry>
1986 <entry><type>sql_identifier</type></entry>
1987 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1991 <entry><literal>character_set_name</literal></entry>
1992 <entry><type>sql_identifier</type></entry>
1993 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
1997 <entry><literal>collation_catalog</literal></entry>
1998 <entry><type>sql_identifier</type></entry>
1999 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2003 <entry><literal>collation_schema</literal></entry>
2004 <entry><type>sql_identifier</type></entry>
2005 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2009 <entry><literal>collation_name</literal></entry>
2010 <entry><type>sql_identifier</type></entry>
2011 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2015 <entry><literal>numeric_precision</literal></entry>
2016 <entry><type>cardinal_number</type></entry>
2017 <entry>Always null, since this information is not applied to array element data types in <productname>PostgreSQL</></entry>
2021 <entry><literal>numeric_precision_radix</literal></entry>
2022 <entry><type>cardinal_number</type></entry>
2023 <entry>Always null, since this information is not applied to array element data types in <productname>PostgreSQL</></entry>
2027 <entry><literal>numeric_scale</literal></entry>
2028 <entry><type>cardinal_number</type></entry>
2029 <entry>Always null, since this information is not applied to array element data types in <productname>PostgreSQL</></entry>
2033 <entry><literal>datetime_precision</literal></entry>
2034 <entry><type>cardinal_number</type></entry>
2035 <entry>Always null, since this information is not applied to array element data types in <productname>PostgreSQL</></entry>
2039 <entry><literal>interval_type</literal></entry>
2040 <entry><type>character_data</type></entry>
2041 <entry>Always null, since this information is not applied to array element data types in <productname>PostgreSQL</></entry>
2045 <entry><literal>interval_precision</literal></entry>
2046 <entry><type>character_data</type></entry>
2047 <entry>Always null, since this information is not applied to array element data types in <productname>PostgreSQL</></entry>
2051 <entry><literal>domain_default</literal></entry>
2052 <entry><type>character_data</type></entry>
2053 <entry>Not yet implemented</entry>
2057 <entry><literal>udt_catalog</literal></entry>
2058 <entry><type>sql_identifier</type></entry>
2060 Name of the database that the data type of the elements is
2061 defined in (always the current database)
2066 <entry><literal>udt_schema</literal></entry>
2067 <entry><type>sql_identifier</type></entry>
2069 Name of the schema that the data type of the elements is
2075 <entry><literal>udt_name</literal></entry>
2076 <entry><type>sql_identifier</type></entry>
2078 Name of the data type of the elements
2083 <entry><literal>scope_catalog</literal></entry>
2084 <entry><type>sql_identifier</type></entry>
2085 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2089 <entry><literal>scope_schema</literal></entry>
2090 <entry><type>sql_identifier</type></entry>
2091 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2095 <entry><literal>scope_name</literal></entry>
2096 <entry><type>sql_identifier</type></entry>
2097 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2101 <entry><literal>maximum_cardinality</literal></entry>
2102 <entry><type>cardinal_number</type></entry>
2103 <entry>Always null, because arrays always have unlimited maximum cardinality in <productname>PostgreSQL</></entry>
2111 <sect1 id="infoschema-enabled-roles">
2112 <title><literal>enabled_roles</literal></title>
2115 The view <literal>enabled_roles</literal> identifies the currently
2116 <quote>enabled roles</quote>. The enabled roles are recursively
2117 defined as the current user together with all roles that have been
2118 granted to the enabled roles with automatic inheritance. In other
2119 words, these are all roles that the current user has direct or
2120 indirect, automatically inheriting membership in.
2121 <indexterm><primary>enabled role</primary></indexterm>
2122 <indexterm><primary>role</primary><secondary>enabled</secondary></indexterm>
2126 For permission checking, the set of <quote>applicable roles</quote>
2127 is applied, which can be broader than the set of enabled roles. So
2128 generally, it is better to use the view
2129 <literal>applicable_roles</literal> instead of this one; see also
2134 <title><literal>enabled_roles</literal> Columns</title>
2140 <entry>Data Type</entry>
2141 <entry>Description</entry>
2147 <entry><literal>role_name</literal></entry>
2148 <entry><type>sql_identifier</type></entry>
2149 <entry>Name of a role</entry>
2156 <sect1 id="infoschema-foreign-data-wrapper-options">
2157 <title><literal>foreign_data_wrapper_options</literal></title>
2160 The view <literal>foreign_data_wrapper_options</literal> contains
2161 all the options defined for foreign-data wrappers in the current
2162 database. Only those foreign-data wrappers are shown that the
2163 current user has access to (by way of being the owner or having
2168 <title><literal>foreign_data_wrapper_options</literal> Columns</title>
2174 <entry>Data Type</entry>
2175 <entry>Description</entry>
2181 <entry><literal>foreign_data_wrapper_catalog</literal></entry>
2182 <entry><type>sql_identifier</type></entry>
2183 <entry>Name of the database that the foreign-data wrapper is defined in (always the current database)</entry>
2187 <entry><literal>foreign_data_wrapper_name</literal></entry>
2188 <entry><type>sql_identifier</type></entry>
2189 <entry>Name of the foreign-data wrapper</entry>
2193 <entry><literal>option_name</literal></entry>
2194 <entry><type>sql_identifier</type></entry>
2195 <entry>Name of an option</entry>
2199 <entry><literal>option_value</literal></entry>
2200 <entry><type>character_data</type></entry>
2201 <entry>Value of the option</entry>
2208 <sect1 id="infoschema-foreign-data-wrappers">
2209 <title><literal>foreign_data_wrappers</literal></title>
2212 The view <literal>foreign_data_wrappers</literal> contains all
2213 foreign-data wrappers defined in the current database. Only those
2214 foreign-data wrappers are shown that the current user has access to
2215 (by way of being the owner or having some privilege).
2219 <title><literal>foreign_data_wrappers</literal> Columns</title>
2225 <entry>Data Type</entry>
2226 <entry>Description</entry>
2232 <entry><literal>foreign_data_wrapper_catalog</literal></entry>
2233 <entry><type>sql_identifier</type></entry>
2234 <entry>Name of the database that contains the foreign-data
2235 wrapper (always the current database)</entry>
2239 <entry><literal>foreign_data_wrapper_name</literal></entry>
2240 <entry><type>sql_identifier</type></entry>
2241 <entry>Name of the foreign-data wrapper</entry>
2245 <entry><literal>authorization_identifier</literal></entry>
2246 <entry><type>sql_identifier</type></entry>
2247 <entry>Name of the owner of the foreign server</entry>
2251 <entry><literal>library_name</literal></entry>
2252 <entry><type>character_data</type></entry>
2253 <entry>File name of the library that implementing this foreign-data wrapper</entry>
2257 <entry><literal>foreign_data_wrapper_language</literal></entry>
2258 <entry><type>character_data</type></entry>
2259 <entry>Language used to implement this foreign-data wrapper</entry>
2266 <sect1 id="infoschema-foreign-server-options">
2267 <title><literal>foreign_server_options</literal></title>
2270 The view <literal>foreign_server_options</literal> contains all the
2271 options defined for foreign servers in the current database. Only
2272 those foreign servers are shown that the current user has access to
2273 (by way of being the owner or having some privilege).
2277 <title><literal>foreign_server_options</literal> Columns</title>
2283 <entry>Data Type</entry>
2284 <entry>Description</entry>
2290 <entry><literal>foreign_server_catalog</literal></entry>
2291 <entry><type>sql_identifier</type></entry>
2292 <entry>Name of the database that the foreign server is defined in (always the current database)</entry>
2296 <entry><literal>foreign_server_name</literal></entry>
2297 <entry><type>sql_identifier</type></entry>
2298 <entry>Name of the foreign server</entry>
2302 <entry><literal>option_name</literal></entry>
2303 <entry><type>sql_identifier</type></entry>
2304 <entry>Name of an option</entry>
2308 <entry><literal>option_value</literal></entry>
2309 <entry><type>character_data</type></entry>
2310 <entry>Value of the option</entry>
2317 <sect1 id="infoschema-foreign-servers">
2318 <title><literal>foreign_servers</literal></title>
2321 The view <literal>foreign_servers</literal> contains all foreign
2322 servers defined in the current database. Only those foreign
2323 servers are shown that the current user has access to (by way of
2324 being the owner or having some privilege).
2328 <title><literal>foreign_servers</literal> Columns</title>
2334 <entry>Data Type</entry>
2335 <entry>Description</entry>
2341 <entry><literal>foreign_server_catalog</literal></entry>
2342 <entry><type>sql_identifier</type></entry>
2343 <entry>Name of the database that the foreign server is defined in (always the current database)</entry>
2347 <entry><literal>foreign_server_name</literal></entry>
2348 <entry><type>sql_identifier</type></entry>
2349 <entry>Name of the foreign server</entry>
2353 <entry><literal>foreign_data_wrapper_catalog</literal></entry>
2354 <entry><type>sql_identifier</type></entry>
2355 <entry>Name of the database that contains the foreign-data
2356 wrapper used by the foreign server (always the current database)</entry>
2360 <entry><literal>foreign_data_wrapper_name</literal></entry>
2361 <entry><type>sql_identifier</type></entry>
2362 <entry>Name of the foreign-data wrapper used by the foreign server</entry>
2366 <entry><literal>foreign_server_type</literal></entry>
2367 <entry><type>character_data</type></entry>
2368 <entry>Foreign server type information, if specified upon creation</entry>
2372 <entry><literal>foreign_server_version</literal></entry>
2373 <entry><type>character_data</type></entry>
2374 <entry>Foreign server version information, if specified upon creation</entry>
2378 <entry><literal>authorization_identifier</literal></entry>
2379 <entry><type>sql_identifier</type></entry>
2380 <entry>Name of the owner of the foreign server</entry>
2387 <sect1 id="infoschema-key-column-usage">
2388 <title><literal>key_column_usage</literal></title>
2391 The view <literal>key_column_usage</literal> identifies all columns
2392 in the current database that are restricted by some unique, primary
2393 key, or foreign key constraint. Check constraints are not included
2394 in this view. Only those columns are shown that the current user
2395 has access to, by way of being the owner or having some privilege.
2399 <title><literal>key_column_usage</literal> Columns</title>
2405 <entry>Data Type</entry>
2406 <entry>Description</entry>
2412 <entry><literal>constraint_catalog</literal></entry>
2413 <entry><type>sql_identifier</type></entry>
2414 <entry>Name of the database that contains the constraint (always the current database)</entry>
2418 <entry><literal>constraint_schema</literal></entry>
2419 <entry><type>sql_identifier</type></entry>
2420 <entry>Name of the schema that contains the constraint</entry>
2424 <entry><literal>constraint_name</literal></entry>
2425 <entry><type>sql_identifier</type></entry>
2426 <entry>Name of the constraint</entry>
2430 <entry><literal>table_catalog</literal></entry>
2431 <entry><type>sql_identifier</type></entry>
2433 Name of the database that contains the table that contains the
2434 column that is restricted by this constraint (always the
2440 <entry><literal>table_schema</literal></entry>
2441 <entry><type>sql_identifier</type></entry>
2443 Name of the schema that contains the table that contains the
2444 column that is restricted by this constraint
2449 <entry><literal>table_name</literal></entry>
2450 <entry><type>sql_identifier</type></entry>
2452 Name of the table that contains the column that is restricted
2458 <entry><literal>column_name</literal></entry>
2459 <entry><type>sql_identifier</type></entry>
2461 Name of the column that is restricted by this constraint
2466 <entry><literal>ordinal_position</literal></entry>
2467 <entry><type>cardinal_number</type></entry>
2469 Ordinal position of the column within the constraint key (count
2475 <entry><literal>position_in_unique_constraint</literal></entry>
2476 <entry><type>cardinal_number</type></entry>
2478 For a foreign-key constraint, ordinal position of the referenced
2479 column within its unique constraint (count starts at 1);
2488 <sect1 id="infoschema-parameters">
2489 <title><literal>parameters</literal></title>
2492 The view <literal>parameters</literal> contains information about
2493 the parameters (arguments) of all functions in the current database.
2494 Only those functions are shown that the current user has access to
2495 (by way of being the owner or having some privilege).
2499 <title><literal>parameters</literal> Columns</title>
2505 <entry>Data Type</entry>
2506 <entry>Description</entry>
2512 <entry><literal>specific_catalog</literal></entry>
2513 <entry><type>sql_identifier</type></entry>
2514 <entry>Name of the database containing the function (always the current database)</entry>
2518 <entry><literal>specific_schema</literal></entry>
2519 <entry><type>sql_identifier</type></entry>
2520 <entry>Name of the schema containing the function</entry>
2524 <entry><literal>specific_name</literal></entry>
2525 <entry><type>sql_identifier</type></entry>
2527 The <quote>specific name</quote> of the function. See <xref
2528 linkend="infoschema-routines"> for more information.
2533 <entry><literal>ordinal_position</literal></entry>
2534 <entry><type>cardinal_number</type></entry>
2536 Ordinal position of the parameter in the argument list of the
2537 function (count starts at 1)
2542 <entry><literal>parameter_mode</literal></entry>
2543 <entry><type>character_data</type></entry>
2545 <literal>IN</literal> for input parameter,
2546 <literal>OUT</literal> for output parameter,
2547 and <literal>INOUT</literal> for input/output parameter.
2552 <entry><literal>is_result</literal></entry>
2553 <entry><type>yes_or_no</type></entry>
2554 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2558 <entry><literal>as_locator</literal></entry>
2559 <entry><type>yes_or_no</type></entry>
2560 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2564 <entry><literal>parameter_name</literal></entry>
2565 <entry><type>sql_identifier</type></entry>
2566 <entry>Name of the parameter, or null if the parameter has no name</entry>
2570 <entry><literal>data_type</literal></entry>
2571 <entry><type>character_data</type></entry>
2573 Data type of the parameter, if it is a built-in type, or
2574 <literal>ARRAY</literal> if it is some array (in that case, see
2575 the view <literal>element_types</literal>), else
2576 <literal>USER-DEFINED</literal> (in that case, the type is
2577 identified in <literal>udt_name</literal> and associated
2583 <entry><literal>character_maximum_length</literal></entry>
2584 <entry><type>cardinal_number</type></entry>
2585 <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</></entry>
2589 <entry><literal>character_octet_length</literal></entry>
2590 <entry><type>cardinal_number</type></entry>
2591 <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</></entry>
2595 <entry><literal>character_set_catalog</literal></entry>
2596 <entry><type>sql_identifier</type></entry>
2597 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2601 <entry><literal>character_set_schema</literal></entry>
2602 <entry><type>sql_identifier</type></entry>
2603 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2607 <entry><literal>character_set_name</literal></entry>
2608 <entry><type>sql_identifier</type></entry>
2609 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2613 <entry><literal>collation_catalog</literal></entry>
2614 <entry><type>sql_identifier</type></entry>
2615 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2619 <entry><literal>collation_schema</literal></entry>
2620 <entry><type>sql_identifier</type></entry>
2621 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2625 <entry><literal>collation_name</literal></entry>
2626 <entry><type>sql_identifier</type></entry>
2627 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2631 <entry><literal>numeric_precision</literal></entry>
2632 <entry><type>cardinal_number</type></entry>
2633 <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</></entry>
2637 <entry><literal>numeric_precision_radix</literal></entry>
2638 <entry><type>cardinal_number</type></entry>
2639 <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</></entry>
2643 <entry><literal>numeric_scale</literal></entry>
2644 <entry><type>cardinal_number</type></entry>
2645 <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</></entry>
2649 <entry><literal>datetime_precision</literal></entry>
2650 <entry><type>cardinal_number</type></entry>
2651 <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</></entry>
2655 <entry><literal>interval_type</literal></entry>
2656 <entry><type>character_data</type></entry>
2657 <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</></entry>
2661 <entry><literal>interval_precision</literal></entry>
2662 <entry><type>character_data</type></entry>
2663 <entry>Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</></entry>
2667 <entry><literal>udt_catalog</literal></entry>
2668 <entry><type>sql_identifier</type></entry>
2670 Name of the database that the data type of the parameter is
2671 defined in (always the current database)
2676 <entry><literal>udt_schema</literal></entry>
2677 <entry><type>sql_identifier</type></entry>
2679 Name of the schema that the data type of the parameter is
2685 <entry><literal>udt_name</literal></entry>
2686 <entry><type>sql_identifier</type></entry>
2688 Name of the data type of the parameter
2693 <entry><literal>scope_catalog</literal></entry>
2694 <entry><type>sql_identifier</type></entry>
2695 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2699 <entry><literal>scope_schema</literal></entry>
2700 <entry><type>sql_identifier</type></entry>
2701 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2705 <entry><literal>scope_name</literal></entry>
2706 <entry><type>sql_identifier</type></entry>
2707 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
2711 <entry><literal>maximum_cardinality</literal></entry>
2712 <entry><type>cardinal_number</type></entry>
2713 <entry>Always null, because arrays always have unlimited maximum cardinality in <productname>PostgreSQL</></entry>
2717 <entry><literal>dtd_identifier</literal></entry>
2718 <entry><type>sql_identifier</type></entry>
2720 An identifier of the data type descriptor of the parameter,
2721 unique among the data type descriptors pertaining to the
2722 function. This is mainly useful for joining with other
2723 instances of such identifiers. (The specific format of the
2724 identifier is not defined and not guaranteed to remain the same
2725 in future versions.)
2733 <sect1 id="infoschema-referential-constraints">
2734 <title><literal>referential_constraints</literal></title>
2737 The view <literal>referential_constraints</literal> contains all
2738 referential (foreign key) constraints in the current database.
2739 Only those constraints are shown for which the current user has
2740 write access to the referencing table (by way of being the
2741 owner or having some privilege other than SELECT).
2745 <title><literal>referential_constraints</literal> Columns</title>
2751 <entry>Data Type</entry>
2752 <entry>Description</entry>
2758 <entry><literal>constraint_catalog</literal></entry>
2759 <entry><literal>sql_identifier</literal></entry>
2760 <entry>Name of the database containing the constraint (always the current database)</entry>
2764 <entry><literal>constraint_schema</literal></entry>
2765 <entry><literal>sql_identifier</literal></entry>
2766 <entry>Name of the schema containing the constraint</entry>
2770 <entry><literal>constraint_name</literal></entry>
2771 <entry><literal>sql_identifier</literal></entry>
2772 <entry>Name of the constraint</entry>
2776 <entry><literal>unique_constraint_catalog</literal></entry>
2777 <entry><literal>sql_identifier</literal></entry>
2779 Name of the database that contains the unique or primary key
2780 constraint that the foreign key constraint references (always
2781 the current database)
2786 <entry><literal>unique_constraint_schema</literal></entry>
2787 <entry><literal>sql_identifier</literal></entry>
2789 Name of the schema that contains the unique or primary key
2790 constraint that the foreign key constraint references
2795 <entry><literal>unique_constraint_name</literal></entry>
2796 <entry><literal>sql_identifier</literal></entry>
2798 Name of the unique or primary key constraint that the foreign
2799 key constraint references
2804 <entry><literal>match_option</literal></entry>
2805 <entry><literal>character_data</literal></entry>
2807 Match option of the foreign key constraint:
2808 <literal>FULL</literal>, <literal>PARTIAL</literal>, or
2809 <literal>NONE</literal>.
2814 <entry><literal>update_rule</literal></entry>
2815 <entry><literal>character_data</literal></entry>
2817 Update rule of the foreign key constraint:
2818 <literal>CASCADE</literal>, <literal>SET NULL</literal>,
2819 <literal>SET DEFAULT</literal>, <literal>RESTRICT</literal>, or
2820 <literal>NO ACTION</literal>.
2825 <entry><literal>delete_rule</literal></entry>
2826 <entry><literal>character_data</literal></entry>
2828 Delete rule of the foreign key constraint:
2829 <literal>CASCADE</literal>, <literal>SET NULL</literal>,
2830 <literal>SET DEFAULT</literal>, <literal>RESTRICT</literal>, or
2831 <literal>NO ACTION</literal>.
2839 <sect1 id="infoschema-role-column-grants">
2840 <title><literal>role_column_grants</literal></title>
2843 The view <literal>role_column_grants</literal> identifies all
2844 privileges granted on columns where the grantor or grantee is a
2845 currently enabled role. Further information can be found under
2846 <literal>column_privileges</literal>.
2850 <title><literal>role_column_grants</literal> Columns</title>
2856 <entry>Data Type</entry>
2857 <entry>Description</entry>
2863 <entry><literal>grantor</literal></entry>
2864 <entry><type>sql_identifier</type></entry>
2865 <entry>Name of the role that granted the privilege</entry>
2869 <entry><literal>grantee</literal></entry>
2870 <entry><type>sql_identifier</type></entry>
2871 <entry>Name of the role that the privilege was granted to</entry>
2875 <entry><literal>table_catalog</literal></entry>
2876 <entry><type>sql_identifier</type></entry>
2877 <entry>Name of the database that contains the table that contains the column (always the current database)</entry>
2881 <entry><literal>table_schema</literal></entry>
2882 <entry><type>sql_identifier</type></entry>
2883 <entry>Name of the schema that contains the table that contains the column</entry>
2887 <entry><literal>table_name</literal></entry>
2888 <entry><type>sql_identifier</type></entry>
2889 <entry>Name of the table that contains the column</entry>
2893 <entry><literal>column_name</literal></entry>
2894 <entry><type>sql_identifier</type></entry>
2895 <entry>Name of the column</entry>
2899 <entry><literal>privilege_type</literal></entry>
2900 <entry><type>character_data</type></entry>
2902 Type of the privilege: <literal>SELECT</literal>,
2903 <literal>INSERT</literal>, <literal>UPDATE</literal>, or
2904 <literal>REFERENCES</literal>
2909 <entry><literal>is_grantable</literal></entry>
2910 <entry><type>yes_or_no</type></entry>
2911 <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
2918 <sect1 id="infoschema-role-routine-grants">
2919 <title><literal>role_routine_grants</literal></title>
2922 The view <literal>role_routine_grants</literal> identifies all
2923 privileges granted on functions where the grantor or grantee is a
2924 currently enabled role. Further information can be found under
2925 <literal>routine_privileges</literal>.
2929 <title><literal>role_routine_grants</literal> Columns</title>
2935 <entry>Data Type</entry>
2936 <entry>Description</entry>
2942 <entry><literal>grantor</literal></entry>
2943 <entry><type>sql_identifier</type></entry>
2944 <entry>Name of the role that granted the privilege</entry>
2948 <entry><literal>grantee</literal></entry>
2949 <entry><type>sql_identifier</type></entry>
2950 <entry>Name of the role that the privilege was granted to</entry>
2954 <entry><literal>specific_catalog</literal></entry>
2955 <entry><type>sql_identifier</type></entry>
2956 <entry>Name of the database containing the function (always the current database)</entry>
2960 <entry><literal>specific_schema</literal></entry>
2961 <entry><type>sql_identifier</type></entry>
2962 <entry>Name of the schema containing the function</entry>
2966 <entry><literal>specific_name</literal></entry>
2967 <entry><type>sql_identifier</type></entry>
2969 The <quote>specific name</quote> of the function. See <xref
2970 linkend="infoschema-routines"> for more information.
2975 <entry><literal>routine_catalog</literal></entry>
2976 <entry><type>sql_identifier</type></entry>
2977 <entry>Name of the database containing the function (always the current database)</entry>
2981 <entry><literal>routine_schema</literal></entry>
2982 <entry><type>sql_identifier</type></entry>
2983 <entry>Name of the schema containing the function</entry>
2987 <entry><literal>routine_name</literal></entry>
2988 <entry><type>sql_identifier</type></entry>
2989 <entry>Name of the function (might be duplicated in case of overloading)</entry>
2993 <entry><literal>privilege_type</literal></entry>
2994 <entry><type>character_data</type></entry>
2995 <entry>Always <literal>EXECUTE</literal> (the only privilege type for functions)</entry>
2999 <entry><literal>is_grantable</literal></entry>
3000 <entry><type>yes_or_no</type></entry>
3001 <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
3008 <sect1 id="infoschema-role-table-grants">
3009 <title><literal>role_table_grants</literal></title>
3012 The view <literal>role_table_grants</literal> identifies all
3013 privileges granted on tables or views where the grantor or grantee
3014 is a currently enabled role. Further information can be found
3015 under <literal>table_privileges</literal>.
3019 <title><literal>role_table_grants</literal> Columns</title>
3025 <entry>Data Type</entry>
3026 <entry>Description</entry>
3032 <entry><literal>grantor</literal></entry>
3033 <entry><type>sql_identifier</type></entry>
3034 <entry>Name of the role that granted the privilege</entry>
3038 <entry><literal>grantee</literal></entry>
3039 <entry><type>sql_identifier</type></entry>
3040 <entry>Name of the role that the privilege was granted to</entry>
3044 <entry><literal>table_catalog</literal></entry>
3045 <entry><type>sql_identifier</type></entry>
3046 <entry>Name of the database that contains the table (always the current database)</entry>
3050 <entry><literal>table_schema</literal></entry>
3051 <entry><type>sql_identifier</type></entry>
3052 <entry>Name of the schema that contains the table</entry>
3056 <entry><literal>table_name</literal></entry>
3057 <entry><type>sql_identifier</type></entry>
3058 <entry>Name of the table</entry>
3062 <entry><literal>privilege_type</literal></entry>
3063 <entry><type>character_data</type></entry>
3065 Type of the privilege: <literal>SELECT</literal>,
3066 <literal>INSERT</literal>, <literal>UPDATE</literal>,
3067 <literal>DELETE</literal>, <literal>TRUNCATE</literal>,
3068 <literal>REFERENCES</literal>, or <literal>TRIGGER</literal>
3073 <entry><literal>is_grantable</literal></entry>
3074 <entry><type>yes_or_no</type></entry>
3075 <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
3079 <entry><literal>with_hierarchy</literal></entry>
3080 <entry><type>yes_or_no</type></entry>
3081 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3088 <sect1 id="infoschema-role-usage-grants">
3089 <title><literal>role_usage_grants</literal></title>
3092 The view <literal>role_usage_grants</literal> identifies
3093 <literal>USAGE</literal> privileges granted on various kinds of
3094 objects where the grantor or grantee is a currently enabled role.
3095 Further information can be found under
3096 <literal>usage_privileges</literal>.
3100 <title><literal>role_usage_grants</literal> Columns</title>
3106 <entry>Data Type</entry>
3107 <entry>Description</entry>
3113 <entry><literal>grantor</literal></entry>
3114 <entry><type>sql_identifier</type></entry>
3115 <entry>The name of the role that granted the privilege</entry>
3119 <entry><literal>grantee</literal></entry>
3120 <entry><type>sql_identifier</type></entry>
3121 <entry>The name of the role that the privilege was granted to</entry>
3125 <entry><literal>object_catalog</literal></entry>
3126 <entry><type>sql_identifier</type></entry>
3127 <entry>Name of the database containing the object (always the current database)</entry>
3131 <entry><literal>object_schema</literal></entry>
3132 <entry><type>sql_identifier</type></entry>
3133 <entry>Name of the schema containing the object, if applicable,
3134 else an empty string</entry>
3138 <entry><literal>object_name</literal></entry>
3139 <entry><type>sql_identifier</type></entry>
3140 <entry>Name of the object</entry>
3144 <entry><literal>object_type</literal></entry>
3145 <entry><type>character_data</type></entry>
3146 <entry><literal>DOMAIN</literal> or <literal>FOREIGN DATA WRAPPER</literal> or <literal>FOREIGN SERVER</literal></entry>
3150 <entry><literal>privilege_type</literal></entry>
3151 <entry><type>character_data</type></entry>
3152 <entry>Always <literal>USAGE</literal></entry>
3156 <entry><literal>is_grantable</literal></entry>
3157 <entry><type>yes_or_no</type></entry>
3158 <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
3165 <sect1 id="infoschema-routine-privileges">
3166 <title><literal>routine_privileges</literal></title>
3169 The view <literal>routine_privileges</literal> identifies all
3170 privileges granted on functions to a currently enabled role or by a
3171 currently enabled role. There is one row for each combination of function,
3172 grantor, and grantee.
3176 <title><literal>routine_privileges</literal> Columns</title>
3182 <entry>Data Type</entry>
3183 <entry>Description</entry>
3189 <entry><literal>grantor</literal></entry>
3190 <entry><type>sql_identifier</type></entry>
3191 <entry>Name of the role that granted the privilege</entry>
3195 <entry><literal>grantee</literal></entry>
3196 <entry><type>sql_identifier</type></entry>
3197 <entry>Name of the role that the privilege was granted to</entry>
3201 <entry><literal>specific_catalog</literal></entry>
3202 <entry><type>sql_identifier</type></entry>
3203 <entry>Name of the database containing the function (always the current database)</entry>
3207 <entry><literal>specific_schema</literal></entry>
3208 <entry><type>sql_identifier</type></entry>
3209 <entry>Name of the schema containing the function</entry>
3213 <entry><literal>specific_name</literal></entry>
3214 <entry><type>sql_identifier</type></entry>
3216 The <quote>specific name</quote> of the function. See <xref
3217 linkend="infoschema-routines"> for more information.
3222 <entry><literal>routine_catalog</literal></entry>
3223 <entry><type>sql_identifier</type></entry>
3224 <entry>Name of the database containing the function (always the current database)</entry>
3228 <entry><literal>routine_schema</literal></entry>
3229 <entry><type>sql_identifier</type></entry>
3230 <entry>Name of the schema containing the function</entry>
3234 <entry><literal>routine_name</literal></entry>
3235 <entry><type>sql_identifier</type></entry>
3236 <entry>Name of the function (might be duplicated in case of overloading)</entry>
3240 <entry><literal>privilege_type</literal></entry>
3241 <entry><type>character_data</type></entry>
3242 <entry>Always <literal>EXECUTE</literal> (the only privilege type for functions)</entry>
3246 <entry><literal>is_grantable</literal></entry>
3247 <entry><type>yes_or_no</type></entry>
3248 <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
3255 <sect1 id="infoschema-routines">
3256 <title><literal>routines</literal></title>
3259 The view <literal>routines</literal> contains all functions in the
3260 current database. Only those functions are shown that the current
3261 user has access to (by way of being the owner or having some
3266 <title><literal>routines</literal> Columns</title>
3272 <entry>Data Type</entry>
3273 <entry>Description</entry>
3279 <entry><literal>specific_catalog</literal></entry>
3280 <entry><type>sql_identifier</type></entry>
3281 <entry>Name of the database containing the function (always the current database)</entry>
3285 <entry><literal>specific_schema</literal></entry>
3286 <entry><type>sql_identifier</type></entry>
3287 <entry>Name of the schema containing the function</entry>
3291 <entry><literal>specific_name</literal></entry>
3292 <entry><type>sql_identifier</type></entry>
3294 The <quote>specific name</quote> of the function. This is a
3295 name that uniquely identifies the function in the schema, even
3296 if the real name of the function is overloaded. The format of
3297 the specific name is not defined, it should only be used to
3298 compare it to other instances of specific routine names.
3303 <entry><literal>routine_catalog</literal></entry>
3304 <entry><type>sql_identifier</type></entry>
3305 <entry>Name of the database containing the function (always the current database)</entry>
3309 <entry><literal>routine_schema</literal></entry>
3310 <entry><type>sql_identifier</type></entry>
3311 <entry>Name of the schema containing the function</entry>
3315 <entry><literal>routine_name</literal></entry>
3316 <entry><type>sql_identifier</type></entry>
3317 <entry>Name of the function (might be duplicated in case of overloading)</entry>
3321 <entry><literal>routine_type</literal></entry>
3322 <entry><type>character_data</type></entry>
3324 Always <literal>FUNCTION</literal> (In the future there might
3325 be other types of routines.)
3330 <entry><literal>module_catalog</literal></entry>
3331 <entry><type>sql_identifier</type></entry>
3332 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3336 <entry><literal>module_schema</literal></entry>
3337 <entry><type>sql_identifier</type></entry>
3338 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3342 <entry><literal>module_name</literal></entry>
3343 <entry><type>sql_identifier</type></entry>
3344 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3348 <entry><literal>udt_catalog</literal></entry>
3349 <entry><type>sql_identifier</type></entry>
3350 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3354 <entry><literal>udt_schema</literal></entry>
3355 <entry><type>sql_identifier</type></entry>
3356 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3360 <entry><literal>udt_name</literal></entry>
3361 <entry><type>sql_identifier</type></entry>
3362 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3366 <entry><literal>data_type</literal></entry>
3367 <entry><type>character_data</type></entry>
3369 Return data type of the function, if it is a built-in type, or
3370 <literal>ARRAY</literal> if it is some array (in that case, see
3371 the view <literal>element_types</literal>), else
3372 <literal>USER-DEFINED</literal> (in that case, the type is
3373 identified in <literal>type_udt_name</literal> and associated
3379 <entry><literal>character_maximum_length</literal></entry>
3380 <entry><type>cardinal_number</type></entry>
3381 <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
3385 <entry><literal>character_octet_length</literal></entry>
3386 <entry><type>cardinal_number</type></entry>
3387 <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
3391 <entry><literal>character_set_catalog</literal></entry>
3392 <entry><type>sql_identifier</type></entry>
3393 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3397 <entry><literal>character_set_schema</literal></entry>
3398 <entry><type>sql_identifier</type></entry>
3399 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3403 <entry><literal>character_set_name</literal></entry>
3404 <entry><type>sql_identifier</type></entry>
3405 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3409 <entry><literal>collation_catalog</literal></entry>
3410 <entry><type>sql_identifier</type></entry>
3411 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3415 <entry><literal>collation_schema</literal></entry>
3416 <entry><type>sql_identifier</type></entry>
3417 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3421 <entry><literal>collation_name</literal></entry>
3422 <entry><type>sql_identifier</type></entry>
3423 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3427 <entry><literal>numeric_precision</literal></entry>
3428 <entry><type>cardinal_number</type></entry>
3429 <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
3433 <entry><literal>numeric_precision_radix</literal></entry>
3434 <entry><type>cardinal_number</type></entry>
3435 <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
3439 <entry><literal>numeric_scale</literal></entry>
3440 <entry><type>cardinal_number</type></entry>
3441 <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
3445 <entry><literal>datetime_precision</literal></entry>
3446 <entry><type>cardinal_number</type></entry>
3447 <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
3451 <entry><literal>interval_type</literal></entry>
3452 <entry><type>character_data</type></entry>
3453 <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
3457 <entry><literal>interval_precision</literal></entry>
3458 <entry><type>character_data</type></entry>
3459 <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
3463 <entry><literal>type_udt_catalog</literal></entry>
3464 <entry><type>sql_identifier</type></entry>
3466 Name of the database that the return data type of the function
3467 is defined in (always the current database)
3472 <entry><literal>type_udt_schema</literal></entry>
3473 <entry><type>sql_identifier</type></entry>
3475 Name of the schema that the return data type of the function is
3481 <entry><literal>type_udt_name</literal></entry>
3482 <entry><type>sql_identifier</type></entry>
3484 Name of the return data type of the function
3489 <entry><literal>scope_catalog</literal></entry>
3490 <entry><type>sql_identifier</type></entry>
3491 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3495 <entry><literal>scope_schema</literal></entry>
3496 <entry><type>sql_identifier</type></entry>
3497 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3501 <entry><literal>scope_name</literal></entry>
3502 <entry><type>sql_identifier</type></entry>
3503 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3507 <entry><literal>maximum_cardinality</literal></entry>
3508 <entry><type>cardinal_number</type></entry>
3509 <entry>Always null, because arrays always have unlimited maximum cardinality in <productname>PostgreSQL</></entry>
3513 <entry><literal>dtd_identifier</literal></entry>
3514 <entry><type>sql_identifier</type></entry>
3516 An identifier of the data type descriptor of the return data
3517 type of this function, unique among the data type descriptors
3518 pertaining to the function. This is mainly useful for joining
3519 with other instances of such identifiers. (The specific format
3520 of the identifier is not defined and not guaranteed to remain
3521 the same in future versions.)
3526 <entry><literal>routine_body</literal></entry>
3527 <entry><type>character_data</type></entry>
3529 If the function is an SQL function, then
3530 <literal>SQL</literal>, else <literal>EXTERNAL</literal>.
3535 <entry><literal>routine_definition</literal></entry>
3536 <entry><type>character_data</type></entry>
3538 The source text of the function (null if the function is not
3539 owned by a currently enabled role). (According to the SQL
3540 standard, this column is only applicable if
3541 <literal>routine_body</literal> is <literal>SQL</literal>, but
3542 in <productname>PostgreSQL</productname> it will contain
3543 whatever source text was specified when the function was
3549 <entry><literal>external_name</literal></entry>
3550 <entry><type>character_data</type></entry>
3552 If this function is a C function, then the external name (link
3553 symbol) of the function; else null. (This works out to be the
3554 same value that is shown in
3555 <literal>routine_definition</literal>.)
3560 <entry><literal>external_language</literal></entry>
3561 <entry><type>character_data</type></entry>
3562 <entry>The language the function is written in</entry>
3566 <entry><literal>parameter_style</literal></entry>
3567 <entry><type>character_data</type></entry>
3569 Always <literal>GENERAL</literal> (The SQL standard defines
3570 other parameter styles, which are not available in <productname>PostgreSQL</>.)
3575 <entry><literal>is_deterministic</literal></entry>
3576 <entry><type>yes_or_no</type></entry>
3578 If the function is declared immutable (called deterministic in
3579 the SQL standard), then <literal>YES</literal>, else
3580 <literal>NO</literal>. (You cannot query the other volatility
3581 levels available in <productname>PostgreSQL</> through the information schema.)
3586 <entry><literal>sql_data_access</literal></entry>
3587 <entry><type>character_data</type></entry>
3589 Always <literal>MODIFIES</literal>, meaning that the function
3590 possibly modifies SQL data. This information is not useful for
3591 <productname>PostgreSQL</>.
3596 <entry><literal>is_null_call</literal></entry>
3597 <entry><type>yes_or_no</type></entry>
3599 If the function automatically returns null if any of its
3600 arguments are null, then <literal>YES</literal>, else
3601 <literal>NO</literal>.
3606 <entry><literal>sql_path</literal></entry>
3607 <entry><type>character_data</type></entry>
3608 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3612 <entry><literal>schema_level_routine</literal></entry>
3613 <entry><type>yes_or_no</type></entry>
3615 Always <literal>YES</literal> (The opposite would be a method
3616 of a user-defined type, which is a feature not available in
3617 <productname>PostgreSQL</>.)
3622 <entry><literal>max_dynamic_result_sets</literal></entry>
3623 <entry><type>cardinal_number</type></entry>
3624 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3628 <entry><literal>is_user_defined_cast</literal></entry>
3629 <entry><type>yes_or_no</type></entry>
3630 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3634 <entry><literal>is_implicitly_invocable</literal></entry>
3635 <entry><type>yes_or_no</type></entry>
3636 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3640 <entry><literal>security_type</literal></entry>
3641 <entry><type>character_data</type></entry>
3643 If the function runs with the privileges of the current user,
3644 then <literal>INVOKER</literal>, if the function runs with the
3645 privileges of the user who defined it, then
3646 <literal>DEFINER</literal>.
3651 <entry><literal>to_sql_specific_catalog</literal></entry>
3652 <entry><type>sql_identifier</type></entry>
3653 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3657 <entry><literal>to_sql_specific_schema</literal></entry>
3658 <entry><type>sql_identifier</type></entry>
3659 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3663 <entry><literal>to_sql_specific_name</literal></entry>
3664 <entry><type>sql_identifier</type></entry>
3665 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3669 <entry><literal>as_locator</literal></entry>
3670 <entry><type>yes_or_no</type></entry>
3671 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3675 <entry><literal>created</literal></entry>
3676 <entry><type>time_stamp</type></entry>
3677 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3681 <entry><literal>last_altered</literal></entry>
3682 <entry><type>time_stamp</type></entry>
3683 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3687 <entry><literal>new_savepoint_level</literal></entry>
3688 <entry><type>yes_or_no</type></entry>
3689 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3693 <entry><literal>is_udt_dependent</literal></entry>
3694 <entry><type>yes_or_no</type></entry>
3695 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3699 <entry><literal>result_cast_from_data_type</literal></entry>
3700 <entry><type>character_data</type></entry>
3701 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3705 <entry><literal>result_cast_as_locator</literal></entry>
3706 <entry><type>yes_or_no</type></entry>
3707 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3711 <entry><literal>result_cast_char_max_length</literal></entry>
3712 <entry><type>cardinal_number</type></entry>
3713 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3717 <entry><literal>result_cast_char_octet_length</literal></entry>
3718 <entry><type>character_data</type></entry>
3719 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3723 <entry><literal>result_cast_char_set_catalog</literal></entry>
3724 <entry><type>sql_identifier</type></entry>
3725 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3729 <entry><literal>result_cast_char_set_schema</literal></entry>
3730 <entry><type>sql_identifier</type></entry>
3731 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3735 <entry><literal>result_cast_char_set_name</literal></entry>
3736 <entry><type>sql_identifier</type></entry>
3737 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3741 <entry><literal>result_cast_collation_catalog</literal></entry>
3742 <entry><type>sql_identifier</type></entry>
3743 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3747 <entry><literal>result_cast_collation_schema</literal></entry>
3748 <entry><type>sql_identifier</type></entry>
3749 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3753 <entry><literal>result_cast_collation_name</literal></entry>
3754 <entry><type>sql_identifier</type></entry>
3755 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3759 <entry><literal>result_cast_numeric_precision</literal></entry>
3760 <entry><type>cardinal_number</type></entry>
3761 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3765 <entry><literal>result_cast_numeric_precision_radix</literal></entry>
3766 <entry><type>cardinal_number</type></entry>
3767 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3771 <entry><literal>result_cast_numeric_scale</literal></entry>
3772 <entry><type>cardinal_number</type></entry>
3773 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3777 <entry><literal>result_cast_datetime_precision</literal></entry>
3778 <entry><type>character_data</type></entry>
3779 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3783 <entry><literal>result_cast_interval_type</literal></entry>
3784 <entry><type>character_data</type></entry>
3785 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3789 <entry><literal>result_cast_interval_precision</literal></entry>
3790 <entry><type>character_data</type></entry>
3791 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3795 <entry><literal>result_cast_type_udt_catalog</literal></entry>
3796 <entry><type>sql_identifier</type></entry>
3797 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3801 <entry><literal>result_cast_type_udt_schema</literal></entry>
3802 <entry><type>sql_identifier</type></entry>
3803 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3807 <entry><literal>result_cast_type_udt_name</literal></entry>
3808 <entry><type>sql_identifier</type></entry>
3809 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3813 <entry><literal>result_cast_scope_catalog</literal></entry>
3814 <entry><type>sql_identifier</type></entry>
3815 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3819 <entry><literal>result_cast_scope_schema</literal></entry>
3820 <entry><type>sql_identifier</type></entry>
3821 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3825 <entry><literal>result_cast_scope_name</literal></entry>
3826 <entry><type>sql_identifier</type></entry>
3827 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3831 <entry><literal>result_cast_maximum_cardinality</literal></entry>
3832 <entry><type>cardinal_number</type></entry>
3833 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3837 <entry><literal>result_cast_dtd_identifier</literal></entry>
3838 <entry><type>sql_identifier</type></entry>
3839 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3846 <sect1 id="infoschema-schemata">
3847 <title><literal>schemata</literal></title>
3850 The view <literal>schemata</literal> contains all schemas in the
3851 current database that are owned by a currently enabled role.
3855 <title><literal>schemata</literal> Columns</title>
3861 <entry>Data Type</entry>
3862 <entry>Description</entry>
3868 <entry><literal>catalog_name</literal></entry>
3869 <entry><type>sql_identifier</type></entry>
3870 <entry>Name of the database that the schema is contained in (always the current database)</entry>
3874 <entry><literal>schema_name</literal></entry>
3875 <entry><type>sql_identifier</type></entry>
3876 <entry>Name of the schema</entry>
3880 <entry><literal>schema_owner</literal></entry>
3881 <entry><type>sql_identifier</type></entry>
3882 <entry>Name of the owner of the schema</entry>
3886 <entry><literal>default_character_set_catalog</literal></entry>
3887 <entry><type>sql_identifier</type></entry>
3888 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3892 <entry><literal>default_character_set_schema</literal></entry>
3893 <entry><type>sql_identifier</type></entry>
3894 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3898 <entry><literal>default_character_set_name</literal></entry>
3899 <entry><type>sql_identifier</type></entry>
3900 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3904 <entry><literal>sql_path</literal></entry>
3905 <entry><type>character_data</type></entry>
3906 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3913 <sect1 id="infoschema-sequences">
3914 <title><literal>sequences</literal></title>
3917 The view <literal>sequences</literal> contains all sequences
3918 defined in the current database. Only those sequences are shown
3919 that the current user has access to (by way of being the owner or
3920 having some privilege).
3924 <title><literal>sequences</literal> Columns</title>
3930 <entry>Data Type</entry>
3931 <entry>Description</entry>
3937 <entry><literal>sequence_catalog</literal></entry>
3938 <entry><type>sql_identifier</type></entry>
3939 <entry>Name of the database that contains the sequence (always the current database)</entry>
3943 <entry><literal>sequence_schema</literal></entry>
3944 <entry><type>sql_identifier</type></entry>
3945 <entry>Name of the schema that contains the sequence</entry>
3949 <entry><literal>sequence_name</literal></entry>
3950 <entry><type>sql_identifier</type></entry>
3951 <entry>Name of the sequence</entry>
3955 <entry><literal>data_type</literal></entry>
3956 <entry><type>character_data</type></entry>
3958 The data type of the sequence. In
3959 <productname>PostgreSQL</productname>, this is currently always
3960 <literal>bigint</literal>.
3965 <entry><literal>numeric_precision</literal></entry>
3966 <entry><type>cardinal_number</type></entry>
3968 This column contains the (declared or implicit) precision of
3969 the sequence data type (see above). The precision indicates
3970 the number of significant digits. It can be expressed in
3971 decimal (base 10) or binary (base 2) terms, as specified in the
3972 column <literal>numeric_precision_radix</literal>.
3977 <entry><literal>numeric_precision_radix</literal></entry>
3978 <entry><type>cardinal_number</type></entry>
3980 This column indicates in which base the values in the columns
3981 <literal>numeric_precision</literal> and
3982 <literal>numeric_scale</literal> are expressed. The value is
3988 <entry><literal>numeric_scale</literal></entry>
3989 <entry><type>cardinal_number</type></entry>
3991 This column contains the (declared or implicit) scale of the
3992 sequence data type (see above). The scale indicates the number
3993 of significant digits to the right of the decimal point. It
3994 can be expressed in decimal (base 10) or binary (base 2) terms,
3995 as specified in the column
3996 <literal>numeric_precision_radix</literal>.
4001 <entry><literal>maximum_value</literal></entry>
4002 <entry><type>cardinal_number</type></entry>
4003 <entry>Not yet implemented</entry>
4007 <entry><literal>minimum_value</literal></entry>
4008 <entry><type>cardinal_number</type></entry>
4009 <entry>Not yet implemented</entry>
4013 <entry><literal>increment</literal></entry>
4014 <entry><type>cardinal_number</type></entry>
4015 <entry>Not yet implemented</entry>
4019 <entry><literal>cycle_option</literal></entry>
4020 <entry><type>yes_or_no</type></entry>
4021 <entry>Not yet implemented</entry>
4028 <sect1 id="infoschema-sql-features">
4029 <title><literal>sql_features</literal></title>
4032 The table <literal>sql_features</literal> contains information
4033 about which formal features defined in the SQL standard are
4034 supported by <productname>PostgreSQL</productname>. This is the
4035 same information that is presented in <xref linkend="features">.
4036 There you can also find some additional background information.
4040 <title><literal>sql_features</literal> Columns</title>
4046 <entry>Data Type</entry>
4047 <entry>Description</entry>
4053 <entry><literal>feature_id</literal></entry>
4054 <entry><type>character_data</type></entry>
4055 <entry>Identifier string of the feature</entry>
4059 <entry><literal>feature_name</literal></entry>
4060 <entry><type>character_data</type></entry>
4061 <entry>Descriptive name of the feature</entry>
4065 <entry><literal>sub_feature_id</literal></entry>
4066 <entry><type>character_data</type></entry>
4067 <entry>Identifier string of the subfeature, or a zero-length string if not a subfeature</entry>
4071 <entry><literal>sub_feature_name</literal></entry>
4072 <entry><type>character_data</type></entry>
4073 <entry>Descriptive name of the subfeature, or a zero-length string if not a subfeature</entry>
4077 <entry><literal>is_supported</literal></entry>
4078 <entry><type>yes_or_no</type></entry>
4080 <literal>YES</literal> if the feature is fully supported by the
4081 current version of <productname>PostgreSQL</>, <literal>NO</literal> if not
4086 <entry><literal>is_verified_by</literal></entry>
4087 <entry><type>character_data</type></entry>
4089 Always null, since the <productname>PostgreSQL</> development group does not
4090 perform formal testing of feature conformance
4095 <entry><literal>comments</literal></entry>
4096 <entry><type>character_data</type></entry>
4097 <entry>Possibly a comment about the supported status of the feature</entry>
4104 <sect1 id="infoschema-sql-implementation-info">
4105 <title><literal>sql_implementation_info</literal></title>
4108 The table <literal>sql_implementation_info</literal> contains
4109 information about various aspects that are left
4110 implementation-defined by the SQL standard. This information is
4111 primarily intended for use in the context of the ODBC interface;
4112 users of other interfaces will probably find this information to be
4113 of little use. For this reason, the individual implementation
4114 information items are not described here; you will find them in the
4115 description of the ODBC interface.
4119 <title><literal>sql_implementation_info</literal> Columns</title>
4125 <entry>Data Type</entry>
4126 <entry>Description</entry>
4132 <entry><literal>implementation_info_id</literal></entry>
4133 <entry><type>character_data</type></entry>
4134 <entry>Identifier string of the implementation information item</entry>
4138 <entry><literal>implementation_info_name</literal></entry>
4139 <entry><type>character_data</type></entry>
4140 <entry>Descriptive name of the implementation information item</entry>
4144 <entry><literal>integer_value</literal></entry>
4145 <entry><type>cardinal_number</type></entry>
4147 Value of the implementation information item, or null if the
4148 value is contained in the column
4149 <literal>character_value</literal>
4154 <entry><literal>character_value</literal></entry>
4155 <entry><type>character_data</type></entry>
4157 Value of the implementation information item, or null if the
4158 value is contained in the column
4159 <literal>integer_value</literal>
4164 <entry><literal>comments</literal></entry>
4165 <entry><type>character_data</type></entry>
4166 <entry>Possibly a comment pertaining to the implementation information item</entry>
4173 <sect1 id="infoschema-sql-languages">
4174 <title><literal>sql_languages</literal></title>
4177 The table <literal>sql_languages</literal> contains one row for
4178 each SQL language binding that is supported by
4179 <productname>PostgreSQL</productname>.
4180 <productname>PostgreSQL</productname> supports direct SQL and
4181 embedded SQL in C; that is all you will learn from this table.
4185 <title><literal>sql_languages</literal> Columns</title>
4191 <entry>Data Type</entry>
4192 <entry>Description</entry>
4198 <entry><literal>sql_language_source</literal></entry>
4199 <entry><type>character_data</type></entry>
4201 The name of the source of the language definition; always
4202 <literal>ISO 9075</literal>, that is, the SQL standard
4207 <entry><literal>sql_language_year</literal></entry>
4208 <entry><type>character_data</type></entry>
4210 The year the standard referenced in
4211 <literal>sql_language_source</literal> was approved; currently
4217 <entry><literal>sql_language_conformance</literal></entry>
4218 <entry><type>character_data</type></entry>
4220 The standard conformance level for the language binding. For
4221 ISO 9075:2003 this is always <literal>CORE</literal>.
4226 <entry><literal>sql_language_integrity</literal></entry>
4227 <entry><type>character_data</type></entry>
4228 <entry>Always null (This value is relevant to an earlier version of the SQL standard.)</entry>
4232 <entry><literal>sql_language_implementation</literal></entry>
4233 <entry><type>character_data</type></entry>
4234 <entry>Always null</entry>
4238 <entry><literal>sql_language_binding_style</literal></entry>
4239 <entry><type>character_data</type></entry>
4241 The language binding style, either <literal>DIRECT</literal> or
4242 <literal>EMBEDDED</literal>
4247 <entry><literal>sql_language_programming_language</literal></entry>
4248 <entry><type>character_data</type></entry>
4250 The programming language, if the binding style is
4251 <literal>EMBEDDED</literal>, else null. <productname>PostgreSQL</> only
4252 supports the language C.
4260 <sect1 id="infoschema-sql-packages">
4261 <title><literal>sql_packages</literal></title>
4264 The table <literal>sql_packages</literal> contains information
4265 about which feature packages defined in the SQL standard are
4266 supported by <productname>PostgreSQL</productname>. Refer to <xref
4267 linkend="features"> for background information on feature packages.
4271 <title><literal>sql_packages</literal> Columns</title>
4277 <entry>Data Type</entry>
4278 <entry>Description</entry>
4284 <entry><literal>feature_id</literal></entry>
4285 <entry><type>character_data</type></entry>
4286 <entry>Identifier string of the package</entry>
4290 <entry><literal>feature_name</literal></entry>
4291 <entry><type>character_data</type></entry>
4292 <entry>Descriptive name of the package</entry>
4296 <entry><literal>is_supported</literal></entry>
4297 <entry><type>yes_or_no</type></entry>
4299 <literal>YES</literal> if the package is fully supported by the
4300 current version of <productname>PostgreSQL</>, <literal>NO</literal> if not
4305 <entry><literal>is_verified_by</literal></entry>
4306 <entry><type>character_data</type></entry>
4308 Always null, since the <productname>PostgreSQL</> development group does not
4309 perform formal testing of feature conformance
4314 <entry><literal>comments</literal></entry>
4315 <entry><type>character_data</type></entry>
4316 <entry>Possibly a comment about the supported status of the package</entry>
4323 <sect1 id="infoschema-sql-parts">
4324 <title><literal>sql_parts</literal></title>
4327 The table <literal>sql_parts</literal> contains information about
4328 which of the several parts of the SQL standard are supported by
4329 <productname>PostgreSQL</productname>.
4333 <title><literal>sql_parts</literal> Columns</title>
4339 <entry>Data Type</entry>
4340 <entry>Description</entry>
4346 <entry><literal>feature_id</literal></entry>
4347 <entry><type>character_data</type></entry>
4348 <entry>An identifier string containing the number of the part</entry>
4352 <entry><literal>feature_name</literal></entry>
4353 <entry><type>character_data</type></entry>
4354 <entry>Descriptive name of the part</entry>
4358 <entry><literal>is_supported</literal></entry>
4359 <entry><type>yes_or_no</type></entry>
4361 <literal>YES</literal> if the part is fully supported by the
4362 current version of <productname>PostgreSQL</>,
4363 <literal>NO</literal> if not
4368 <entry><literal>is_verified_by</literal></entry>
4369 <entry><type>character_data</type></entry>
4371 Always null, since the <productname>PostgreSQL</> development group does not
4372 perform formal testing of feature conformance
4377 <entry><literal>comments</literal></entry>
4378 <entry><type>character_data</type></entry>
4379 <entry>Possibly a comment about the supported status of the part</entry>
4386 <sect1 id="infoschema-sql-sizing">
4387 <title><literal>sql_sizing</literal></title>
4390 The table <literal>sql_sizing</literal> contains information about
4391 various size limits and maximum values in
4392 <productname>PostgreSQL</productname>. This information is
4393 primarily intended for use in the context of the ODBC interface;
4394 users of other interfaces will probably find this information to be
4395 of little use. For this reason, the individual sizing items are
4396 not described here; you will find them in the description of the
4401 <title><literal>sql_sizing</literal> Columns</title>
4407 <entry>Data Type</entry>
4408 <entry>Description</entry>
4414 <entry><literal>sizing_id</literal></entry>
4415 <entry><type>cardinal_number</type></entry>
4416 <entry>Identifier of the sizing item</entry>
4420 <entry><literal>sizing_name</literal></entry>
4421 <entry><type>character_data</type></entry>
4422 <entry>Descriptive name of the sizing item</entry>
4426 <entry><literal>supported_value</literal></entry>
4427 <entry><type>cardinal_number</type></entry>
4429 Value of the sizing item, or 0 if the size is unlimited or
4430 cannot be determined, or null if the features for which the
4431 sizing item is applicable are not supported
4436 <entry><literal>comments</literal></entry>
4437 <entry><type>character_data</type></entry>
4438 <entry>Possibly a comment pertaining to the sizing item</entry>
4445 <sect1 id="infoschema-sql-sizing-profiles">
4446 <title><literal>sql_sizing_profiles</literal></title>
4449 The table <literal>sql_sizing_profiles</literal> contains
4450 information about the <literal>sql_sizing</literal> values that are
4451 required by various profiles of the SQL standard. <productname>PostgreSQL</> does
4452 not track any SQL profiles, so this table is empty.
4456 <title><literal>sql_sizing_profiles</literal> Columns</title>
4462 <entry>Data Type</entry>
4463 <entry>Description</entry>
4469 <entry><literal>sizing_id</literal></entry>
4470 <entry><type>cardinal_number</type></entry>
4471 <entry>Identifier of the sizing item</entry>
4475 <entry><literal>sizing_name</literal></entry>
4476 <entry><type>character_data</type></entry>
4477 <entry>Descriptive name of the sizing item</entry>
4481 <entry><literal>profile_id</literal></entry>
4482 <entry><type>character_data</type></entry>
4483 <entry>Identifier string of a profile</entry>
4487 <entry><literal>required_value</literal></entry>
4488 <entry><type>cardinal_number</type></entry>
4490 The value required by the SQL profile for the sizing item, or 0
4491 if the profile places no limit on the sizing item, or null if
4492 the profile does not require any of the features for which the
4493 sizing item is applicable
4498 <entry><literal>comments</literal></entry>
4499 <entry><type>character_data</type></entry>
4500 <entry>Possibly a comment pertaining to the sizing item within the profile</entry>
4507 <sect1 id="infoschema-table-constraints">
4508 <title><literal>table_constraints</literal></title>
4511 The view <literal>table_constraints</literal> contains all
4512 constraints belonging to tables that the current user owns or has
4513 some non-SELECT privilege on.
4517 <title><literal>table_constraints</literal> Columns</title>
4523 <entry>Data Type</entry>
4524 <entry>Description</entry>
4530 <entry><literal>constraint_catalog</literal></entry>
4531 <entry><type>sql_identifier</type></entry>
4532 <entry>Name of the database that contains the constraint (always the current database)</entry>
4536 <entry><literal>constraint_schema</literal></entry>
4537 <entry><type>sql_identifier</type></entry>
4538 <entry>Name of the schema that contains the constraint</entry>
4542 <entry><literal>constraint_name</literal></entry>
4543 <entry><type>sql_identifier</type></entry>
4544 <entry>Name of the constraint</entry>
4548 <entry><literal>table_catalog</literal></entry>
4549 <entry><type>sql_identifier</type></entry>
4550 <entry>Name of the database that contains the table (always the current database)</entry>
4554 <entry><literal>table_schema</literal></entry>
4555 <entry><type>sql_identifier</type></entry>
4556 <entry>Name of the schema that contains the table</entry>
4560 <entry><literal>table_name</literal></entry>
4561 <entry><type>sql_identifier</type></entry>
4562 <entry>Name of the table</entry>
4566 <entry><literal>constraint_type</literal></entry>
4567 <entry><type>character_data</type></entry>
4569 Type of the constraint: <literal>CHECK</literal>,
4570 <literal>FOREIGN KEY</literal>, <literal>PRIMARY KEY</literal>,
4571 or <literal>UNIQUE</literal>
4576 <entry><literal>is_deferrable</literal></entry>
4577 <entry><type>yes_or_no</type></entry>
4578 <entry><literal>YES</literal> if the constraint is deferrable, <literal>NO</literal> if not</entry>
4582 <entry><literal>initially_deferred</literal></entry>
4583 <entry><type>yes_or_no</type></entry>
4584 <entry><literal>YES</literal> if the constraint is deferrable and initially deferred, <literal>NO</literal> if not</entry>
4591 <sect1 id="infoschema-table-privileges">
4592 <title><literal>table_privileges</literal></title>
4595 The view <literal>table_privileges</literal> identifies all
4596 privileges granted on tables or views to a currently enabled role
4597 or by a currently enabled role. There is one row for each
4598 combination of table, grantor, and grantee.
4602 <title><literal>table_privileges</literal> Columns</title>
4608 <entry>Data Type</entry>
4609 <entry>Description</entry>
4615 <entry><literal>grantor</literal></entry>
4616 <entry><type>sql_identifier</type></entry>
4617 <entry>Name of the role that granted the privilege</entry>
4621 <entry><literal>grantee</literal></entry>
4622 <entry><type>sql_identifier</type></entry>
4623 <entry>Name of the role that the privilege was granted to</entry>
4627 <entry><literal>table_catalog</literal></entry>
4628 <entry><type>sql_identifier</type></entry>
4629 <entry>Name of the database that contains the table (always the current database)</entry>
4633 <entry><literal>table_schema</literal></entry>
4634 <entry><type>sql_identifier</type></entry>
4635 <entry>Name of the schema that contains the table</entry>
4639 <entry><literal>table_name</literal></entry>
4640 <entry><type>sql_identifier</type></entry>
4641 <entry>Name of the table</entry>
4645 <entry><literal>privilege_type</literal></entry>
4646 <entry><type>character_data</type></entry>
4648 Type of the privilege: <literal>SELECT</literal>,
4649 <literal>INSERT</literal>, <literal>UPDATE</literal>,
4650 <literal>DELETE</literal>, <literal>TRUNCATE</literal>,
4651 <literal>REFERENCES</literal>, or <literal>TRIGGER</literal>
4656 <entry><literal>is_grantable</literal></entry>
4657 <entry><type>yes_or_no</type></entry>
4658 <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
4662 <entry><literal>with_hierarchy</literal></entry>
4663 <entry><type>yes_or_no</type></entry>
4664 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4671 <sect1 id="infoschema-tables">
4672 <title><literal>tables</literal></title>
4675 The view <literal>tables</literal> contains all tables and views
4676 defined in the current database. Only those tables and views are
4677 shown that the current user has access to (by way of being the
4678 owner or having some privilege).
4682 <title><literal>tables</literal> Columns</title>
4688 <entry>Data Type</entry>
4689 <entry>Description</entry>
4695 <entry><literal>table_catalog</literal></entry>
4696 <entry><type>sql_identifier</type></entry>
4697 <entry>Name of the database that contains the table (always the current database)</entry>
4701 <entry><literal>table_schema</literal></entry>
4702 <entry><type>sql_identifier</type></entry>
4703 <entry>Name of the schema that contains the table</entry>
4707 <entry><literal>table_name</literal></entry>
4708 <entry><type>sql_identifier</type></entry>
4709 <entry>Name of the table</entry>
4713 <entry><literal>table_type</literal></entry>
4714 <entry><type>character_data</type></entry>
4716 Type of the table: <literal>BASE TABLE</literal> for a
4717 persistent base table (the normal table type),
4718 <literal>VIEW</literal> for a view, or <literal>LOCAL
4719 TEMPORARY</literal> for a temporary table
4724 <entry><literal>self_referencing_column_name</literal></entry>
4725 <entry><type>sql_identifier</type></entry>
4726 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4730 <entry><literal>reference_generation</literal></entry>
4731 <entry><type>character_data</type></entry>
4732 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4736 <entry><literal>user_defined_type_catalog</literal></entry>
4737 <entry><type>sql_identifier</type></entry>
4738 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4742 <entry><literal>user_defined_type_schema</literal></entry>
4743 <entry><type>sql_identifier</type></entry>
4744 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4748 <entry><literal>user_defined_type_name</literal></entry>
4749 <entry><type>sql_identifier</type></entry>
4750 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4754 <entry><literal>is_insertable_into</literal></entry>
4755 <entry><type>yes_or_no</type></entry>
4757 <literal>YES</literal> if the table is insertable into,
4758 <literal>NO</literal> if not (Base tables are always insertable
4759 into, views not necessarily.)
4764 <entry><literal>is_typed</literal></entry>
4765 <entry><type>yes_or_no</type></entry>
4766 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4770 <entry><literal>commit_action</literal></entry>
4771 <entry><type>character_data</type></entry>
4773 If the table is a temporary table, then
4774 <literal>PRESERVE</literal>, else null. (The SQL standard
4775 defines other commit actions for temporary tables, which are
4776 not supported by <productname>PostgreSQL</>.)
4784 <sect1 id="infoschema-triggers">
4785 <title><literal>triggers</literal></title>
4788 The view <literal>triggers</literal> contains all triggers defined
4789 in the current database on tables that the current user owns or has
4790 some non-SELECT privilege on.
4794 <title><literal>triggers</literal> Columns</title>
4800 <entry>Data Type</entry>
4801 <entry>Description</entry>
4807 <entry><literal>trigger_catalog</literal></entry>
4808 <entry><type>sql_identifier</type></entry>
4809 <entry>Name of the database that contains the trigger (always the current database)</entry>
4813 <entry><literal>trigger_schema</literal></entry>
4814 <entry><type>sql_identifier</type></entry>
4815 <entry>Name of the schema that contains the trigger</entry>
4819 <entry><literal>trigger_name</literal></entry>
4820 <entry><type>sql_identifier</type></entry>
4821 <entry>Name of the trigger</entry>
4825 <entry><literal>event_manipulation</literal></entry>
4826 <entry><type>character_data</type></entry>
4828 Event that fires the trigger (<literal>INSERT</literal>,
4829 <literal>UPDATE</literal>, or <literal>DELETE</literal>)
4834 <entry><literal>event_object_catalog</literal></entry>
4835 <entry><type>sql_identifier</type></entry>
4837 Name of the database that contains the table that the trigger
4838 is defined on (always the current database)
4843 <entry><literal>event_object_schema</literal></entry>
4844 <entry><type>sql_identifier</type></entry>
4845 <entry>Name of the schema that contains the table that the trigger is defined on</entry>
4849 <entry><literal>event_object_table</literal></entry>
4850 <entry><type>sql_identifier</type></entry>
4851 <entry>Name of the table that the trigger is defined on</entry>
4855 <entry><literal>action_order</literal></entry>
4856 <entry><type>cardinal_number</type></entry>
4857 <entry>Not yet implemented</entry>
4861 <entry><literal>action_condition</literal></entry>
4862 <entry><type>character_data</type></entry>
4863 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4867 <entry><literal>action_statement</literal></entry>
4868 <entry><type>character_data</type></entry>
4870 Statement that is executed by the trigger (currently always
4871 <literal>EXECUTE PROCEDURE
4872 <replaceable>function</replaceable>(...)</literal>)
4877 <entry><literal>action_orientation</literal></entry>
4878 <entry><type>character_data</type></entry>
4880 Identifies whether the trigger fires once for each processed
4881 row or once for each statement (<literal>ROW</literal> or
4882 <literal>STATEMENT</literal>)
4887 <entry><literal>condition_timing</literal></entry>
4888 <entry><type>character_data</type></entry>
4890 Time at which the trigger fires (<literal>BEFORE</literal> or
4891 <literal>AFTER</literal>)
4896 <entry><literal>condition_reference_old_table</literal></entry>
4897 <entry><type>sql_identifier</type></entry>
4898 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4902 <entry><literal>condition_reference_new_table</literal></entry>
4903 <entry><type>sql_identifier</type></entry>
4904 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4908 <entry><literal>condition_reference_old_row</literal></entry>
4909 <entry><type>sql_identifier</type></entry>
4910 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4914 <entry><literal>condition_reference_new_row</literal></entry>
4915 <entry><type>sql_identifier</type></entry>
4916 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4920 <entry><literal>created</literal></entry>
4921 <entry><type>time_stamp</type></entry>
4922 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4929 Triggers in <productname>PostgreSQL</productname> have two
4930 incompatibilities with the SQL standard that affect the
4931 representation in the information schema. First, trigger names are
4932 local to the table in <productname>PostgreSQL</productname>, rather
4933 than being independent schema objects. Therefore there can be duplicate
4934 trigger names defined in one schema, as long as they belong to
4935 different tables. (<literal>trigger_catalog</literal> and
4936 <literal>trigger_schema</literal> are really the values pertaining
4937 to the table that the trigger is defined on.) Second, triggers can
4938 be defined to fire on multiple events in
4939 <productname>PostgreSQL</productname> (e.g., <literal>ON INSERT OR
4940 UPDATE</literal>), whereas the SQL standard only allows one. If a
4941 trigger is defined to fire on multiple events, it is represented as
4942 multiple rows in the information schema, one for each type of
4943 event. As a consequence of these two issues, the primary key of
4944 the view <literal>triggers</literal> is really
4945 <literal>(trigger_catalog, trigger_schema, trigger_name,
4946 event_object_table, event_manipulation)</literal> instead of
4947 <literal>(trigger_catalog, trigger_schema, trigger_name)</literal>,
4948 which is what the SQL standard specifies. Nonetheless, if you
4949 define your triggers in a manner that conforms with the SQL
4950 standard (trigger names unique in the schema and only one event
4951 type per trigger), this will not affect you.
4955 <sect1 id="infoschema-usage-privileges">
4956 <title><literal>usage_privileges</literal></title>
4959 The view <literal>usage_privileges</literal> identifies
4960 <literal>USAGE</literal> privileges granted on various kinds of
4961 objects to a currently enabled role or by a currently enabled role.
4962 In <productname>PostgreSQL</productname>, this currently applies to
4963 domains, foreign-data wrappers, and foreign servers. There is one
4964 row for each combination of object, grantor, and grantee.
4968 Since domains do not have real privileges
4969 in <productname>PostgreSQL</productname>, this view shows implicit
4970 non-grantable <literal>USAGE</literal> privileges granted by the
4971 owner to <literal>PUBLIC</literal> for all domains. The other
4972 object types, however, show real privileges.
4976 <title><literal>usage_privileges</literal> Columns</title>
4982 <entry>Data Type</entry>
4983 <entry>Description</entry>
4989 <entry><literal>grantor</literal></entry>
4990 <entry><type>sql_identifier</type></entry>
4991 <entry>Name of the role that granted the privilege</entry>
4995 <entry><literal>grantee</literal></entry>
4996 <entry><type>sql_identifier</type></entry>
4997 <entry>Name of the role that the privilege was granted to</entry>
5001 <entry><literal>object_catalog</literal></entry>
5002 <entry><type>sql_identifier</type></entry>
5003 <entry>Name of the database containing the object (always the current database)</entry>
5007 <entry><literal>object_schema</literal></entry>
5008 <entry><type>sql_identifier</type></entry>
5009 <entry>Name of the schema containing the object, if applicable,
5010 else an empty string</entry>
5014 <entry><literal>object_name</literal></entry>
5015 <entry><type>sql_identifier</type></entry>
5016 <entry>Name of the object</entry>
5020 <entry><literal>object_type</literal></entry>
5021 <entry><type>character_data</type></entry>
5022 <entry><literal>DOMAIN</literal> or <literal>FOREIGN DATA WRAPPER</literal> or <literal>FOREIGN SERVER</literal></entry>
5026 <entry><literal>privilege_type</literal></entry>
5027 <entry><type>character_data</type></entry>
5028 <entry>Always <literal>USAGE</literal></entry>
5032 <entry><literal>is_grantable</literal></entry>
5033 <entry><type>yes_or_no</type></entry>
5034 <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
5041 <sect1 id="infoschema-user-mapping-options">
5042 <title><literal>user_mapping_options</literal></title>
5045 The view <literal>user_mapping_options</literal> contains all the
5046 options defined for user mappings in the current database. Only
5047 those user mappings are shown where the current user has access to
5048 the corresponding foreign server (by way of being the owner or
5049 having some privilege).
5053 <title><literal>user_mapping_options</literal> Columns</title>
5059 <entry>Data Type</entry>
5060 <entry>Description</entry>
5066 <entry><literal>authorization_identifier</literal></entry>
5067 <entry><type>sql_identifier</type></entry>
5068 <entry>Name of the user being mapped,
5069 or <literal>PUBLIC</literal> if the mapping is public</entry>
5073 <entry><literal>foreign_server_catalog</literal></entry>
5074 <entry><type>sql_identifier</type></entry>
5075 <entry>Name of the database that the foreign server used by this
5076 mapping is defined in (always the current database)</entry>
5080 <entry><literal>foreign_server_name</literal></entry>
5081 <entry><type>sql_identifier</type></entry>
5082 <entry>Name of the foreign server used by this mapping</entry>
5086 <entry><literal>option_name</literal></entry>
5087 <entry><type>sql_identifier</type></entry>
5088 <entry>Name of an option</entry>
5092 <entry><literal>option_value</literal></entry>
5093 <entry><type>character_data</type></entry>
5094 <entry>Value of the option. This column will show as null
5095 unless the current user is the user being mapped, or the mapping
5096 is for <literal>PUBLIC</literal> and the current user is the
5097 server owner, or the current user is a superuser. The intent is
5098 to protect password information stored as user mapping
5106 <sect1 id="infoschema-user-mappings">
5107 <title><literal>user_mappings</literal></title>
5110 The view <literal>user_mappings</literal> contains all user
5111 mappings defined in the current database. Only those user mappings
5112 are shown where the current user has access to the corresponding
5113 foreign server (by way of being the owner or having some
5118 <title><literal>user_mappings</literal> Columns</title>
5124 <entry>Data Type</entry>
5125 <entry>Description</entry>
5131 <entry><literal>authorization_identifier</literal></entry>
5132 <entry><type>sql_identifier</type></entry>
5133 <entry>Name of the user being mapped,
5134 or <literal>PUBLIC</literal> if the mapping is public</entry>
5138 <entry><literal>foreign_server_catalog</literal></entry>
5139 <entry><type>sql_identifier</type></entry>
5140 <entry>Name of the database that the foreign server used by this
5141 mapping is defined in (always the current database)</entry>
5145 <entry><literal>foreign_server_name</literal></entry>
5146 <entry><type>sql_identifier</type></entry>
5147 <entry>Name of the foreign server used by this mapping</entry>
5154 <sect1 id="infoschema-view-column-usage">
5155 <title><literal>view_column_usage</literal></title>
5158 The view <literal>view_column_usage</literal> identifies all
5159 columns that are used in the query expression of a view (the
5160 <command>SELECT</command> statement that defines the view). A
5161 column is only included if the table that contains the column is
5162 owned by a currently enabled role.
5167 Columns of system tables are not included. This should be fixed
5173 <title><literal>view_column_usage</literal> Columns</title>
5179 <entry>Data Type</entry>
5180 <entry>Description</entry>
5186 <entry><literal>view_catalog</literal></entry>
5187 <entry><type>sql_identifier</type></entry>
5188 <entry>Name of the database that contains the view (always the current database)</entry>
5192 <entry><literal>view_schema</literal></entry>
5193 <entry><type>sql_identifier</type></entry>
5194 <entry>Name of the schema that contains the view</entry>
5198 <entry><literal>view_name</literal></entry>
5199 <entry><type>sql_identifier</type></entry>
5200 <entry>Name of the view</entry>
5204 <entry><literal>table_catalog</literal></entry>
5205 <entry><type>sql_identifier</type></entry>
5207 Name of the database that contains the table that contains the
5208 column that is used by the view (always the current database)
5213 <entry><literal>table_schema</literal></entry>
5214 <entry><type>sql_identifier</type></entry>
5216 Name of the schema that contains the table that contains the
5217 column that is used by the view
5222 <entry><literal>table_name</literal></entry>
5223 <entry><type>sql_identifier</type></entry>
5225 Name of the table that contains the column that is used by the
5231 <entry><literal>column_name</literal></entry>
5232 <entry><type>sql_identifier</type></entry>
5233 <entry>Name of the column that is used by the view</entry>
5240 <sect1 id="infoschema-view-routine-usage">
5241 <title><literal>view_routine_usage</literal></title>
5244 The view <literal>view_routine_usage</literal> identifies all
5245 routines (functions and procedures) that are used in the query
5246 expression of a view (the <command>SELECT</command> statement that
5247 defines the view). A routine is only included if that routine is
5248 owned by a currently enabled role.
5252 <title><literal>view_routine_usage</literal> Columns</title>
5258 <entry>Data Type</entry>
5259 <entry>Description</entry>
5265 <entry><literal>table_catalog</literal></entry>
5266 <entry><literal>sql_identifier</literal></entry>
5267 <entry>Name of the database containing the view (always the current database)</entry>
5271 <entry><literal>table_schema</literal></entry>
5272 <entry><literal>sql_identifier</literal></entry>
5273 <entry>Name of the schema containing the view</entry>
5277 <entry><literal>table_name</literal></entry>
5278 <entry><literal>sql_identifier</literal></entry>
5279 <entry>Name of the view</entry>
5283 <entry><literal>specific_catalog</literal></entry>
5284 <entry><literal>sql_identifier</literal></entry>
5285 <entry>Name of the database containing the function (always the current database)</entry>
5289 <entry><literal>specific_schema</literal></entry>
5290 <entry><literal>sql_identifier</literal></entry>
5291 <entry>Name of the schema containing the function</entry>
5295 <entry><literal>specific_name</literal></entry>
5296 <entry><literal>sql_identifier</literal></entry>
5298 The <quote>specific name</quote> of the function. See <xref
5299 linkend="infoschema-routines"> for more information.
5307 <sect1 id="infoschema-view-table-usage">
5308 <title><literal>view_table_usage</literal></title>
5311 The view <literal>view_table_usage</literal> identifies all tables
5312 that are used in the query expression of a view (the
5313 <command>SELECT</command> statement that defines the view). A
5314 table is only included if that table is owned by a currently
5320 System tables are not included. This should be fixed sometime.
5325 <title><literal>view_table_usage</literal> Columns</title>
5331 <entry>Data Type</entry>
5332 <entry>Description</entry>
5338 <entry><literal>view_catalog</literal></entry>
5339 <entry><type>sql_identifier</type></entry>
5340 <entry>Name of the database that contains the view (always the current database)</entry>
5344 <entry><literal>view_schema</literal></entry>
5345 <entry><type>sql_identifier</type></entry>
5346 <entry>Name of the schema that contains the view</entry>
5350 <entry><literal>view_name</literal></entry>
5351 <entry><type>sql_identifier</type></entry>
5352 <entry>Name of the view</entry>
5356 <entry><literal>table_catalog</literal></entry>
5357 <entry><type>sql_identifier</type></entry>
5359 Name of the database that contains the table that is
5360 used by the view (always the current database)
5365 <entry><literal>table_schema</literal></entry>
5366 <entry><type>sql_identifier</type></entry>
5368 Name of the schema that contains the table that is used by the
5374 <entry><literal>table_name</literal></entry>
5375 <entry><type>sql_identifier</type></entry>
5377 Name of the table that is used by the view
5385 <sect1 id="infoschema-views">
5386 <title><literal>views</literal></title>
5389 The view <literal>views</literal> contains all views defined in the
5390 current database. Only those views are shown that the current user
5391 has access to (by way of being the owner or having some privilege).
5395 <title><literal>views</literal> Columns</title>
5401 <entry>Data Type</entry>
5402 <entry>Description</entry>
5408 <entry><literal>table_catalog</literal></entry>
5409 <entry><type>sql_identifier</type></entry>
5410 <entry>Name of the database that contains the view (always the current database)</entry>
5414 <entry><literal>table_schema</literal></entry>
5415 <entry><type>sql_identifier</type></entry>
5416 <entry>Name of the schema that contains the view</entry>
5420 <entry><literal>table_name</literal></entry>
5421 <entry><type>sql_identifier</type></entry>
5422 <entry>Name of the view</entry>
5426 <entry><literal>view_definition</literal></entry>
5427 <entry><type>character_data</type></entry>
5429 Query expression defining the view (null if the view is not
5430 owned by a currently enabled role)
5435 <entry><literal>check_option</literal></entry>
5436 <entry><type>character_data</type></entry>
5437 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5441 <entry><literal>is_updatable</literal></entry>
5442 <entry><type>yes_or_no</type></entry>
5444 <literal>YES</literal> if the view is updatable (allows
5445 <command>UPDATE</command> and <command>DELETE</command>),
5446 <literal>NO</literal> if not
5451 <entry><literal>is_insertable_into</literal></entry>
5452 <entry><type>yes_or_no</type></entry>
5454 <literal>YES</literal> if the view is insertable into (allows
5455 <command>INSERT</command>), <literal>NO</literal> if not
5460 <entry><literal>is_trigger_updatable</literal></entry>
5461 <entry><type>yes_or_no</type></entry>
5462 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5466 <entry><literal>is_trigger_deletable</literal></entry>
5467 <entry><type>yes_or_no</type></entry>
5468 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5472 <entry><literal>is_trigger_insertable_into</literal></entry>
5473 <entry><type>yes_or_no</type></entry>
5474 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>