1 <!-- $PostgreSQL: pgsql/doc/src/sgml/information_schema.sgml,v 1.43 2009/12/30 22:48:10 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>. The only effective
2847 difference between this view
2848 and <literal>column_privileges</literal> is that this view omits
2849 columns that have been made accessible to the current user by way
2850 of a grant to public.
2854 <title><literal>role_column_grants</literal> Columns</title>
2860 <entry>Data Type</entry>
2861 <entry>Description</entry>
2867 <entry><literal>grantor</literal></entry>
2868 <entry><type>sql_identifier</type></entry>
2869 <entry>Name of the role that granted the privilege</entry>
2873 <entry><literal>grantee</literal></entry>
2874 <entry><type>sql_identifier</type></entry>
2875 <entry>Name of the role that the privilege was granted to</entry>
2879 <entry><literal>table_catalog</literal></entry>
2880 <entry><type>sql_identifier</type></entry>
2881 <entry>Name of the database that contains the table that contains the column (always the current database)</entry>
2885 <entry><literal>table_schema</literal></entry>
2886 <entry><type>sql_identifier</type></entry>
2887 <entry>Name of the schema that contains the table that contains the column</entry>
2891 <entry><literal>table_name</literal></entry>
2892 <entry><type>sql_identifier</type></entry>
2893 <entry>Name of the table that contains the column</entry>
2897 <entry><literal>column_name</literal></entry>
2898 <entry><type>sql_identifier</type></entry>
2899 <entry>Name of the column</entry>
2903 <entry><literal>privilege_type</literal></entry>
2904 <entry><type>character_data</type></entry>
2906 Type of the privilege: <literal>SELECT</literal>,
2907 <literal>INSERT</literal>, <literal>UPDATE</literal>, or
2908 <literal>REFERENCES</literal>
2913 <entry><literal>is_grantable</literal></entry>
2914 <entry><type>yes_or_no</type></entry>
2915 <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
2922 <sect1 id="infoschema-role-routine-grants">
2923 <title><literal>role_routine_grants</literal></title>
2926 The view <literal>role_routine_grants</literal> identifies all
2927 privileges granted on functions where the grantor or grantee is a
2928 currently enabled role. Further information can be found under
2929 <literal>routine_privileges</literal>. The only effective
2930 difference between this view
2931 and <literal>routine_privileges</literal> is that this view omits
2932 functions that have been made accessible to the current user by way
2933 of a grant to public.
2937 <title><literal>role_routine_grants</literal> Columns</title>
2943 <entry>Data Type</entry>
2944 <entry>Description</entry>
2950 <entry><literal>grantor</literal></entry>
2951 <entry><type>sql_identifier</type></entry>
2952 <entry>Name of the role that granted the privilege</entry>
2956 <entry><literal>grantee</literal></entry>
2957 <entry><type>sql_identifier</type></entry>
2958 <entry>Name of the role that the privilege was granted to</entry>
2962 <entry><literal>specific_catalog</literal></entry>
2963 <entry><type>sql_identifier</type></entry>
2964 <entry>Name of the database containing the function (always the current database)</entry>
2968 <entry><literal>specific_schema</literal></entry>
2969 <entry><type>sql_identifier</type></entry>
2970 <entry>Name of the schema containing the function</entry>
2974 <entry><literal>specific_name</literal></entry>
2975 <entry><type>sql_identifier</type></entry>
2977 The <quote>specific name</quote> of the function. See <xref
2978 linkend="infoschema-routines"> for more information.
2983 <entry><literal>routine_catalog</literal></entry>
2984 <entry><type>sql_identifier</type></entry>
2985 <entry>Name of the database containing the function (always the current database)</entry>
2989 <entry><literal>routine_schema</literal></entry>
2990 <entry><type>sql_identifier</type></entry>
2991 <entry>Name of the schema containing the function</entry>
2995 <entry><literal>routine_name</literal></entry>
2996 <entry><type>sql_identifier</type></entry>
2997 <entry>Name of the function (might be duplicated in case of overloading)</entry>
3001 <entry><literal>privilege_type</literal></entry>
3002 <entry><type>character_data</type></entry>
3003 <entry>Always <literal>EXECUTE</literal> (the only privilege type for functions)</entry>
3007 <entry><literal>is_grantable</literal></entry>
3008 <entry><type>yes_or_no</type></entry>
3009 <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
3016 <sect1 id="infoschema-role-table-grants">
3017 <title><literal>role_table_grants</literal></title>
3020 The view <literal>role_table_grants</literal> identifies all
3021 privileges granted on tables or views where the grantor or grantee
3022 is a currently enabled role. Further information can be found
3023 under <literal>table_privileges</literal>. The only effective
3024 difference between this view
3025 and <literal>table_privileges</literal> is that this view omits
3026 tables that have been made accessible to the current user by way of
3031 <title><literal>role_table_grants</literal> Columns</title>
3037 <entry>Data Type</entry>
3038 <entry>Description</entry>
3044 <entry><literal>grantor</literal></entry>
3045 <entry><type>sql_identifier</type></entry>
3046 <entry>Name of the role that granted the privilege</entry>
3050 <entry><literal>grantee</literal></entry>
3051 <entry><type>sql_identifier</type></entry>
3052 <entry>Name of the role that the privilege was granted to</entry>
3056 <entry><literal>table_catalog</literal></entry>
3057 <entry><type>sql_identifier</type></entry>
3058 <entry>Name of the database that contains the table (always the current database)</entry>
3062 <entry><literal>table_schema</literal></entry>
3063 <entry><type>sql_identifier</type></entry>
3064 <entry>Name of the schema that contains the table</entry>
3068 <entry><literal>table_name</literal></entry>
3069 <entry><type>sql_identifier</type></entry>
3070 <entry>Name of the table</entry>
3074 <entry><literal>privilege_type</literal></entry>
3075 <entry><type>character_data</type></entry>
3077 Type of the privilege: <literal>SELECT</literal>,
3078 <literal>INSERT</literal>, <literal>UPDATE</literal>,
3079 <literal>DELETE</literal>, <literal>TRUNCATE</literal>,
3080 <literal>REFERENCES</literal>, or <literal>TRIGGER</literal>
3085 <entry><literal>is_grantable</literal></entry>
3086 <entry><type>yes_or_no</type></entry>
3087 <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
3091 <entry><literal>with_hierarchy</literal></entry>
3092 <entry><type>yes_or_no</type></entry>
3093 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3100 <sect1 id="infoschema-role-usage-grants">
3101 <title><literal>role_usage_grants</literal></title>
3104 The view <literal>role_usage_grants</literal> identifies
3105 <literal>USAGE</literal> privileges granted on various kinds of
3106 objects where the grantor or grantee is a currently enabled role.
3107 Further information can be found under
3108 <literal>usage_privileges</literal>. The only effective difference
3109 between this view and <literal>usage_privileges</literal> is that
3110 this view omits objects that have been made accessible to the
3111 current user by way of a grant to public.
3115 <title><literal>role_usage_grants</literal> Columns</title>
3121 <entry>Data Type</entry>
3122 <entry>Description</entry>
3128 <entry><literal>grantor</literal></entry>
3129 <entry><type>sql_identifier</type></entry>
3130 <entry>The name of the role that granted the privilege</entry>
3134 <entry><literal>grantee</literal></entry>
3135 <entry><type>sql_identifier</type></entry>
3136 <entry>The name of the role that the privilege was granted to</entry>
3140 <entry><literal>object_catalog</literal></entry>
3141 <entry><type>sql_identifier</type></entry>
3142 <entry>Name of the database containing the object (always the current database)</entry>
3146 <entry><literal>object_schema</literal></entry>
3147 <entry><type>sql_identifier</type></entry>
3148 <entry>Name of the schema containing the object, if applicable,
3149 else an empty string</entry>
3153 <entry><literal>object_name</literal></entry>
3154 <entry><type>sql_identifier</type></entry>
3155 <entry>Name of the object</entry>
3159 <entry><literal>object_type</literal></entry>
3160 <entry><type>character_data</type></entry>
3161 <entry><literal>DOMAIN</literal> or <literal>FOREIGN DATA WRAPPER</literal> or <literal>FOREIGN SERVER</literal></entry>
3165 <entry><literal>privilege_type</literal></entry>
3166 <entry><type>character_data</type></entry>
3167 <entry>Always <literal>USAGE</literal></entry>
3171 <entry><literal>is_grantable</literal></entry>
3172 <entry><type>yes_or_no</type></entry>
3173 <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
3180 <sect1 id="infoschema-routine-privileges">
3181 <title><literal>routine_privileges</literal></title>
3184 The view <literal>routine_privileges</literal> identifies all
3185 privileges granted on functions to a currently enabled role or by a
3186 currently enabled role. There is one row for each combination of function,
3187 grantor, and grantee.
3191 <title><literal>routine_privileges</literal> Columns</title>
3197 <entry>Data Type</entry>
3198 <entry>Description</entry>
3204 <entry><literal>grantor</literal></entry>
3205 <entry><type>sql_identifier</type></entry>
3206 <entry>Name of the role that granted the privilege</entry>
3210 <entry><literal>grantee</literal></entry>
3211 <entry><type>sql_identifier</type></entry>
3212 <entry>Name of the role that the privilege was granted to</entry>
3216 <entry><literal>specific_catalog</literal></entry>
3217 <entry><type>sql_identifier</type></entry>
3218 <entry>Name of the database containing the function (always the current database)</entry>
3222 <entry><literal>specific_schema</literal></entry>
3223 <entry><type>sql_identifier</type></entry>
3224 <entry>Name of the schema containing the function</entry>
3228 <entry><literal>specific_name</literal></entry>
3229 <entry><type>sql_identifier</type></entry>
3231 The <quote>specific name</quote> of the function. See <xref
3232 linkend="infoschema-routines"> for more information.
3237 <entry><literal>routine_catalog</literal></entry>
3238 <entry><type>sql_identifier</type></entry>
3239 <entry>Name of the database containing the function (always the current database)</entry>
3243 <entry><literal>routine_schema</literal></entry>
3244 <entry><type>sql_identifier</type></entry>
3245 <entry>Name of the schema containing the function</entry>
3249 <entry><literal>routine_name</literal></entry>
3250 <entry><type>sql_identifier</type></entry>
3251 <entry>Name of the function (might be duplicated in case of overloading)</entry>
3255 <entry><literal>privilege_type</literal></entry>
3256 <entry><type>character_data</type></entry>
3257 <entry>Always <literal>EXECUTE</literal> (the only privilege type for functions)</entry>
3261 <entry><literal>is_grantable</literal></entry>
3262 <entry><type>yes_or_no</type></entry>
3263 <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
3270 <sect1 id="infoschema-routines">
3271 <title><literal>routines</literal></title>
3274 The view <literal>routines</literal> contains all functions in the
3275 current database. Only those functions are shown that the current
3276 user has access to (by way of being the owner or having some
3281 <title><literal>routines</literal> Columns</title>
3287 <entry>Data Type</entry>
3288 <entry>Description</entry>
3294 <entry><literal>specific_catalog</literal></entry>
3295 <entry><type>sql_identifier</type></entry>
3296 <entry>Name of the database containing the function (always the current database)</entry>
3300 <entry><literal>specific_schema</literal></entry>
3301 <entry><type>sql_identifier</type></entry>
3302 <entry>Name of the schema containing the function</entry>
3306 <entry><literal>specific_name</literal></entry>
3307 <entry><type>sql_identifier</type></entry>
3309 The <quote>specific name</quote> of the function. This is a
3310 name that uniquely identifies the function in the schema, even
3311 if the real name of the function is overloaded. The format of
3312 the specific name is not defined, it should only be used to
3313 compare it to other instances of specific routine names.
3318 <entry><literal>routine_catalog</literal></entry>
3319 <entry><type>sql_identifier</type></entry>
3320 <entry>Name of the database containing the function (always the current database)</entry>
3324 <entry><literal>routine_schema</literal></entry>
3325 <entry><type>sql_identifier</type></entry>
3326 <entry>Name of the schema containing the function</entry>
3330 <entry><literal>routine_name</literal></entry>
3331 <entry><type>sql_identifier</type></entry>
3332 <entry>Name of the function (might be duplicated in case of overloading)</entry>
3336 <entry><literal>routine_type</literal></entry>
3337 <entry><type>character_data</type></entry>
3339 Always <literal>FUNCTION</literal> (In the future there might
3340 be other types of routines.)
3345 <entry><literal>module_catalog</literal></entry>
3346 <entry><type>sql_identifier</type></entry>
3347 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3351 <entry><literal>module_schema</literal></entry>
3352 <entry><type>sql_identifier</type></entry>
3353 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3357 <entry><literal>module_name</literal></entry>
3358 <entry><type>sql_identifier</type></entry>
3359 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3363 <entry><literal>udt_catalog</literal></entry>
3364 <entry><type>sql_identifier</type></entry>
3365 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3369 <entry><literal>udt_schema</literal></entry>
3370 <entry><type>sql_identifier</type></entry>
3371 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3375 <entry><literal>udt_name</literal></entry>
3376 <entry><type>sql_identifier</type></entry>
3377 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3381 <entry><literal>data_type</literal></entry>
3382 <entry><type>character_data</type></entry>
3384 Return data type of the function, if it is a built-in type, or
3385 <literal>ARRAY</literal> if it is some array (in that case, see
3386 the view <literal>element_types</literal>), else
3387 <literal>USER-DEFINED</literal> (in that case, the type is
3388 identified in <literal>type_udt_name</literal> and associated
3394 <entry><literal>character_maximum_length</literal></entry>
3395 <entry><type>cardinal_number</type></entry>
3396 <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
3400 <entry><literal>character_octet_length</literal></entry>
3401 <entry><type>cardinal_number</type></entry>
3402 <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
3406 <entry><literal>character_set_catalog</literal></entry>
3407 <entry><type>sql_identifier</type></entry>
3408 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3412 <entry><literal>character_set_schema</literal></entry>
3413 <entry><type>sql_identifier</type></entry>
3414 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3418 <entry><literal>character_set_name</literal></entry>
3419 <entry><type>sql_identifier</type></entry>
3420 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3424 <entry><literal>collation_catalog</literal></entry>
3425 <entry><type>sql_identifier</type></entry>
3426 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3430 <entry><literal>collation_schema</literal></entry>
3431 <entry><type>sql_identifier</type></entry>
3432 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3436 <entry><literal>collation_name</literal></entry>
3437 <entry><type>sql_identifier</type></entry>
3438 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3442 <entry><literal>numeric_precision</literal></entry>
3443 <entry><type>cardinal_number</type></entry>
3444 <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
3448 <entry><literal>numeric_precision_radix</literal></entry>
3449 <entry><type>cardinal_number</type></entry>
3450 <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
3454 <entry><literal>numeric_scale</literal></entry>
3455 <entry><type>cardinal_number</type></entry>
3456 <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
3460 <entry><literal>datetime_precision</literal></entry>
3461 <entry><type>cardinal_number</type></entry>
3462 <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
3466 <entry><literal>interval_type</literal></entry>
3467 <entry><type>character_data</type></entry>
3468 <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
3472 <entry><literal>interval_precision</literal></entry>
3473 <entry><type>character_data</type></entry>
3474 <entry>Always null, since this information is not applied to return data types in <productname>PostgreSQL</></entry>
3478 <entry><literal>type_udt_catalog</literal></entry>
3479 <entry><type>sql_identifier</type></entry>
3481 Name of the database that the return data type of the function
3482 is defined in (always the current database)
3487 <entry><literal>type_udt_schema</literal></entry>
3488 <entry><type>sql_identifier</type></entry>
3490 Name of the schema that the return data type of the function is
3496 <entry><literal>type_udt_name</literal></entry>
3497 <entry><type>sql_identifier</type></entry>
3499 Name of the return data type of the function
3504 <entry><literal>scope_catalog</literal></entry>
3505 <entry><type>sql_identifier</type></entry>
3506 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3510 <entry><literal>scope_schema</literal></entry>
3511 <entry><type>sql_identifier</type></entry>
3512 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3516 <entry><literal>scope_name</literal></entry>
3517 <entry><type>sql_identifier</type></entry>
3518 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3522 <entry><literal>maximum_cardinality</literal></entry>
3523 <entry><type>cardinal_number</type></entry>
3524 <entry>Always null, because arrays always have unlimited maximum cardinality in <productname>PostgreSQL</></entry>
3528 <entry><literal>dtd_identifier</literal></entry>
3529 <entry><type>sql_identifier</type></entry>
3531 An identifier of the data type descriptor of the return data
3532 type of this function, unique among the data type descriptors
3533 pertaining to the function. This is mainly useful for joining
3534 with other instances of such identifiers. (The specific format
3535 of the identifier is not defined and not guaranteed to remain
3536 the same in future versions.)
3541 <entry><literal>routine_body</literal></entry>
3542 <entry><type>character_data</type></entry>
3544 If the function is an SQL function, then
3545 <literal>SQL</literal>, else <literal>EXTERNAL</literal>.
3550 <entry><literal>routine_definition</literal></entry>
3551 <entry><type>character_data</type></entry>
3553 The source text of the function (null if the function is not
3554 owned by a currently enabled role). (According to the SQL
3555 standard, this column is only applicable if
3556 <literal>routine_body</literal> is <literal>SQL</literal>, but
3557 in <productname>PostgreSQL</productname> it will contain
3558 whatever source text was specified when the function was
3564 <entry><literal>external_name</literal></entry>
3565 <entry><type>character_data</type></entry>
3567 If this function is a C function, then the external name (link
3568 symbol) of the function; else null. (This works out to be the
3569 same value that is shown in
3570 <literal>routine_definition</literal>.)
3575 <entry><literal>external_language</literal></entry>
3576 <entry><type>character_data</type></entry>
3577 <entry>The language the function is written in</entry>
3581 <entry><literal>parameter_style</literal></entry>
3582 <entry><type>character_data</type></entry>
3584 Always <literal>GENERAL</literal> (The SQL standard defines
3585 other parameter styles, which are not available in <productname>PostgreSQL</>.)
3590 <entry><literal>is_deterministic</literal></entry>
3591 <entry><type>yes_or_no</type></entry>
3593 If the function is declared immutable (called deterministic in
3594 the SQL standard), then <literal>YES</literal>, else
3595 <literal>NO</literal>. (You cannot query the other volatility
3596 levels available in <productname>PostgreSQL</> through the information schema.)
3601 <entry><literal>sql_data_access</literal></entry>
3602 <entry><type>character_data</type></entry>
3604 Always <literal>MODIFIES</literal>, meaning that the function
3605 possibly modifies SQL data. This information is not useful for
3606 <productname>PostgreSQL</>.
3611 <entry><literal>is_null_call</literal></entry>
3612 <entry><type>yes_or_no</type></entry>
3614 If the function automatically returns null if any of its
3615 arguments are null, then <literal>YES</literal>, else
3616 <literal>NO</literal>.
3621 <entry><literal>sql_path</literal></entry>
3622 <entry><type>character_data</type></entry>
3623 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3627 <entry><literal>schema_level_routine</literal></entry>
3628 <entry><type>yes_or_no</type></entry>
3630 Always <literal>YES</literal> (The opposite would be a method
3631 of a user-defined type, which is a feature not available in
3632 <productname>PostgreSQL</>.)
3637 <entry><literal>max_dynamic_result_sets</literal></entry>
3638 <entry><type>cardinal_number</type></entry>
3639 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3643 <entry><literal>is_user_defined_cast</literal></entry>
3644 <entry><type>yes_or_no</type></entry>
3645 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3649 <entry><literal>is_implicitly_invocable</literal></entry>
3650 <entry><type>yes_or_no</type></entry>
3651 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3655 <entry><literal>security_type</literal></entry>
3656 <entry><type>character_data</type></entry>
3658 If the function runs with the privileges of the current user,
3659 then <literal>INVOKER</literal>, if the function runs with the
3660 privileges of the user who defined it, then
3661 <literal>DEFINER</literal>.
3666 <entry><literal>to_sql_specific_catalog</literal></entry>
3667 <entry><type>sql_identifier</type></entry>
3668 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3672 <entry><literal>to_sql_specific_schema</literal></entry>
3673 <entry><type>sql_identifier</type></entry>
3674 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3678 <entry><literal>to_sql_specific_name</literal></entry>
3679 <entry><type>sql_identifier</type></entry>
3680 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3684 <entry><literal>as_locator</literal></entry>
3685 <entry><type>yes_or_no</type></entry>
3686 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3690 <entry><literal>created</literal></entry>
3691 <entry><type>time_stamp</type></entry>
3692 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3696 <entry><literal>last_altered</literal></entry>
3697 <entry><type>time_stamp</type></entry>
3698 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3702 <entry><literal>new_savepoint_level</literal></entry>
3703 <entry><type>yes_or_no</type></entry>
3704 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3708 <entry><literal>is_udt_dependent</literal></entry>
3709 <entry><type>yes_or_no</type></entry>
3710 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3714 <entry><literal>result_cast_from_data_type</literal></entry>
3715 <entry><type>character_data</type></entry>
3716 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3720 <entry><literal>result_cast_as_locator</literal></entry>
3721 <entry><type>yes_or_no</type></entry>
3722 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3726 <entry><literal>result_cast_char_max_length</literal></entry>
3727 <entry><type>cardinal_number</type></entry>
3728 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3732 <entry><literal>result_cast_char_octet_length</literal></entry>
3733 <entry><type>character_data</type></entry>
3734 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3738 <entry><literal>result_cast_char_set_catalog</literal></entry>
3739 <entry><type>sql_identifier</type></entry>
3740 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3744 <entry><literal>result_cast_char_set_schema</literal></entry>
3745 <entry><type>sql_identifier</type></entry>
3746 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3750 <entry><literal>result_cast_char_set_name</literal></entry>
3751 <entry><type>sql_identifier</type></entry>
3752 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3756 <entry><literal>result_cast_collation_catalog</literal></entry>
3757 <entry><type>sql_identifier</type></entry>
3758 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3762 <entry><literal>result_cast_collation_schema</literal></entry>
3763 <entry><type>sql_identifier</type></entry>
3764 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3768 <entry><literal>result_cast_collation_name</literal></entry>
3769 <entry><type>sql_identifier</type></entry>
3770 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3774 <entry><literal>result_cast_numeric_precision</literal></entry>
3775 <entry><type>cardinal_number</type></entry>
3776 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3780 <entry><literal>result_cast_numeric_precision_radix</literal></entry>
3781 <entry><type>cardinal_number</type></entry>
3782 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3786 <entry><literal>result_cast_numeric_scale</literal></entry>
3787 <entry><type>cardinal_number</type></entry>
3788 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3792 <entry><literal>result_cast_datetime_precision</literal></entry>
3793 <entry><type>character_data</type></entry>
3794 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3798 <entry><literal>result_cast_interval_type</literal></entry>
3799 <entry><type>character_data</type></entry>
3800 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3804 <entry><literal>result_cast_interval_precision</literal></entry>
3805 <entry><type>character_data</type></entry>
3806 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3810 <entry><literal>result_cast_type_udt_catalog</literal></entry>
3811 <entry><type>sql_identifier</type></entry>
3812 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3816 <entry><literal>result_cast_type_udt_schema</literal></entry>
3817 <entry><type>sql_identifier</type></entry>
3818 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3822 <entry><literal>result_cast_type_udt_name</literal></entry>
3823 <entry><type>sql_identifier</type></entry>
3824 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3828 <entry><literal>result_cast_scope_catalog</literal></entry>
3829 <entry><type>sql_identifier</type></entry>
3830 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3834 <entry><literal>result_cast_scope_schema</literal></entry>
3835 <entry><type>sql_identifier</type></entry>
3836 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3840 <entry><literal>result_cast_scope_name</literal></entry>
3841 <entry><type>sql_identifier</type></entry>
3842 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3846 <entry><literal>result_cast_maximum_cardinality</literal></entry>
3847 <entry><type>cardinal_number</type></entry>
3848 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3852 <entry><literal>result_cast_dtd_identifier</literal></entry>
3853 <entry><type>sql_identifier</type></entry>
3854 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3861 <sect1 id="infoschema-schemata">
3862 <title><literal>schemata</literal></title>
3865 The view <literal>schemata</literal> contains all schemas in the
3866 current database that are owned by a currently enabled role.
3870 <title><literal>schemata</literal> Columns</title>
3876 <entry>Data Type</entry>
3877 <entry>Description</entry>
3883 <entry><literal>catalog_name</literal></entry>
3884 <entry><type>sql_identifier</type></entry>
3885 <entry>Name of the database that the schema is contained in (always the current database)</entry>
3889 <entry><literal>schema_name</literal></entry>
3890 <entry><type>sql_identifier</type></entry>
3891 <entry>Name of the schema</entry>
3895 <entry><literal>schema_owner</literal></entry>
3896 <entry><type>sql_identifier</type></entry>
3897 <entry>Name of the owner of the schema</entry>
3901 <entry><literal>default_character_set_catalog</literal></entry>
3902 <entry><type>sql_identifier</type></entry>
3903 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3907 <entry><literal>default_character_set_schema</literal></entry>
3908 <entry><type>sql_identifier</type></entry>
3909 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3913 <entry><literal>default_character_set_name</literal></entry>
3914 <entry><type>sql_identifier</type></entry>
3915 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3919 <entry><literal>sql_path</literal></entry>
3920 <entry><type>character_data</type></entry>
3921 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
3928 <sect1 id="infoschema-sequences">
3929 <title><literal>sequences</literal></title>
3932 The view <literal>sequences</literal> contains all sequences
3933 defined in the current database. Only those sequences are shown
3934 that the current user has access to (by way of being the owner or
3935 having some privilege).
3939 <title><literal>sequences</literal> Columns</title>
3945 <entry>Data Type</entry>
3946 <entry>Description</entry>
3952 <entry><literal>sequence_catalog</literal></entry>
3953 <entry><type>sql_identifier</type></entry>
3954 <entry>Name of the database that contains the sequence (always the current database)</entry>
3958 <entry><literal>sequence_schema</literal></entry>
3959 <entry><type>sql_identifier</type></entry>
3960 <entry>Name of the schema that contains the sequence</entry>
3964 <entry><literal>sequence_name</literal></entry>
3965 <entry><type>sql_identifier</type></entry>
3966 <entry>Name of the sequence</entry>
3970 <entry><literal>data_type</literal></entry>
3971 <entry><type>character_data</type></entry>
3973 The data type of the sequence. In
3974 <productname>PostgreSQL</productname>, this is currently always
3975 <literal>bigint</literal>.
3980 <entry><literal>numeric_precision</literal></entry>
3981 <entry><type>cardinal_number</type></entry>
3983 This column contains the (declared or implicit) precision of
3984 the sequence data type (see above). The precision indicates
3985 the number of significant digits. It can be expressed in
3986 decimal (base 10) or binary (base 2) terms, as specified in the
3987 column <literal>numeric_precision_radix</literal>.
3992 <entry><literal>numeric_precision_radix</literal></entry>
3993 <entry><type>cardinal_number</type></entry>
3995 This column indicates in which base the values in the columns
3996 <literal>numeric_precision</literal> and
3997 <literal>numeric_scale</literal> are expressed. The value is
4003 <entry><literal>numeric_scale</literal></entry>
4004 <entry><type>cardinal_number</type></entry>
4006 This column contains the (declared or implicit) scale of the
4007 sequence data type (see above). The scale indicates the number
4008 of significant digits to the right of the decimal point. It
4009 can be expressed in decimal (base 10) or binary (base 2) terms,
4010 as specified in the column
4011 <literal>numeric_precision_radix</literal>.
4016 <entry><literal>maximum_value</literal></entry>
4017 <entry><type>cardinal_number</type></entry>
4018 <entry>Not yet implemented</entry>
4022 <entry><literal>minimum_value</literal></entry>
4023 <entry><type>cardinal_number</type></entry>
4024 <entry>Not yet implemented</entry>
4028 <entry><literal>increment</literal></entry>
4029 <entry><type>cardinal_number</type></entry>
4030 <entry>Not yet implemented</entry>
4034 <entry><literal>cycle_option</literal></entry>
4035 <entry><type>yes_or_no</type></entry>
4036 <entry>Not yet implemented</entry>
4043 <sect1 id="infoschema-sql-features">
4044 <title><literal>sql_features</literal></title>
4047 The table <literal>sql_features</literal> contains information
4048 about which formal features defined in the SQL standard are
4049 supported by <productname>PostgreSQL</productname>. This is the
4050 same information that is presented in <xref linkend="features">.
4051 There you can also find some additional background information.
4055 <title><literal>sql_features</literal> Columns</title>
4061 <entry>Data Type</entry>
4062 <entry>Description</entry>
4068 <entry><literal>feature_id</literal></entry>
4069 <entry><type>character_data</type></entry>
4070 <entry>Identifier string of the feature</entry>
4074 <entry><literal>feature_name</literal></entry>
4075 <entry><type>character_data</type></entry>
4076 <entry>Descriptive name of the feature</entry>
4080 <entry><literal>sub_feature_id</literal></entry>
4081 <entry><type>character_data</type></entry>
4082 <entry>Identifier string of the subfeature, or a zero-length string if not a subfeature</entry>
4086 <entry><literal>sub_feature_name</literal></entry>
4087 <entry><type>character_data</type></entry>
4088 <entry>Descriptive name of the subfeature, or a zero-length string if not a subfeature</entry>
4092 <entry><literal>is_supported</literal></entry>
4093 <entry><type>yes_or_no</type></entry>
4095 <literal>YES</literal> if the feature is fully supported by the
4096 current version of <productname>PostgreSQL</>, <literal>NO</literal> if not
4101 <entry><literal>is_verified_by</literal></entry>
4102 <entry><type>character_data</type></entry>
4104 Always null, since the <productname>PostgreSQL</> development group does not
4105 perform formal testing of feature conformance
4110 <entry><literal>comments</literal></entry>
4111 <entry><type>character_data</type></entry>
4112 <entry>Possibly a comment about the supported status of the feature</entry>
4119 <sect1 id="infoschema-sql-implementation-info">
4120 <title><literal>sql_implementation_info</literal></title>
4123 The table <literal>sql_implementation_info</literal> contains
4124 information about various aspects that are left
4125 implementation-defined by the SQL standard. This information is
4126 primarily intended for use in the context of the ODBC interface;
4127 users of other interfaces will probably find this information to be
4128 of little use. For this reason, the individual implementation
4129 information items are not described here; you will find them in the
4130 description of the ODBC interface.
4134 <title><literal>sql_implementation_info</literal> Columns</title>
4140 <entry>Data Type</entry>
4141 <entry>Description</entry>
4147 <entry><literal>implementation_info_id</literal></entry>
4148 <entry><type>character_data</type></entry>
4149 <entry>Identifier string of the implementation information item</entry>
4153 <entry><literal>implementation_info_name</literal></entry>
4154 <entry><type>character_data</type></entry>
4155 <entry>Descriptive name of the implementation information item</entry>
4159 <entry><literal>integer_value</literal></entry>
4160 <entry><type>cardinal_number</type></entry>
4162 Value of the implementation information item, or null if the
4163 value is contained in the column
4164 <literal>character_value</literal>
4169 <entry><literal>character_value</literal></entry>
4170 <entry><type>character_data</type></entry>
4172 Value of the implementation information item, or null if the
4173 value is contained in the column
4174 <literal>integer_value</literal>
4179 <entry><literal>comments</literal></entry>
4180 <entry><type>character_data</type></entry>
4181 <entry>Possibly a comment pertaining to the implementation information item</entry>
4188 <sect1 id="infoschema-sql-languages">
4189 <title><literal>sql_languages</literal></title>
4192 The table <literal>sql_languages</literal> contains one row for
4193 each SQL language binding that is supported by
4194 <productname>PostgreSQL</productname>.
4195 <productname>PostgreSQL</productname> supports direct SQL and
4196 embedded SQL in C; that is all you will learn from this table.
4200 <title><literal>sql_languages</literal> Columns</title>
4206 <entry>Data Type</entry>
4207 <entry>Description</entry>
4213 <entry><literal>sql_language_source</literal></entry>
4214 <entry><type>character_data</type></entry>
4216 The name of the source of the language definition; always
4217 <literal>ISO 9075</literal>, that is, the SQL standard
4222 <entry><literal>sql_language_year</literal></entry>
4223 <entry><type>character_data</type></entry>
4225 The year the standard referenced in
4226 <literal>sql_language_source</literal> was approved; currently
4232 <entry><literal>sql_language_conformance</literal></entry>
4233 <entry><type>character_data</type></entry>
4235 The standard conformance level for the language binding. For
4236 ISO 9075:2003 this is always <literal>CORE</literal>.
4241 <entry><literal>sql_language_integrity</literal></entry>
4242 <entry><type>character_data</type></entry>
4243 <entry>Always null (This value is relevant to an earlier version of the SQL standard.)</entry>
4247 <entry><literal>sql_language_implementation</literal></entry>
4248 <entry><type>character_data</type></entry>
4249 <entry>Always null</entry>
4253 <entry><literal>sql_language_binding_style</literal></entry>
4254 <entry><type>character_data</type></entry>
4256 The language binding style, either <literal>DIRECT</literal> or
4257 <literal>EMBEDDED</literal>
4262 <entry><literal>sql_language_programming_language</literal></entry>
4263 <entry><type>character_data</type></entry>
4265 The programming language, if the binding style is
4266 <literal>EMBEDDED</literal>, else null. <productname>PostgreSQL</> only
4267 supports the language C.
4275 <sect1 id="infoschema-sql-packages">
4276 <title><literal>sql_packages</literal></title>
4279 The table <literal>sql_packages</literal> contains information
4280 about which feature packages defined in the SQL standard are
4281 supported by <productname>PostgreSQL</productname>. Refer to <xref
4282 linkend="features"> for background information on feature packages.
4286 <title><literal>sql_packages</literal> Columns</title>
4292 <entry>Data Type</entry>
4293 <entry>Description</entry>
4299 <entry><literal>feature_id</literal></entry>
4300 <entry><type>character_data</type></entry>
4301 <entry>Identifier string of the package</entry>
4305 <entry><literal>feature_name</literal></entry>
4306 <entry><type>character_data</type></entry>
4307 <entry>Descriptive name of the package</entry>
4311 <entry><literal>is_supported</literal></entry>
4312 <entry><type>yes_or_no</type></entry>
4314 <literal>YES</literal> if the package is fully supported by the
4315 current version of <productname>PostgreSQL</>, <literal>NO</literal> if not
4320 <entry><literal>is_verified_by</literal></entry>
4321 <entry><type>character_data</type></entry>
4323 Always null, since the <productname>PostgreSQL</> development group does not
4324 perform formal testing of feature conformance
4329 <entry><literal>comments</literal></entry>
4330 <entry><type>character_data</type></entry>
4331 <entry>Possibly a comment about the supported status of the package</entry>
4338 <sect1 id="infoschema-sql-parts">
4339 <title><literal>sql_parts</literal></title>
4342 The table <literal>sql_parts</literal> contains information about
4343 which of the several parts of the SQL standard are supported by
4344 <productname>PostgreSQL</productname>.
4348 <title><literal>sql_parts</literal> Columns</title>
4354 <entry>Data Type</entry>
4355 <entry>Description</entry>
4361 <entry><literal>feature_id</literal></entry>
4362 <entry><type>character_data</type></entry>
4363 <entry>An identifier string containing the number of the part</entry>
4367 <entry><literal>feature_name</literal></entry>
4368 <entry><type>character_data</type></entry>
4369 <entry>Descriptive name of the part</entry>
4373 <entry><literal>is_supported</literal></entry>
4374 <entry><type>yes_or_no</type></entry>
4376 <literal>YES</literal> if the part is fully supported by the
4377 current version of <productname>PostgreSQL</>,
4378 <literal>NO</literal> if not
4383 <entry><literal>is_verified_by</literal></entry>
4384 <entry><type>character_data</type></entry>
4386 Always null, since the <productname>PostgreSQL</> development group does not
4387 perform formal testing of feature conformance
4392 <entry><literal>comments</literal></entry>
4393 <entry><type>character_data</type></entry>
4394 <entry>Possibly a comment about the supported status of the part</entry>
4401 <sect1 id="infoschema-sql-sizing">
4402 <title><literal>sql_sizing</literal></title>
4405 The table <literal>sql_sizing</literal> contains information about
4406 various size limits and maximum values in
4407 <productname>PostgreSQL</productname>. This information is
4408 primarily intended for use in the context of the ODBC interface;
4409 users of other interfaces will probably find this information to be
4410 of little use. For this reason, the individual sizing items are
4411 not described here; you will find them in the description of the
4416 <title><literal>sql_sizing</literal> Columns</title>
4422 <entry>Data Type</entry>
4423 <entry>Description</entry>
4429 <entry><literal>sizing_id</literal></entry>
4430 <entry><type>cardinal_number</type></entry>
4431 <entry>Identifier of the sizing item</entry>
4435 <entry><literal>sizing_name</literal></entry>
4436 <entry><type>character_data</type></entry>
4437 <entry>Descriptive name of the sizing item</entry>
4441 <entry><literal>supported_value</literal></entry>
4442 <entry><type>cardinal_number</type></entry>
4444 Value of the sizing item, or 0 if the size is unlimited or
4445 cannot be determined, or null if the features for which the
4446 sizing item is applicable are not supported
4451 <entry><literal>comments</literal></entry>
4452 <entry><type>character_data</type></entry>
4453 <entry>Possibly a comment pertaining to the sizing item</entry>
4460 <sect1 id="infoschema-sql-sizing-profiles">
4461 <title><literal>sql_sizing_profiles</literal></title>
4464 The table <literal>sql_sizing_profiles</literal> contains
4465 information about the <literal>sql_sizing</literal> values that are
4466 required by various profiles of the SQL standard. <productname>PostgreSQL</> does
4467 not track any SQL profiles, so this table is empty.
4471 <title><literal>sql_sizing_profiles</literal> Columns</title>
4477 <entry>Data Type</entry>
4478 <entry>Description</entry>
4484 <entry><literal>sizing_id</literal></entry>
4485 <entry><type>cardinal_number</type></entry>
4486 <entry>Identifier of the sizing item</entry>
4490 <entry><literal>sizing_name</literal></entry>
4491 <entry><type>character_data</type></entry>
4492 <entry>Descriptive name of the sizing item</entry>
4496 <entry><literal>profile_id</literal></entry>
4497 <entry><type>character_data</type></entry>
4498 <entry>Identifier string of a profile</entry>
4502 <entry><literal>required_value</literal></entry>
4503 <entry><type>cardinal_number</type></entry>
4505 The value required by the SQL profile for the sizing item, or 0
4506 if the profile places no limit on the sizing item, or null if
4507 the profile does not require any of the features for which the
4508 sizing item is applicable
4513 <entry><literal>comments</literal></entry>
4514 <entry><type>character_data</type></entry>
4515 <entry>Possibly a comment pertaining to the sizing item within the profile</entry>
4522 <sect1 id="infoschema-table-constraints">
4523 <title><literal>table_constraints</literal></title>
4526 The view <literal>table_constraints</literal> contains all
4527 constraints belonging to tables that the current user owns or has
4528 some non-SELECT privilege on.
4532 <title><literal>table_constraints</literal> Columns</title>
4538 <entry>Data Type</entry>
4539 <entry>Description</entry>
4545 <entry><literal>constraint_catalog</literal></entry>
4546 <entry><type>sql_identifier</type></entry>
4547 <entry>Name of the database that contains the constraint (always the current database)</entry>
4551 <entry><literal>constraint_schema</literal></entry>
4552 <entry><type>sql_identifier</type></entry>
4553 <entry>Name of the schema that contains the constraint</entry>
4557 <entry><literal>constraint_name</literal></entry>
4558 <entry><type>sql_identifier</type></entry>
4559 <entry>Name of the constraint</entry>
4563 <entry><literal>table_catalog</literal></entry>
4564 <entry><type>sql_identifier</type></entry>
4565 <entry>Name of the database that contains the table (always the current database)</entry>
4569 <entry><literal>table_schema</literal></entry>
4570 <entry><type>sql_identifier</type></entry>
4571 <entry>Name of the schema that contains the table</entry>
4575 <entry><literal>table_name</literal></entry>
4576 <entry><type>sql_identifier</type></entry>
4577 <entry>Name of the table</entry>
4581 <entry><literal>constraint_type</literal></entry>
4582 <entry><type>character_data</type></entry>
4584 Type of the constraint: <literal>CHECK</literal>,
4585 <literal>FOREIGN KEY</literal>, <literal>PRIMARY KEY</literal>,
4586 or <literal>UNIQUE</literal>
4591 <entry><literal>is_deferrable</literal></entry>
4592 <entry><type>yes_or_no</type></entry>
4593 <entry><literal>YES</literal> if the constraint is deferrable, <literal>NO</literal> if not</entry>
4597 <entry><literal>initially_deferred</literal></entry>
4598 <entry><type>yes_or_no</type></entry>
4599 <entry><literal>YES</literal> if the constraint is deferrable and initially deferred, <literal>NO</literal> if not</entry>
4606 <sect1 id="infoschema-table-privileges">
4607 <title><literal>table_privileges</literal></title>
4610 The view <literal>table_privileges</literal> identifies all
4611 privileges granted on tables or views to a currently enabled role
4612 or by a currently enabled role. There is one row for each
4613 combination of table, grantor, and grantee.
4617 <title><literal>table_privileges</literal> Columns</title>
4623 <entry>Data Type</entry>
4624 <entry>Description</entry>
4630 <entry><literal>grantor</literal></entry>
4631 <entry><type>sql_identifier</type></entry>
4632 <entry>Name of the role that granted the privilege</entry>
4636 <entry><literal>grantee</literal></entry>
4637 <entry><type>sql_identifier</type></entry>
4638 <entry>Name of the role that the privilege was granted to</entry>
4642 <entry><literal>table_catalog</literal></entry>
4643 <entry><type>sql_identifier</type></entry>
4644 <entry>Name of the database that contains the table (always the current database)</entry>
4648 <entry><literal>table_schema</literal></entry>
4649 <entry><type>sql_identifier</type></entry>
4650 <entry>Name of the schema that contains the table</entry>
4654 <entry><literal>table_name</literal></entry>
4655 <entry><type>sql_identifier</type></entry>
4656 <entry>Name of the table</entry>
4660 <entry><literal>privilege_type</literal></entry>
4661 <entry><type>character_data</type></entry>
4663 Type of the privilege: <literal>SELECT</literal>,
4664 <literal>INSERT</literal>, <literal>UPDATE</literal>,
4665 <literal>DELETE</literal>, <literal>TRUNCATE</literal>,
4666 <literal>REFERENCES</literal>, or <literal>TRIGGER</literal>
4671 <entry><literal>is_grantable</literal></entry>
4672 <entry><type>yes_or_no</type></entry>
4673 <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
4677 <entry><literal>with_hierarchy</literal></entry>
4678 <entry><type>yes_or_no</type></entry>
4679 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4686 <sect1 id="infoschema-tables">
4687 <title><literal>tables</literal></title>
4690 The view <literal>tables</literal> contains all tables and views
4691 defined in the current database. Only those tables and views are
4692 shown that the current user has access to (by way of being the
4693 owner or having some privilege).
4697 <title><literal>tables</literal> Columns</title>
4703 <entry>Data Type</entry>
4704 <entry>Description</entry>
4710 <entry><literal>table_catalog</literal></entry>
4711 <entry><type>sql_identifier</type></entry>
4712 <entry>Name of the database that contains the table (always the current database)</entry>
4716 <entry><literal>table_schema</literal></entry>
4717 <entry><type>sql_identifier</type></entry>
4718 <entry>Name of the schema that contains the table</entry>
4722 <entry><literal>table_name</literal></entry>
4723 <entry><type>sql_identifier</type></entry>
4724 <entry>Name of the table</entry>
4728 <entry><literal>table_type</literal></entry>
4729 <entry><type>character_data</type></entry>
4731 Type of the table: <literal>BASE TABLE</literal> for a
4732 persistent base table (the normal table type),
4733 <literal>VIEW</literal> for a view, or <literal>LOCAL
4734 TEMPORARY</literal> for a temporary table
4739 <entry><literal>self_referencing_column_name</literal></entry>
4740 <entry><type>sql_identifier</type></entry>
4741 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4745 <entry><literal>reference_generation</literal></entry>
4746 <entry><type>character_data</type></entry>
4747 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4751 <entry><literal>user_defined_type_catalog</literal></entry>
4752 <entry><type>sql_identifier</type></entry>
4753 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4757 <entry><literal>user_defined_type_schema</literal></entry>
4758 <entry><type>sql_identifier</type></entry>
4759 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4763 <entry><literal>user_defined_type_name</literal></entry>
4764 <entry><type>sql_identifier</type></entry>
4765 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4769 <entry><literal>is_insertable_into</literal></entry>
4770 <entry><type>yes_or_no</type></entry>
4772 <literal>YES</literal> if the table is insertable into,
4773 <literal>NO</literal> if not (Base tables are always insertable
4774 into, views not necessarily.)
4779 <entry><literal>is_typed</literal></entry>
4780 <entry><type>yes_or_no</type></entry>
4781 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4785 <entry><literal>commit_action</literal></entry>
4786 <entry><type>character_data</type></entry>
4788 If the table is a temporary table, then
4789 <literal>PRESERVE</literal>, else null. (The SQL standard
4790 defines other commit actions for temporary tables, which are
4791 not supported by <productname>PostgreSQL</>.)
4799 <sect1 id="infoschema-triggers">
4800 <title><literal>triggers</literal></title>
4803 The view <literal>triggers</literal> contains all triggers defined
4804 in the current database on tables that the current user owns or has
4805 some non-SELECT privilege on.
4809 <title><literal>triggers</literal> Columns</title>
4815 <entry>Data Type</entry>
4816 <entry>Description</entry>
4822 <entry><literal>trigger_catalog</literal></entry>
4823 <entry><type>sql_identifier</type></entry>
4824 <entry>Name of the database that contains the trigger (always the current database)</entry>
4828 <entry><literal>trigger_schema</literal></entry>
4829 <entry><type>sql_identifier</type></entry>
4830 <entry>Name of the schema that contains the trigger</entry>
4834 <entry><literal>trigger_name</literal></entry>
4835 <entry><type>sql_identifier</type></entry>
4836 <entry>Name of the trigger</entry>
4840 <entry><literal>event_manipulation</literal></entry>
4841 <entry><type>character_data</type></entry>
4843 Event that fires the trigger (<literal>INSERT</literal>,
4844 <literal>UPDATE</literal>, or <literal>DELETE</literal>)
4849 <entry><literal>event_object_catalog</literal></entry>
4850 <entry><type>sql_identifier</type></entry>
4852 Name of the database that contains the table that the trigger
4853 is defined on (always the current database)
4858 <entry><literal>event_object_schema</literal></entry>
4859 <entry><type>sql_identifier</type></entry>
4860 <entry>Name of the schema that contains the table that the trigger is defined on</entry>
4864 <entry><literal>event_object_table</literal></entry>
4865 <entry><type>sql_identifier</type></entry>
4866 <entry>Name of the table that the trigger is defined on</entry>
4870 <entry><literal>action_order</literal></entry>
4871 <entry><type>cardinal_number</type></entry>
4872 <entry>Not yet implemented</entry>
4876 <entry><literal>action_condition</literal></entry>
4877 <entry><type>character_data</type></entry>
4879 <literal>WHEN</literal> condition of the trigger, null if none
4880 (also null if the table is not owned by a currently enabled
4886 <entry><literal>action_statement</literal></entry>
4887 <entry><type>character_data</type></entry>
4889 Statement that is executed by the trigger (currently always
4890 <literal>EXECUTE PROCEDURE
4891 <replaceable>function</replaceable>(...)</literal>)
4896 <entry><literal>action_orientation</literal></entry>
4897 <entry><type>character_data</type></entry>
4899 Identifies whether the trigger fires once for each processed
4900 row or once for each statement (<literal>ROW</literal> or
4901 <literal>STATEMENT</literal>)
4906 <entry><literal>condition_timing</literal></entry>
4907 <entry><type>character_data</type></entry>
4909 Time at which the trigger fires (<literal>BEFORE</literal> or
4910 <literal>AFTER</literal>)
4915 <entry><literal>condition_reference_old_table</literal></entry>
4916 <entry><type>sql_identifier</type></entry>
4917 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4921 <entry><literal>condition_reference_new_table</literal></entry>
4922 <entry><type>sql_identifier</type></entry>
4923 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4927 <entry><literal>condition_reference_old_row</literal></entry>
4928 <entry><type>sql_identifier</type></entry>
4929 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4933 <entry><literal>condition_reference_new_row</literal></entry>
4934 <entry><type>sql_identifier</type></entry>
4935 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4939 <entry><literal>created</literal></entry>
4940 <entry><type>time_stamp</type></entry>
4941 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
4948 Triggers in <productname>PostgreSQL</productname> have two
4949 incompatibilities with the SQL standard that affect the
4950 representation in the information schema. First, trigger names are
4951 local to the table in <productname>PostgreSQL</productname>, rather
4952 than being independent schema objects. Therefore there can be duplicate
4953 trigger names defined in one schema, as long as they belong to
4954 different tables. (<literal>trigger_catalog</literal> and
4955 <literal>trigger_schema</literal> are really the values pertaining
4956 to the table that the trigger is defined on.) Second, triggers can
4957 be defined to fire on multiple events in
4958 <productname>PostgreSQL</productname> (e.g., <literal>ON INSERT OR
4959 UPDATE</literal>), whereas the SQL standard only allows one. If a
4960 trigger is defined to fire on multiple events, it is represented as
4961 multiple rows in the information schema, one for each type of
4962 event. As a consequence of these two issues, the primary key of
4963 the view <literal>triggers</literal> is really
4964 <literal>(trigger_catalog, trigger_schema, trigger_name,
4965 event_object_table, event_manipulation)</literal> instead of
4966 <literal>(trigger_catalog, trigger_schema, trigger_name)</literal>,
4967 which is what the SQL standard specifies. Nonetheless, if you
4968 define your triggers in a manner that conforms with the SQL
4969 standard (trigger names unique in the schema and only one event
4970 type per trigger), this will not affect you.
4974 <sect1 id="infoschema-usage-privileges">
4975 <title><literal>usage_privileges</literal></title>
4978 The view <literal>usage_privileges</literal> identifies
4979 <literal>USAGE</literal> privileges granted on various kinds of
4980 objects to a currently enabled role or by a currently enabled role.
4981 In <productname>PostgreSQL</productname>, this currently applies to
4982 domains, foreign-data wrappers, and foreign servers. There is one
4983 row for each combination of object, grantor, and grantee.
4987 Since domains do not have real privileges
4988 in <productname>PostgreSQL</productname>, this view shows implicit
4989 non-grantable <literal>USAGE</literal> privileges granted by the
4990 owner to <literal>PUBLIC</literal> for all domains. The other
4991 object types, however, show real privileges.
4995 <title><literal>usage_privileges</literal> Columns</title>
5001 <entry>Data Type</entry>
5002 <entry>Description</entry>
5008 <entry><literal>grantor</literal></entry>
5009 <entry><type>sql_identifier</type></entry>
5010 <entry>Name of the role that granted the privilege</entry>
5014 <entry><literal>grantee</literal></entry>
5015 <entry><type>sql_identifier</type></entry>
5016 <entry>Name of the role that the privilege was granted to</entry>
5020 <entry><literal>object_catalog</literal></entry>
5021 <entry><type>sql_identifier</type></entry>
5022 <entry>Name of the database containing the object (always the current database)</entry>
5026 <entry><literal>object_schema</literal></entry>
5027 <entry><type>sql_identifier</type></entry>
5028 <entry>Name of the schema containing the object, if applicable,
5029 else an empty string</entry>
5033 <entry><literal>object_name</literal></entry>
5034 <entry><type>sql_identifier</type></entry>
5035 <entry>Name of the object</entry>
5039 <entry><literal>object_type</literal></entry>
5040 <entry><type>character_data</type></entry>
5041 <entry><literal>DOMAIN</literal> or <literal>FOREIGN DATA WRAPPER</literal> or <literal>FOREIGN SERVER</literal></entry>
5045 <entry><literal>privilege_type</literal></entry>
5046 <entry><type>character_data</type></entry>
5047 <entry>Always <literal>USAGE</literal></entry>
5051 <entry><literal>is_grantable</literal></entry>
5052 <entry><type>yes_or_no</type></entry>
5053 <entry><literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not</entry>
5060 <sect1 id="infoschema-user-mapping-options">
5061 <title><literal>user_mapping_options</literal></title>
5064 The view <literal>user_mapping_options</literal> contains all the
5065 options defined for user mappings in the current database. Only
5066 those user mappings are shown where the current user has access to
5067 the corresponding foreign server (by way of being the owner or
5068 having some privilege).
5072 <title><literal>user_mapping_options</literal> Columns</title>
5078 <entry>Data Type</entry>
5079 <entry>Description</entry>
5085 <entry><literal>authorization_identifier</literal></entry>
5086 <entry><type>sql_identifier</type></entry>
5087 <entry>Name of the user being mapped,
5088 or <literal>PUBLIC</literal> if the mapping is public</entry>
5092 <entry><literal>foreign_server_catalog</literal></entry>
5093 <entry><type>sql_identifier</type></entry>
5094 <entry>Name of the database that the foreign server used by this
5095 mapping is defined in (always the current database)</entry>
5099 <entry><literal>foreign_server_name</literal></entry>
5100 <entry><type>sql_identifier</type></entry>
5101 <entry>Name of the foreign server used by this mapping</entry>
5105 <entry><literal>option_name</literal></entry>
5106 <entry><type>sql_identifier</type></entry>
5107 <entry>Name of an option</entry>
5111 <entry><literal>option_value</literal></entry>
5112 <entry><type>character_data</type></entry>
5113 <entry>Value of the option. This column will show as null
5114 unless the current user is the user being mapped, or the mapping
5115 is for <literal>PUBLIC</literal> and the current user is the
5116 server owner, or the current user is a superuser. The intent is
5117 to protect password information stored as user mapping
5125 <sect1 id="infoschema-user-mappings">
5126 <title><literal>user_mappings</literal></title>
5129 The view <literal>user_mappings</literal> contains all user
5130 mappings defined in the current database. Only those user mappings
5131 are shown where the current user has access to the corresponding
5132 foreign server (by way of being the owner or having some
5137 <title><literal>user_mappings</literal> Columns</title>
5143 <entry>Data Type</entry>
5144 <entry>Description</entry>
5150 <entry><literal>authorization_identifier</literal></entry>
5151 <entry><type>sql_identifier</type></entry>
5152 <entry>Name of the user being mapped,
5153 or <literal>PUBLIC</literal> if the mapping is public</entry>
5157 <entry><literal>foreign_server_catalog</literal></entry>
5158 <entry><type>sql_identifier</type></entry>
5159 <entry>Name of the database that the foreign server used by this
5160 mapping is defined in (always the current database)</entry>
5164 <entry><literal>foreign_server_name</literal></entry>
5165 <entry><type>sql_identifier</type></entry>
5166 <entry>Name of the foreign server used by this mapping</entry>
5173 <sect1 id="infoschema-view-column-usage">
5174 <title><literal>view_column_usage</literal></title>
5177 The view <literal>view_column_usage</literal> identifies all
5178 columns that are used in the query expression of a view (the
5179 <command>SELECT</command> statement that defines the view). A
5180 column is only included if the table that contains the column is
5181 owned by a currently enabled role.
5186 Columns of system tables are not included. This should be fixed
5192 <title><literal>view_column_usage</literal> Columns</title>
5198 <entry>Data Type</entry>
5199 <entry>Description</entry>
5205 <entry><literal>view_catalog</literal></entry>
5206 <entry><type>sql_identifier</type></entry>
5207 <entry>Name of the database that contains the view (always the current database)</entry>
5211 <entry><literal>view_schema</literal></entry>
5212 <entry><type>sql_identifier</type></entry>
5213 <entry>Name of the schema that contains the view</entry>
5217 <entry><literal>view_name</literal></entry>
5218 <entry><type>sql_identifier</type></entry>
5219 <entry>Name of the view</entry>
5223 <entry><literal>table_catalog</literal></entry>
5224 <entry><type>sql_identifier</type></entry>
5226 Name of the database that contains the table that contains the
5227 column that is used by the view (always the current database)
5232 <entry><literal>table_schema</literal></entry>
5233 <entry><type>sql_identifier</type></entry>
5235 Name of the schema that contains the table that contains the
5236 column that is used by the view
5241 <entry><literal>table_name</literal></entry>
5242 <entry><type>sql_identifier</type></entry>
5244 Name of the table that contains the column that is used by the
5250 <entry><literal>column_name</literal></entry>
5251 <entry><type>sql_identifier</type></entry>
5252 <entry>Name of the column that is used by the view</entry>
5259 <sect1 id="infoschema-view-routine-usage">
5260 <title><literal>view_routine_usage</literal></title>
5263 The view <literal>view_routine_usage</literal> identifies all
5264 routines (functions and procedures) that are used in the query
5265 expression of a view (the <command>SELECT</command> statement that
5266 defines the view). A routine is only included if that routine is
5267 owned by a currently enabled role.
5271 <title><literal>view_routine_usage</literal> Columns</title>
5277 <entry>Data Type</entry>
5278 <entry>Description</entry>
5284 <entry><literal>table_catalog</literal></entry>
5285 <entry><literal>sql_identifier</literal></entry>
5286 <entry>Name of the database containing the view (always the current database)</entry>
5290 <entry><literal>table_schema</literal></entry>
5291 <entry><literal>sql_identifier</literal></entry>
5292 <entry>Name of the schema containing the view</entry>
5296 <entry><literal>table_name</literal></entry>
5297 <entry><literal>sql_identifier</literal></entry>
5298 <entry>Name of the view</entry>
5302 <entry><literal>specific_catalog</literal></entry>
5303 <entry><literal>sql_identifier</literal></entry>
5304 <entry>Name of the database containing the function (always the current database)</entry>
5308 <entry><literal>specific_schema</literal></entry>
5309 <entry><literal>sql_identifier</literal></entry>
5310 <entry>Name of the schema containing the function</entry>
5314 <entry><literal>specific_name</literal></entry>
5315 <entry><literal>sql_identifier</literal></entry>
5317 The <quote>specific name</quote> of the function. See <xref
5318 linkend="infoschema-routines"> for more information.
5326 <sect1 id="infoschema-view-table-usage">
5327 <title><literal>view_table_usage</literal></title>
5330 The view <literal>view_table_usage</literal> identifies all tables
5331 that are used in the query expression of a view (the
5332 <command>SELECT</command> statement that defines the view). A
5333 table is only included if that table is owned by a currently
5339 System tables are not included. This should be fixed sometime.
5344 <title><literal>view_table_usage</literal> Columns</title>
5350 <entry>Data Type</entry>
5351 <entry>Description</entry>
5357 <entry><literal>view_catalog</literal></entry>
5358 <entry><type>sql_identifier</type></entry>
5359 <entry>Name of the database that contains the view (always the current database)</entry>
5363 <entry><literal>view_schema</literal></entry>
5364 <entry><type>sql_identifier</type></entry>
5365 <entry>Name of the schema that contains the view</entry>
5369 <entry><literal>view_name</literal></entry>
5370 <entry><type>sql_identifier</type></entry>
5371 <entry>Name of the view</entry>
5375 <entry><literal>table_catalog</literal></entry>
5376 <entry><type>sql_identifier</type></entry>
5378 Name of the database that contains the table that is
5379 used by the view (always the current database)
5384 <entry><literal>table_schema</literal></entry>
5385 <entry><type>sql_identifier</type></entry>
5387 Name of the schema that contains the table that is used by the
5393 <entry><literal>table_name</literal></entry>
5394 <entry><type>sql_identifier</type></entry>
5396 Name of the table that is used by the view
5404 <sect1 id="infoschema-views">
5405 <title><literal>views</literal></title>
5408 The view <literal>views</literal> contains all views defined in the
5409 current database. Only those views are shown that the current user
5410 has access to (by way of being the owner or having some privilege).
5414 <title><literal>views</literal> Columns</title>
5420 <entry>Data Type</entry>
5421 <entry>Description</entry>
5427 <entry><literal>table_catalog</literal></entry>
5428 <entry><type>sql_identifier</type></entry>
5429 <entry>Name of the database that contains the view (always the current database)</entry>
5433 <entry><literal>table_schema</literal></entry>
5434 <entry><type>sql_identifier</type></entry>
5435 <entry>Name of the schema that contains the view</entry>
5439 <entry><literal>table_name</literal></entry>
5440 <entry><type>sql_identifier</type></entry>
5441 <entry>Name of the view</entry>
5445 <entry><literal>view_definition</literal></entry>
5446 <entry><type>character_data</type></entry>
5448 Query expression defining the view (null if the view is not
5449 owned by a currently enabled role)
5454 <entry><literal>check_option</literal></entry>
5455 <entry><type>character_data</type></entry>
5456 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5460 <entry><literal>is_updatable</literal></entry>
5461 <entry><type>yes_or_no</type></entry>
5463 <literal>YES</literal> if the view is updatable (allows
5464 <command>UPDATE</command> and <command>DELETE</command>),
5465 <literal>NO</literal> if not
5470 <entry><literal>is_insertable_into</literal></entry>
5471 <entry><type>yes_or_no</type></entry>
5473 <literal>YES</literal> if the view is insertable into (allows
5474 <command>INSERT</command>), <literal>NO</literal> if not
5479 <entry><literal>is_trigger_updatable</literal></entry>
5480 <entry><type>yes_or_no</type></entry>
5481 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5485 <entry><literal>is_trigger_deletable</literal></entry>
5486 <entry><type>yes_or_no</type></entry>
5487 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>
5491 <entry><literal>is_trigger_insertable_into</literal></entry>
5492 <entry><type>yes_or_no</type></entry>
5493 <entry>Applies to a feature not available in <productname>PostgreSQL</></entry>