PostgreSQL Data Types
PostgreSQL supports various data types, and this page provides a compilation of commonly used data types in PostgreSQL.
-
bigint
PostgreSQLbigintis an integer data type provided by PostgreSQL that is typically used to store integers that exceed the range of standard integer types. -
bigserial
bigserialdata type is a data type in PostgreSQL database used for automatically generating unique identifiers. -
boolean
Thebooleandata type in PostgreSQL is used to store boolean values, which represent true or false. -
box
boxis a data type in PostgreSQL used to represent a rectangular region on a plane. -
char
Thechardata type is a data type in PostgreSQL used to store fixed-length strings. -
cidr
cidris a data type in PostgreSQL used to store IPv4 or IPv6 addresses and subnet masks. -
circle
The PostgreSQLcircledata type represents a circle on a plane. -
citext
Thecitextdata type in PostgreSQL is a case-insensitive text type that allows ignoring case when performing text comparisons. -
date
In PostgreSQL,dateis a data type used to store date values. -
decimal
In PostgreSQL,decimalis a fixed precision numeric data type that allows storing high-precision numbers with specified precision and scale. -
double precision
The PostgreSQLdouble precisiondata type is a floating-point number with a precision of 15-17 digits, offering higher precision and a wider range compared to thefloatdata type. -
enum
The PostgreSQLenumdata type is a data type used to define enumerated types. -
inet
The PostgreSQLinetdata type is used for storing and processing IPv4 or IPv6 addresses. -
integer
In PostgreSQL,integeris used to define the integer data type. -
interval
The PostgreSQLintervaldata type represents the difference between two dates or times. -
json
The PostgreSQLjsondata type can be used to store and query unstructured data. -
jsonb
The PostgreSQLjsonbdata type can be used to store and query unstructured data. -
line
In PostgreSQL, thelinedata type can be used for storing and querying spatial data. -
lseg
In PostgreSQL, thelsegdata type can be used for storing and querying spatial data. -
numeric
The PostgreSQLnumericdata type is used to store numbers with arbitrary precision. -
path
PostgreSQLpathcan store paths in two-dimensional planes, such as curves or polylines composed of multiple line segments. -
point
The PostgreSQLpointtype is a data type in PostgreSQL used to store points in a two-dimensional Cartesian coordinate system. -
polygon
PostgreSQLpolygondata type is used to store closed planar polygons. -
real
Therealdata type in PostgreSQL is a floating-point type that can store single-precision floating-point numbers (32 bits). -
serial
Theserialdata type in PostgreSQL is a special data type used for automatically generating sequential numbers. -
smallint
In PostgreSQL,smallintis a fixed-length integer data type used to store integers in the range of -32768 to 32767. -
text
In PostgreSQL, thetextdata type is used to store variable-length strings. -
time
In PostgreSQL, thetimedata type is used to store time values, including hours, minutes, seconds, and microseconds. -
timestamp
Thetimestampdata 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
Thetimetzdata type is one of the data types in PostgreSQL used to store time with time zone information. -
uuid
Theuuiddata type in PostgreSQL is used to store 128-bit globally unique identifiers (UUIDs), also known as GUIDs (Globally Unique Identifiers). -
varchar
varcharis a commonly used data type in PostgreSQL for storing variable-length strings.