Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
The columns of the information schema views use special data types that are defined in the information schema. These are defined as simple domains over ordinary built-in types. You should not use these types for work outside the information schema, but your applications must be prepared for them if they select from the information schema.
These types are:
cardinal_number
A nonnegative integer.
character_data
A character string (without specific maximum length).
sql_identifier
A character string. This type is used for SQL identifiers, the type character_data
is used for any other kind of text data.
time_stamp
A domain over the type timestamp with time zone
yes_or_no
A character string domain that contains either YES
or NO
. This is used to represent Boolean (true/false) data in the information schema. (The information schema was invented before the type boolean
was added to the SQL standard, so this convention is necessary to keep the information schema backward compatible.)
Every column in the information schema has one of these five types.
The information schema consists of a set of views that contain information about the objects defined in the current database. The information schema is defined in the SQL standard and can therefore be expected to be portable and remain stable — unlike the system catalogs, which are specific to PostgreSQL and are modeled after implementation concerns. The information schema views do not, however, contain information about PostgreSQL-specific features; to inquire about those you need to query the system catalogs or other PostgreSQL-specific views.
在資料庫中查詢限制條件資訊時,符合標準的查詢可能預期會回傳一筆資料,到數筆資料。這是因為 SQL 標準要求限制條件名稱在綱要中必須是唯一的,但是 PostgreSQL 不強制執行此限制條件。PostgreSQL 自動產生的限制條件名稱會避免在同一綱要中的重複,但是使用者可以指定重複的名稱。
查詢 information schema 檢視表(如check_constraint_routine_usage,check_constraints,domain_constraints 和 referential_constraints)時,可能會出現此問題。其他一些檢視表也有類似的問題,但是包含資料表名稱用以協助區分重複的資料。例如,constraint_column_usage,constraint_table_usage,table_constraints。
The information schema itself is a schema named information_schema
. This schema automatically exists in all databases. The owner of this schema is the initial database user in the cluster, and that user naturally has all the privileges on this schema, including the ability to drop it (but the space savings achieved by that are minuscule).
By default, the information schema is not in the schema search path, so you need to access all objects in it through qualified names. Since the names of some of the objects in the information schema are generic names that might occur in user applications, you should be careful if you want to put the information schema in the path.
The view administrable_role_authorizations
identifies all roles that the current user has the admin option for.
Table 37.2. administrable_role_authorizations
Columns
The view attributes
contains information about the attributes of composite data types defined in the database. (Note that the view does not give information about table columns, which are sometimes called attributes in PostgreSQL contexts.) Only those attributes are shown that the current user has access to (by way of being the owner of or having some privilege on the type).
attributes
ColumnsThe view applicable_roles
identifies all roles whose privileges the current user can use. This means there is some chain of role grants from the current user to the role in question. The current user itself is also an applicable role. The set of applicable roles is generally used for permission checking.
applicable_roles
ColumnsThe view character_sets
identifies the character sets available in the current database. Since PostgreSQL does not support multiple character sets within one database, this view only shows one, which is the database encoding.
Take note of how the following terms are used in the SQL standard:
character repertoire
An abstract collection of characters, for example UNICODE
, UCS
, or LATIN1
. Not exposed as an SQL object, but visible in this view.
character encoding form
An encoding of some character repertoire. Most older character repertoires only use one encoding form, and so there are no separate names for them (e.g., LATIN1
is an encoding form applicable to the LATIN1
repertoire). But for example Unicode has the encoding forms UTF8
, UTF16
, etc. (not all supported by PostgreSQL). Encoding forms are not exposed as an SQL object, but are visible in this view.
character set
A named SQL object that identifies a character repertoire, a character encoding, and a default collation. A predefined character set would typically have the same name as an encoding form, but users could define other names. For example, the character set UTF8
would typically identify the character repertoire UCS
, encoding form UTF8
, and some default collation.
You can think of an “encoding” in PostgreSQL either as a character set or a character encoding form. They will have the same name, and there can only be one in one database.
character_sets
ColumnsSee also under , a similarly structured view, for further information on some of the columns.
Column Type
Description
grantee
sql_identifier
Name of the role to which this role membership was granted (can be the current user, or a different role in case of nested role memberships)
role_name
sql_identifier
Name of a role
is_grantable
yes_or_no
Always YES
Column Type Description |
Name of the database containing the constraint (always the current database) |
Name of the schema containing the constraint |
Name of the constraint |
The check expression of the check constraint |
Column Type Description |
Name of the database containing the domain (always the current database) |
Name of the schema containing the domain |
Name of the domain |
Name of the database containing the table (always the current database) |
Name of the schema containing the table |
Name of the table |
Name of the column |
Column Type Description |
Name of the database containing the data type (always the current database) |
Name of the schema containing the data type |
Name of the data type |
Name of the attribute |
Ordinal position of the attribute within the data type (count starts at 1) |
Default expression of the attribute |
|
Data type of the attribute, if it is a built-in type, or |
If |
If |
Applies to a feature not available in PostgreSQL |
Applies to a feature not available in PostgreSQL |
Applies to a feature not available in PostgreSQL |
Name of the database containing the collation of the attribute (always the current database), null if default or the data type of the attribute is not collatable |
Name of the schema containing the collation of the attribute, null if default or the data type of the attribute is not collatable |
Name of the collation of the attribute, null if default or the data type of the attribute is not collatable |
If |
If |
If |
If |
If |
Applies to a feature not available in PostgreSQL (see |
Name of the database that the attribute data type is defined in (always the current database) |
Name of the schema that the attribute data type is defined in |
Name of the attribute data type |
Applies to a feature not available in PostgreSQL |
Applies to a feature not available in PostgreSQL |
Applies to a feature not available in PostgreSQL |
Always null, because arrays always have unlimited maximum cardinality in PostgreSQL |
An identifier of the data type descriptor of the column, unique among the data type descriptors pertaining to the table. This is mainly useful for joining with other instances of such identifiers. (The specific format of the identifier is not defined and not guaranteed to remain the same in future versions.) |
Applies to a feature not available in PostgreSQL |
Column Type Description |
Name of the role to which this role membership was granted (can be the current user, or a different role in case of nested role memberships) |
Name of a role |
|
Column Type Description |
Character sets are currently not implemented as schema objects, so this column is null. |
Character sets are currently not implemented as schema objects, so this column is null. |
Name of the character set, currently implemented as showing the name of the database encoding |
Character repertoire, showing |
Character encoding form, same as the database encoding |
Name of the database containing the default collation (always the current database, if any collation is identified) |
Name of the schema containing the default collation |
Name of the default collation. The default collation is identified as the collation that matches the |
Column Type Description |
Name of the database containing the constraint (always the current database) |
Name of the schema containing the constraint |
Name of the constraint |
Name of the database containing the function (always the current database) |
Name of the schema containing the function |
The “specific name” of the function. See for more information. |
The view column_privileges
identifies all privileges granted on columns to a currently enabled role or by a currently enabled role. There is one row for each combination of column, grantor, and grantee.
If a privilege has been granted on an entire table, it will show up in this view as a grant for each column, but only for the privilege types where column granularity is possible: SELECT
, INSERT
, UPDATE
, REFERENCES
.
column_privileges
ColumnsThe view constraint_column_usage
identifies all columns in the current database that are used by some constraint. Only those columns are shown that are contained in a table owned by a currently enabled role. For a check constraint, this view identifies the columns that are used in the check expression. For a foreign key constraint, this view identifies the columns that the foreign key references. For a unique or primary key constraint, this view identifies the constrained columns.
constraint_column_usage
ColumnsThe view column_udt_usage
identifies all columns that use data types owned by a currently enabled role. Note that in PostgreSQL, built-in data types behave like user-defined types, so they are included here as well. See also Section 37.17 for details.
column_udt_usage
ColumnsThe view role_udt_grants
is intended to identify USAGE
privileges granted on user-defined types where the grantor or grantee is a currently enabled role. Further information can be found under udt_privileges
. The only effective difference between this view and udt_privileges
is that this view omits objects that have been made accessible to the current user by way of a grant to PUBLIC
. Since data types do not have real privileges in PostgreSQL, but only an implicit grant to PUBLIC
, this view is empty.
role_udt_grants
ColumnsThe view constraint_table_usage
identifies all tables in the current database that are used by some constraint and are owned by a currently enabled role. (This is different from the view table_constraints
, which identifies all table constraints along with the table they are defined on.) For a foreign key constraint, this view identifies the table that the foreign key references. For a unique or primary key constraint, this view simply identifies the table the constraint belongs to. Check constraints and not-null constraints are not included in this view.
constraint_table_usage
ColumnsThe view domain_constraints
contains all constraints belonging to domains defined in the current database. Only those domains are shown that the current user has access to (by way of being the owner or having some privilege).
Table 37.19. domain_constraints
Columns
The view referential_constraints
contains all referential (foreign key) constraints in the current database. Only those constraints are shown for which the current user has write access to the referencing table (by way of being the owner or having some privilege other than SELECT
).
referential_constraints
ColumnsName | Data Type | Description |
---|
The view collation_character_set_applicability
identifies which character set the available collations are applicable to. In PostgreSQL, there is only one character set per database (see explanation in ), so this view does not provide much useful information.
collation_character_set_applicability
ColumnsThe view role_usage_grants
identifies USAGE
privileges granted on various kinds of objects where the grantor or grantee is a currently enabled role. Further information can be found under usage_privileges
. The only effective difference between this view and usage_privileges
is that this view omits objects that have been made accessible to the current user by way of a grant to PUBLIC
.
role_usage_grants
ColumnsColumn Type
Description
grantor
sql_identifier
Name of the role that granted the privilege
grantee
sql_identifier
Name of the role that the privilege was granted to
table_catalog
sql_identifier
Name of the database that contains the table that contains the column (always the current database)
table_schema
sql_identifier
Name of the schema that contains the table that contains the column
table_name
sql_identifier
Name of the table that contains the column
column_name
sql_identifier
Name of the column
privilege_type
character_data
Type of the privilege: SELECT
, INSERT
, UPDATE
, or REFERENCES
is_grantable
yes_or_no
YES
if the privilege is grantable, NO
if not
Column Type
Description
table_catalog
sql_identifier
Name of the database that contains the foreign table (always the current database)
table_schema
sql_identifier
Name of the schema that contains the foreign table
table_name
sql_identifier
Name of the foreign table
column_name
sql_identifier
Name of the column
option_name
sql_identifier
Name of an option
option_value
character_data
Value of the option
Column Type
Description
collation_catalog
sql_identifier
Name of the database containing the collation (always the current database)
collation_schema
sql_identifier
Name of the schema containing the collation
collation_name
sql_identifier
Name of the default collation
pad_attribute
character_data
Always NO PAD
(The alternative PAD SPACE
is not supported by PostgreSQL.)
Column Type
Description
table_catalog
sql_identifier
Name of the database that contains the table that contains the column that is used by some constraint (always the current database)
table_schema
sql_identifier
Name of the schema that contains the table that contains the column that is used by some constraint
table_name
sql_identifier
Name of the table that contains the column that is used by some constraint
column_name
sql_identifier
Name of the column that is used by some constraint
constraint_catalog
sql_identifier
Name of the database that contains the constraint (always the current database)
constraint_schema
sql_identifier
Name of the schema that contains the constraint
constraint_name
sql_identifier
Name of the constraint
Column Type
Description
catalog_name
sql_identifier
Name of the database that contains this information schema
Column Type
Description
udt_catalog
sql_identifier
Name of the database that the column data type (the underlying type of the domain, if applicable) is defined in (always the current database)
udt_schema
sql_identifier
Name of the schema that the column data type (the underlying type of the domain, if applicable) is defined in
udt_name
sql_identifier
Name of the column data type (the underlying type of the domain, if applicable)
table_catalog
sql_identifier
Name of the database containing the table (always the current database)
table_schema
sql_identifier
Name of the schema containing the table
table_name
sql_identifier
Name of the table
column_name
sql_identifier
Name of the column
Column Type Description |
Name of the role that granted the privilege |
Name of the role that the privilege was granted to |
Name of the database that contains the table (always the current database) |
Name of the schema that contains the table |
Name of the table |
Type of the privilege: |
|
In the SQL standard, |
Column Type Description |
Name of the database containing the table (always the current database) |
Name of the schema containing the table |
Name of the table |
Name of the base column that a generated column depends on |
Name of the generated column |
Column Type Description |
The name of the role that granted the privilege |
The name of the role that the privilege was granted to |
Name of the database containing the type (always the current database) |
Name of the schema containing the type |
Name of the type |
Always |
|
Column Type Description |
Name of the database that contains the table that is used by some constraint (always the current database) |
Name of the schema that contains the table that is used by some constraint |
Name of the table that is used by some constraint |
Name of the database that contains the constraint (always the current database) |
Name of the schema that contains the constraint |
Name of the constraint |
Column Type Description |
Name of the database that contains the constraint (always the current database) |
Name of the schema that contains the constraint |
Name of the constraint |
Name of the database that contains the domain (always the current database) |
Name of the schema that contains the domain |
Name of the domain |
|
|
|
| Name of the database containing the constraint (always the current database) |
|
| Name of the schema containing the constraint |
|
| Name of the constraint |
|
| Name of the database that contains the unique or primary key constraint that the foreign key constraint references (always the current database) |
|
| Name of the schema that contains the unique or primary key constraint that the foreign key constraint references |
|
| Name of the unique or primary key constraint that the foreign key constraint references |
|
| Match option of the foreign key constraint: |
|
| Update rule of the foreign key constraint: |
|
| Delete rule of the foreign key constraint: |
Column Type Description |
The name of the role that granted the privilege |
The name of the role that the privilege was granted to |
Name of the database containing the object (always the current database) |
Name of the schema containing the object, if applicable, else an empty string |
Name of the object |
|
Always |
|
Column Type Description |
Name of the database containing the collation (always the current database) |
Name of the schema containing the collation |
Name of the default collation |
Character sets are currently not implemented as schema objects, so this column is null |
Character sets are currently not implemented as schema objects, so this column is null |
Name of the character set |
The view data_type_privileges
identifies all data type descriptors that the current user has access to, by way of being the owner of the described object or having some privilege for it. A data type descriptor is generated whenever a data type is used in the definition of a table column, a domain, or a function (as parameter or return type) and stores some information about how the data type is used in that instance (for example, the declared maximum length, if applicable). Each data type descriptor is assigned an arbitrary identifier that is unique among the data type descriptor identifiers assigned for one object (table, domain, function). This view is probably not useful for applications, but it is used to define some other views in the information schema.
data_type_privileges
ColumnsThe view sequences
contains all sequences defined in the current database. Only those sequences are shown that the current user has access to (by way of being the owner or having some privilege).
sequences
ColumnsNote that in accordance with the SQL standard, the start, minimum, maximum, and increment values are returned as character strings.
The table sql_implementation_info
contains information about various aspects that are left implementation-defined by the SQL standard. This information is primarily intended for use in the context of the ODBC interface; users of other interfaces will probably find this information to be of little use. For this reason, the individual implementation information items are not described here; you will find them in the description of the ODBC interface.
sql_implementation_info
ColumnsThe table sql_features
contains information about which formal features defined in the SQL standard are supported by PostgreSQL. This is the same information that is presented in Appendix D. There you can also find some additional background information.
sql_features
ColumnsThe table sql_sizing
contains information about various size limits and maximum values in PostgreSQL. This information is primarily intended for use in the context of the ODBC interface; users of other interfaces will probably find this information to be of little use. For this reason, the individual sizing items are not described here; you will find them in the description of the ODBC interface.
Table 37.49. sql_sizing
Columns
The view columns
contains information about all table columns (or view columns) in the database. System columns (ctid
, etc.) are not included. Only those columns are shown that the current user has access to (by way of being the owner or having some privilege).
columns
ColumnsSince data types can be defined in a variety of ways in SQL, and PostgreSQL contains additional ways to define data types, their representation in the information schema can be somewhat difficult. The column data_type
is supposed to identify the underlying built-in type of the column. In PostgreSQL, this means that the type is defined in the system catalog schema pg_catalog
. This column might be useful if the application can handle the well-known built-in types specially (for example, format the numeric types differently or use the data in the precision columns). The columns udt_name
, udt_schema
, and udt_catalog
always identify the underlying data type of the column, even if the column is based on a domain. (Since PostgreSQL treats built-in types like user-defined types, built-in types appear here as well. This is an extension of the SQL standard.) These columns should be used if an application wants to process data differently according to the type, because in that case it wouldn't matter if the column is really based on a domain. If the column is based on a domain, the identity of the domain is stored in the columns domain_name
, domain_schema
, and domain_catalog
. If you want to pair up columns with their associated data types and treat domains as separate types, you could write coalesce(domain_name, udt_name)
, etc.
The table sql_parts
contains information about which of the several parts of the SQL standard are supported by PostgreSQL.
Table 37.48. sql_parts
Columns
Column Type
Description
object_catalog
sql_identifier
Name of the database that contains the described object (always the current database)
object_schema
sql_identifier
Name of the schema that contains the described object
object_name
sql_identifier
Name of the described object
object_type
character_data
The type of the described object: one of TABLE
(the data type descriptor pertains to a column of that table), DOMAIN
(the data type descriptors pertains to that domain), ROUTINE
(the data type descriptor pertains to a parameter or the return data type of that function).
dtd_identifier
sql_identifier
The identifier of the data type descriptor, which is unique among the data type descriptors for that same object.
Column Type
Description
specific_catalog
sql_identifier
Name of the database containing the function (always the current database)
specific_schema
sql_identifier
Name of the schema containing the function
specific_name
sql_identifier
The “specific name” of the function. This is a name that uniquely identifies the function in the schema, even if the real name of the function is overloaded. The format of the specific name is not defined, it should only be used to compare it to other instances of specific routine names.
routine_catalog
sql_identifier
Name of the database containing the function (always the current database)
routine_schema
sql_identifier
Name of the schema containing the function
routine_name
sql_identifier
Name of the function (might be duplicated in case of overloading)
routine_type
character_data
FUNCTION
for a function, PROCEDURE
for a procedure
module_catalog
sql_identifier
Applies to a feature not available in PostgreSQL
module_schema
sql_identifier
Applies to a feature not available in PostgreSQL
module_name
sql_identifier
Applies to a feature not available in PostgreSQL
udt_catalog
sql_identifier
Applies to a feature not available in PostgreSQL
udt_schema
sql_identifier
Applies to a feature not available in PostgreSQL
udt_name
sql_identifier
Applies to a feature not available in PostgreSQL
data_type
character_data
Return data type of the function, if it is a built-in type, or ARRAY
if it is some array (in that case, see the view element_types
), else USER-DEFINED
(in that case, the type is identified in type_udt_name
and associated columns). Null for a procedure.
character_maximum_length
cardinal_number
Always null, since this information is not applied to return data types in PostgreSQL
character_octet_length
cardinal_number
Always null, since this information is not applied to return data types in PostgreSQL
character_set_catalog
sql_identifier
Applies to a feature not available in PostgreSQL
character_set_schema
sql_identifier
Applies to a feature not available in PostgreSQL
character_set_name
sql_identifier
Applies to a feature not available in PostgreSQL
collation_catalog
sql_identifier
Always null, since this information is not applied to return data types in PostgreSQL
collation_schema
sql_identifier
Always null, since this information is not applied to return data types in PostgreSQL
collation_name
sql_identifier
Always null, since this information is not applied to return data types in PostgreSQL
numeric_precision
cardinal_number
Always null, since this information is not applied to return data types in PostgreSQL
numeric_precision_radix
cardinal_number
Always null, since this information is not applied to return data types in PostgreSQL
numeric_scale
cardinal_number
Always null, since this information is not applied to return data types in PostgreSQL
datetime_precision
cardinal_number
Always null, since this information is not applied to return data types in PostgreSQL
interval_type
character_data
Always null, since this information is not applied to return data types in PostgreSQL
interval_precision
cardinal_number
Always null, since this information is not applied to return data types in PostgreSQL
type_udt_catalog
sql_identifier
Name of the database that the return data type of the function is defined in (always the current database). Null for a procedure.
type_udt_schema
sql_identifier
Name of the schema that the return data type of the function is defined in. Null for a procedure.
type_udt_name
sql_identifier
Name of the return data type of the function. Null for a procedure.
scope_catalog
sql_identifier
Applies to a feature not available in PostgreSQL
scope_schema
sql_identifier
Applies to a feature not available in PostgreSQL
scope_name
sql_identifier
Applies to a feature not available in PostgreSQL
maximum_cardinality
cardinal_number
Always null, because arrays always have unlimited maximum cardinality in PostgreSQL
dtd_identifier
sql_identifier
An identifier of the data type descriptor of the return data type of this function, unique among the data type descriptors pertaining to the function. This is mainly useful for joining with other instances of such identifiers. (The specific format of the identifier is not defined and not guaranteed to remain the same in future versions.)
routine_body
character_data
If the function is an SQL function, then SQL
, else EXTERNAL
.
routine_definition
character_data
The source text of the function (null if the function is not owned by a currently enabled role). (According to the SQL standard, this column is only applicable if routine_body
is SQL
, but in PostgreSQL it will contain whatever source text was specified when the function was created.)
external_name
character_data
If this function is a C function, then the external name (link symbol) of the function; else null. (This works out to be the same value that is shown in routine_definition
.)
external_language
character_data
The language the function is written in
parameter_style
character_data
Always GENERAL
(The SQL standard defines other parameter styles, which are not available in PostgreSQL.)
is_deterministic
yes_or_no
If the function is declared immutable (called deterministic in the SQL standard), then YES
, else NO
. (You cannot query the other volatility levels available in PostgreSQL through the information schema.)
sql_data_access
character_data
Always MODIFIES
, meaning that the function possibly modifies SQL data. This information is not useful for PostgreSQL.
is_null_call
yes_or_no
If the function automatically returns null if any of its arguments are null, then YES
, else NO
. Null for a procedure.
sql_path
character_data
Applies to a feature not available in PostgreSQL
schema_level_routine
yes_or_no
Always YES
(The opposite would be a method of a user-defined type, which is a feature not available in PostgreSQL.)
max_dynamic_result_sets
cardinal_number
Applies to a feature not available in PostgreSQL
is_user_defined_cast
yes_or_no
Applies to a feature not available in PostgreSQL
is_implicitly_invocable
yes_or_no
Applies to a feature not available in PostgreSQL
security_type
character_data
If the function runs with the privileges of the current user, then INVOKER
, if the function runs with the privileges of the user who defined it, then DEFINER
.
to_sql_specific_catalog
sql_identifier
Applies to a feature not available in PostgreSQL
to_sql_specific_schema
sql_identifier
Applies to a feature not available in PostgreSQL
to_sql_specific_name
sql_identifier
Applies to a feature not available in PostgreSQL
as_locator
yes_or_no
Applies to a feature not available in PostgreSQL
created
time_stamp
Applies to a feature not available in PostgreSQL
last_altered
time_stamp
Applies to a feature not available in PostgreSQL
new_savepoint_level
yes_or_no
Applies to a feature not available in PostgreSQL
is_udt_dependent
yes_or_no
Currently always NO
. The alternative YES
applies to a feature not available in PostgreSQL.
result_cast_from_data_type
character_data
Applies to a feature not available in PostgreSQL
result_cast_as_locator
yes_or_no
Applies to a feature not available in PostgreSQL
result_cast_char_max_length
cardinal_number
Applies to a feature not available in PostgreSQL
result_cast_char_octet_length
cardinal_number
Applies to a feature not available in PostgreSQL
result_cast_char_set_catalog
sql_identifier
Applies to a feature not available in PostgreSQL
result_cast_char_set_schema
sql_identifier
Applies to a feature not available in PostgreSQL
result_cast_char_set_name
sql_identifier
Applies to a feature not available in PostgreSQL
result_cast_collation_catalog
sql_identifier
Applies to a feature not available in PostgreSQL
result_cast_collation_schema
sql_identifier
Applies to a feature not available in PostgreSQL
result_cast_collation_name
sql_identifier
Applies to a feature not available in PostgreSQL
result_cast_numeric_precision
cardinal_number
Applies to a feature not available in PostgreSQL
result_cast_numeric_precision_radix
cardinal_number
Applies to a feature not available in PostgreSQL
result_cast_numeric_scale
cardinal_number
Applies to a feature not available in PostgreSQL
result_cast_datetime_precision
cardinal_number
Applies to a feature not available in PostgreSQL
result_cast_interval_type
character_data
Applies to a feature not available in PostgreSQL
result_cast_interval_precision
cardinal_number
Applies to a feature not available in PostgreSQL
result_cast_type_udt_catalog
sql_identifier
Applies to a feature not available in PostgreSQL
result_cast_type_udt_schema
sql_identifier
Applies to a feature not available in PostgreSQL
result_cast_type_udt_name
sql_identifier
Applies to a feature not available in PostgreSQL
result_cast_scope_catalog
sql_identifier
Applies to a feature not available in PostgreSQL
result_cast_scope_schema
sql_identifier
Applies to a feature not available in PostgreSQL
result_cast_scope_name
sql_identifier
Applies to a feature not available in PostgreSQL
result_cast_maximum_cardinality
cardinal_number
Applies to a feature not available in PostgreSQL
result_cast_dtd_identifier
sql_identifier
Applies to a feature not available in PostgreSQL
Column Type
Description
catalog_name
sql_identifier
Name of the database that the schema is contained in (always the current database)
schema_name
sql_identifier
Name of the schema
schema_owner
sql_identifier
Name of the owner of the schema
default_character_set_catalog
sql_identifier
Applies to a feature not available in PostgreSQL
default_character_set_schema
sql_identifier
Applies to a feature not available in PostgreSQL
default_character_set_name
sql_identifier
Applies to a feature not available in PostgreSQL
sql_path
character_data
Applies to a feature not available in PostgreSQL
Column Type
Description
sequence_catalog
sql_identifier
Name of the database that contains the sequence (always the current database)
sequence_schema
sql_identifier
Name of the schema that contains the sequence
sequence_name
sql_identifier
Name of the sequence
data_type
character_data
The data type of the sequence.
numeric_precision
cardinal_number
This column contains the (declared or implicit) precision of the sequence data type (see above). The precision indicates the number of significant digits. It can be expressed in decimal (base 10) or binary (base 2) terms, as specified in the column numeric_precision_radix
.
numeric_precision_radix
cardinal_number
This column indicates in which base the values in the columns numeric_precision
and numeric_scale
are expressed. The value is either 2 or 10.
numeric_scale
cardinal_number
This column contains the (declared or implicit) scale of the sequence data type (see above). The scale indicates the number of significant digits to the right of the decimal point. It can be expressed in decimal (base 10) or binary (base 2) terms, as specified in the column numeric_precision_radix
.
start_value
character_data
The start value of the sequence
minimum_value
character_data
The minimum value of the sequence
maximum_value
character_data
The maximum value of the sequence
increment
character_data
The increment of the sequence
cycle_option
yes_or_no
YES
if the sequence cycles, else NO
Column Type
Description
implementation_info_id
character_data
Identifier string of the implementation information item
implementation_info_name
character_data
Descriptive name of the implementation information item
integer_value
cardinal_number
Value of the implementation information item, or null if the value is contained in the column character_value
character_value
character_data
Value of the implementation information item, or null if the value is contained in the column integer_value
comments
character_data
Possibly a comment pertaining to the implementation information item
Column Type
Description
grantor
sql_identifier
Name of the role that granted the privilege
grantee
sql_identifier
Name of the role that the privilege was granted to
specific_catalog
sql_identifier
Name of the database containing the function (always the current database)
specific_schema
sql_identifier
Name of the schema containing the function
specific_name
sql_identifier
The “specific name” of the function. See Section 37.45 for more information.
routine_catalog
sql_identifier
Name of the database containing the function (always the current database)
routine_schema
sql_identifier
Name of the schema containing the function
routine_name
sql_identifier
Name of the function (might be duplicated in case of overloading)
privilege_type
character_data
Always EXECUTE
(the only privilege type for functions)
is_grantable
yes_or_no
YES
if the privilege is grantable, NO
if not
Column Type
Description
feature_id
character_data
Identifier string of the feature
feature_name
character_data
Descriptive name of the feature
sub_feature_id
character_data
Identifier string of the subfeature, or a zero-length string if not a subfeature
sub_feature_name
character_data
Descriptive name of the subfeature, or a zero-length string if not a subfeature
is_supported
yes_or_no
YES
if the feature is fully supported by the current version of PostgreSQL, NO
if not
is_verified_by
character_data
Always null, since the PostgreSQL development group does not perform formal testing of feature conformance
comments
character_data
Possibly a comment about the supported status of the feature
Column Type
Description
specific_catalog
sql_identifier
Name of the database containing the function (always the current database)
specific_schema
sql_identifier
Name of the schema containing the function
specific_name
sql_identifier
The “specific name” of the function. See Section 37.45 for more information.
ordinal_position
cardinal_number
Ordinal position of the parameter in the argument list of the function (count starts at 1)
parameter_mode
character_data
IN
for input parameter, OUT
for output parameter, and INOUT
for input/output parameter.
is_result
yes_or_no
Applies to a feature not available in PostgreSQL
as_locator
yes_or_no
Applies to a feature not available in PostgreSQL
parameter_name
sql_identifier
Name of the parameter, or null if the parameter has no name
data_type
character_data
Data type of the parameter, if it is a built-in type, or ARRAY
if it is some array (in that case, see the view element_types
), else USER-DEFINED
(in that case, the type is identified in udt_name
and associated columns).
character_maximum_length
cardinal_number
Always null, since this information is not applied to parameter data types in PostgreSQL
character_octet_length
cardinal_number
Always null, since this information is not applied to parameter data types in PostgreSQL
character_set_catalog
sql_identifier
Applies to a feature not available in PostgreSQL
character_set_schema
sql_identifier
Applies to a feature not available in PostgreSQL
character_set_name
sql_identifier
Applies to a feature not available in PostgreSQL
collation_catalog
sql_identifier
Always null, since this information is not applied to parameter data types in PostgreSQL
collation_schema
sql_identifier
Always null, since this information is not applied to parameter data types in PostgreSQL
collation_name
sql_identifier
Always null, since this information is not applied to parameter data types in PostgreSQL
numeric_precision
cardinal_number
Always null, since this information is not applied to parameter data types in PostgreSQL
numeric_precision_radix
cardinal_number
Always null, since this information is not applied to parameter data types in PostgreSQL
numeric_scale
cardinal_number
Always null, since this information is not applied to parameter data types in PostgreSQL
datetime_precision
cardinal_number
Always null, since this information is not applied to parameter data types in PostgreSQL
interval_type
character_data
Always null, since this information is not applied to parameter data types in PostgreSQL
interval_precision
cardinal_number
Always null, since this information is not applied to parameter data types in PostgreSQL
udt_catalog
sql_identifier
Name of the database that the data type of the parameter is defined in (always the current database)
udt_schema
sql_identifier
Name of the schema that the data type of the parameter is defined in
udt_name
sql_identifier
Name of the data type of the parameter
scope_catalog
sql_identifier
Applies to a feature not available in PostgreSQL
scope_schema
sql_identifier
Applies to a feature not available in PostgreSQL
scope_name
sql_identifier
Applies to a feature not available in PostgreSQL
maximum_cardinality
cardinal_number
Always null, because arrays always have unlimited maximum cardinality in PostgreSQL
dtd_identifier
sql_identifier
An identifier of the data type descriptor of the parameter, unique among the data type descriptors pertaining to the function. This is mainly useful for joining with other instances of such identifiers. (The specific format of the identifier is not defined and not guaranteed to remain the same in future versions.)
parameter_default
character_data
The default expression of the parameter, or null if none or if the function is not owned by a currently enabled role.
|
| Name of the database that contains the constraint (always the current database) |
|
| Name of the schema that contains the constraint |
|
| Name of the constraint |
|
| Name of the database that contains the table that contains the column that is restricted by this constraint (always the current database) |
|
| Name of the schema that contains the table that contains the column that is restricted by this constraint |
|
| Name of the table that contains the column that is restricted by this constraint |
|
| Name of the column that is restricted by this constraint |
|
| Ordinal position of the column within the constraint key (count starts at 1) |
|
| For a foreign-key constraint, ordinal position of the referenced column within its unique constraint (count starts at 1); otherwise null |
|
| Name of the database that contains the constraint (always the current database) |
|
| Name of the schema that contains the constraint |
|
| Name of the constraint |
|
| Name of the database that contains the table (always the current database) |
|
| Name of the schema that contains the table |
|
| Name of the table |
|
| Type of the constraint: |
|
|
|
|
|
|
|
| Applies to a feature not available in PostgreSQL (currently always |
Column Type Description |
Identifier of the sizing item |
Descriptive name of the sizing item |
Value of the sizing item, or 0 if the size is unlimited or cannot be determined, or null if the features for which the sizing item is applicable are not supported |
Possibly a comment pertaining to the sizing item |
Column Type Description |
Name of the database containing the table (always the current database) |
Name of the schema containing the table |
Name of the table |
Name of the column |
Ordinal position of the column within the table (count starts at 1) |
Default expression of the column |
|
Data type of the column, if it is a built-in type, or |
If |
If |
If |
If |
If |
If |
If |
Applies to a feature not available in PostgreSQL (see |
Applies to a feature not available in PostgreSQL |
Applies to a feature not available in PostgreSQL |
Applies to a feature not available in PostgreSQL |
Name of the database containing the collation of the column (always the current database), null if default or the data type of the column is not collatable |
Name of the schema containing the collation of the column, null if default or the data type of the column is not collatable |
Name of the collation of the column, null if default or the data type of the column is not collatable |
If the column has a domain type, the name of the database that the domain is defined in (always the current database), else null. |
If the column has a domain type, the name of the schema that the domain is defined in, else null. |
If the column has a domain type, the name of the domain, else null. |
Name of the database that the column data type (the underlying type of the domain, if applicable) is defined in (always the current database) |
Name of the schema that the column data type (the underlying type of the domain, if applicable) is defined in |
Name of the column data type (the underlying type of the domain, if applicable) |
Applies to a feature not available in PostgreSQL |
Applies to a feature not available in PostgreSQL |
Applies to a feature not available in PostgreSQL |
Always null, because arrays always have unlimited maximum cardinality in PostgreSQL |
An identifier of the data type descriptor of the column, unique among the data type descriptors pertaining to the table. This is mainly useful for joining with other instances of such identifiers. (The specific format of the identifier is not defined and not guaranteed to remain the same in future versions.) |
Applies to a feature not available in PostgreSQL |
If the column is an identity column, then |
If the column is an identity column, then |
If the column is an identity column, then the start value of the internal sequence, else null. |
If the column is an identity column, then the increment of the internal sequence, else null. |
If the column is an identity column, then the maximum value of the internal sequence, else null. |
If the column is an identity column, then the minimum value of the internal sequence, else null. |
If the column is an identity column, then |
If the column is a generated column, then |
If the column is a generated column, then the generation expression, else null. |
|
Column Type Description |
Name of the role that granted the privilege |
Name of the role that the privilege was granted to |
Name of the database that contains the table (always the current database) |
Name of the schema that contains the table |
Name of the table |
Type of the privilege: |
|
In the SQL standard, |
Column Type Description |
An identifier string containing the number of the part |
Descriptive name of the part |
|
Always null, since the PostgreSQL development group does not perform formal testing of feature conformance |
Possibly a comment about the supported status of the part |
Column Type Description |
Name of the database containing the function (always the current database) |
Name of the schema containing the function |
The “specific name” of the function. See for more information. |
Name of the database containing the function (always the current database) |
Name of the schema containing the function |
Name of the function (might be duplicated in case of overloading) |
Name of the database that contains the table that is used by the function (always the current database) |
Name of the schema that contains the table that is used by the function |
Name of the table that is used by the function |
Name of the column that is used by the function |
Column Type Description |
Name of the database containing the view (always the current database) |
Name of the schema containing the view |
Name of the view |
Name of the database containing the function (always the current database) |
Name of the schema containing the function |
The “specific name” of the function. See for more information. |
The view view_table_usage
identifies all tables that are used in the query expression of a view (the SELECT
statement that defines the view). A table is only included if that table is owned by a currently enabled role.
System tables are not included. This should be fixed sometime.
Table 37.63. view_table_usage
Columns
The view view_column_usage
identifies all columns that are used in the query expression of a view (the SELECT
statement that defines the view). A column is only included if the table that contains the column is owned by a currently enabled role.
Columns of system tables are not included. This should be fixed sometime.
view_column_usage
ColumnsColumn Type
Description
table_catalog
sql_identifier
Name of the database that contains the view (always the current database)
table_schema
sql_identifier
Name of the schema that contains the view
table_name
sql_identifier
Name of the view
view_definition
character_data
Query expression defining the view (null if the view is not owned by a currently enabled role)
check_option
character_data
CASCADED
or LOCAL
if the view has a CHECK OPTION
defined on it, NONE
if not
is_updatable
yes_or_no
YES
if the view is updatable (allows UPDATE
and DELETE
), NO
if not
is_insertable_into
yes_or_no
YES
if the view is insertable into (allows INSERT
), NO
if not
is_trigger_updatable
yes_or_no
YES
if the view has an INSTEAD OF
UPDATE
trigger defined on it, NO
if not
is_trigger_deletable
yes_or_no
YES
if the view has an INSTEAD OF
DELETE
trigger defined on it, NO
if not
is_trigger_insertable_into
yes_or_no
YES
if the view has an INSTEAD OF
INSERT
trigger defined on it, NO
if not
Column Type
Description
view_catalog
sql_identifier
Name of the database that contains the view (always the current database)
view_schema
sql_identifier
Name of the schema that contains the view
view_name
sql_identifier
Name of the view
table_catalog
sql_identifier
Name of the database that contains the table that is used by the view (always the current database)
table_schema
sql_identifier
Name of the schema that contains the table that is used by the view
table_name
sql_identifier
Name of the table that is used by the view
Column Type
Description
view_catalog
sql_identifier
Name of the database that contains the view (always the current database)
view_schema
sql_identifier
Name of the schema that contains the view
view_name
sql_identifier
Name of the view
table_catalog
sql_identifier
Name of the database that contains the table that contains the column that is used by the view (always the current database)
table_schema
sql_identifier
Name of the schema that contains the table that contains the column that is used by the view
table_name
sql_identifier
Name of the table that contains the column that is used by the view
column_name
sql_identifier
Name of the column that is used by the view