Boolean and binary types
|
boolean, bool
|
A single true or false value.
|
SQL99
|
bit(
n
)
|
An
n
-length bit string (exactly
n
binary bits).
|
SQL92
|
bit varying(
n
), varbit(
n
)
|
A variable
n
-length bit string (up to
n
binary bits)
|
SQL92
|
Character types
|
character (
n
), char(
n
)
|
A fixed
n
-length character string.
|
SQL89
|
character varying(
n
), varchar(
n
)
|
A variable length character string of up to
n
characters.
|
SQL92
|
text
|
A variable length character string, of unlimited length.
|
PostgreSQL-specific
|
Numeric types
|
smallint, int2
|
A signed 2-byte integer.
|
SQL89
|
integer, int, int4
|
A signed, fixed-precision 4-byte number.
|
SQL92
|
bigint, int8
|
A signed 8-byte integer, up to 18 digits in length.
|
PostgreSQL-specific
|
real, float4
|
A 4-byte floating-point number.
|
SQL89
|
double precision, float8, float
|
An 8-byte floating-point number.
|
SQL89
|
numeric(
p
,
s
), decimal(
p
,
s
)
|
An exact numeric type with arbitrary precision
p
, and scale
s
.
|
SQL99
|
money
|
A fixed precision, U.S.-style currency.
|
PostgreSQL-specific, deprecated.
|
serial
|
An auto-incrementing 4-byte integer.
|
PostgreSQL-specific
|
Date and time types
|
date
|
The calendar date (day, month and year).
|
SQL92
|
time
|
The time of day.
|
SQL92
|
time with time zone
|
The time of day, including time zone information.
|
SQL92
|
timestamp (includes time zone)
|
Both the date and time.
|
SQL92
|
interval
|
An arbitrarily specified length of time.
|
SQL92
|
Geometric types
|
box
|
A rectangular box in a 2D plane.
|
PostgreSQL-specific
|
line
|
An infinite line in a 2D plane.
|
PostgreSQL-specific
|
lseg
|
A finite line segment in a 2D plane.
|
PostgreSQL-specific
|
circle
|
A circle with center and radius.
|
PostgreSQL-specific
|
path
|
Open and closed geometric paths in a two-dimensional plane.
|
PostgreSQL-specific
|
point
|
geometric point in a 2D plane
|
PostgreSQL-specific
|
polygon
|
A closed geometric path in a 2D plane.
|
PostgreSQL-specific
|
Network types
|
cidr
|
An IP network specification.
|
PostgreSQL-specific
|
inet
|
A network IP address, with optional subnet bits.
|
PostgreSQL-specific
|
macaddr
|
A MAC address (e.g., an Ethernet card's hardware address).
|
PostgreSQL-specific
|
System types
|
oid
|
An object (row) identifier.
|
PostgreSQL-specific
|
xid
|
A transaction identifier.
|
PostgreSQL-specific
|