Data types in PostgreSQL are the different kinds of data items that PostgreSQL supports. PostgreSQL supports a rich set of native data types (up to 43) that allow users to add all kinds of data to a database. If a data type isn’t supplied, it can be created using the CREATE TYPE
command.
The most common data types in PostgreSQL are given in this table:
S/N | Data Type | Aliases | Description |
---|---|---|---|
1 | bigint | int8 | signed eight-byte integer |
2 | boolean | bool | logical Boolean (true/false) |
3 | date | calendar date (year, month, day) | |
4 | integer | int, int4 | signed four-byte integer |
5 | double precision | float8 | double precision floating-point number (8 bytes) |
6 | character varying [ (n) ] | ||
7 | text | variable-length character string | |
8 | uuid | universally unique identifier | |