Trusted answers to developer questions

What are common data types used in PostgreSQL?

Get Started With Machine Learning

Learn the fundamentals of Machine Learning with this free course. Future-proof your career by adding ML skills to your toolkit — or prepare to land a job in AI or Data Science.

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.

Most common data types

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

RELATED TAGS

postgresql

CONTRIBUTOR

Osinachi Chukwujama
Did you find this helpful?