| |
| Data Types |
| |
| Data types describe the content, capacity, and format of the data stored within a
column in a database table. When building a table, you can greatly increase the efficiency
of the resulting database by choosing the appropriate data types. PostgreSQL supports many
more data types than are required by the ANSI SQL92 Standard, including user-defined data
types. The following list enumerates the supported data types. |
| |
| Type Name |
Description |
| bigint |
signed eight-byte integer |
| bigserial |
autoincrementing eight-byte integer |
| bit |
fixed-length bit string |
| bit varying(n) |
variable-length bit string |
| boolean |
logical Boolean (true/false) |
| box |
rectangular box in 2D plane |
| bytea |
binary data |
| character(n) |
fixed-length character string |
| character varying(n) |
variable-length character string |
| cidr |
IP network address |
| circle |
circle in 2D plane |
| date |
calendar date (year, month, day) |
| double precision |
double precision floating-point number |
| inet |
IP host address |
| integer |
signed four-byte integer |
| interval(p) |
general-use time span |
| line |
infinite line in 2D plane |
| lseg |
line segment in 2D plane |
| macaddr |
MAC address |
| money |
US-style currency |
| numeric [ (p, s) ] |
exact numeric with selectable precision |
| oid |
object identifier |
| path |
open and closed geometric path in 2D plane |
| point |
geometric point in 2D plane |
| polygon |
closed geometric path in 2D plane |
| real |
single precision floating-point number |
| smallint |
signed two-byte integer |
| serial |
autoincrementing four-byte integer |
| text |
variable-length character string |
| time [ (p) ] [ without time zone ] |
time of day |
| time [ (p) ] with time zone |
time of day, including time zone |
| timestamp [ (p) ] without time zone |
date and time |
| timestamp [ (p) ] [ with time zone ] |
date and time, including time zone |
| |
| |