pg_type
The catalog pg_type
stores information about data types. Base types and enum types (scalar types) are created with CREATE TYPE, and domains with CREATE DOMAIN. A composite type is automatically created for each table in the database, to represent the row structure of the table. It is also possible to create composite types with CREATE TYPE AS
.
Table 51.62. pg_type
Columns
Column Type Description |
---|
Row identifier |
Data type name |
The OID of the namespace that contains this type |
Owner of the type |
For a fixed-size type, |
|
|
|
True if the type is a preferred cast target within its |
True if the type is defined, false if this is a placeholder entry for a not-yet-defined type. When |
Character that separates two values of this type when parsing array input. Note that the delimiter is associated with the array element data type, not the array data type. |
If this is a composite type (see |
If |
If |
Input conversion function (text format) |
Output conversion function (text format) |
Input conversion function (binary format), or 0 if none |
Output conversion function (binary format), or 0 if none |
Type modifier input function, or 0 if type does not support modifiers |
Type modifier output function, or 0 to use the standard format |
Custom |
|
|
|
If this is a domain (see |
Domains use |
|
|
If |
|
Access privileges; see Section 5.7 for details |
For fixed-width types used in system tables, it is critical that the size and alignment defined in pg_type
agree with the way that the compiler will lay out the column in a structure representing a table row.
Table 51.63 lists the system-defined values of typcategory
. Any future additions to this list will also be upper-case ASCII letters. All other ASCII characters are reserved for user-defined categories.
Table 51.63. typcategory
Codes
Code | Category |
---|---|
A |
Array types |
B |
Boolean types |
C |
Composite types |
D |
Date/time types |
E |
Enum types |
G |
Geometric types |
I |
Network address types |
N |
Numeric types |
P |
Pseudo-types |
R |
Range types |
S |
String types |
T |
Timespan types |
U |
User-defined types |
V |
Bit-string types |
X |
unknown type |
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.