PostgreSQL Data Types
PostgreSQL supports various data types, and this page provides a compilation of commonly used data types in PostgreSQL.
-
bigint
PostgreSQLbigint
is an integer data type provided by PostgreSQL that is typically used to store integers that exceed the range of standard integer types. -
bigserial
bigserial
data type is a data type in PostgreSQL database used for automatically generating unique identifiers. -
boolean
Theboolean
data type in PostgreSQL is used to store boolean values, which represent true or false. -
box
box
is a data type in PostgreSQL used to represent a rectangular region on a plane. -
char
Thechar
data type is a data type in PostgreSQL used to store fixed-length strings. -
cidr
cidr
is a data type in PostgreSQL used to store IPv4 or IPv6 addresses and subnet masks. -
circle
The PostgreSQLcircle
data type represents a circle on a plane. -
citext
Thecitext
data type in PostgreSQL is a case-insensitive text type that allows ignoring case when performing text comparisons. -
date
In PostgreSQL,date
is a data type used to store date values. -
decimal
In PostgreSQL,decimal
is a fixed precision numeric data type that allows storing high-precision numbers with specified precision and scale. -
double precision
The PostgreSQLdouble precision
data type is a floating-point number with a precision of 15-17 digits, offering higher precision and a wider range compared to thefloat
data type. -
enum
The PostgreSQLenum
data type is a data type used to define enumerated types. -
inet
The PostgreSQLinet
data type is used for storing and processing IPv4 or IPv6 addresses. -
integer
In PostgreSQL,integer
is used to define the integer data type. -
interval
The PostgreSQLinterval
data type represents the difference between two dates or times. -
json
The PostgreSQLjson
data type can be used to store and query unstructured data. -
jsonb
The PostgreSQLjsonb
data type can be used to store and query unstructured data. -
line
In PostgreSQL, theline
data type can be used for storing and querying spatial data. -
lseg
In PostgreSQL, thelseg
data type can be used for storing and querying spatial data. -
numeric
The PostgreSQLnumeric
data type is used to store numbers with arbitrary precision. -
path
PostgreSQLpath
can store paths in two-dimensional planes, such as curves or polylines composed of multiple line segments. -
point
The PostgreSQLpoint
type is a data type in PostgreSQL used to store points in a two-dimensional Cartesian coordinate system. -
polygon
PostgreSQLpolygon
data type is used to store closed planar polygons. -
real
Thereal
data type in PostgreSQL is a floating-point type that can store single-precision floating-point numbers (32 bits). -
serial
Theserial
data type in PostgreSQL is a special data type used for automatically generating sequential numbers. -
smallint
In PostgreSQL,smallint
is a fixed-length integer data type used to store integers in the range of -32768 to 32767. -
text
In PostgreSQL, thetext
data type is used to store variable-length strings. -
time
In PostgreSQL, thetime
data type is used to store time values, including hours, minutes, seconds, and microseconds. -
timestamp
Thetimestamp
data type is a commonly used data type in PostgreSQL for storing date and time information. -
timestamptz
Thetimestamptz
(timestamp with time zone) data type in PostgreSQL is used to store timestamps with timezone information. -
timetz
Thetimetz
data type is one of the data types in PostgreSQL used to store time with time zone information. -
uuid
Theuuid
data type in PostgreSQL is used to store 128-bit globally unique identifiers (UUIDs), also known as GUIDs (Globally Unique Identifiers). -
varchar
varchar
is a commonly used data type in PostgreSQL for storing variable-length strings.