Boolean: Used when TRUE, FALSE or unknown. It can take NULL values.
Character: PostgreSQL provides three types of character data: CHAR(n), VARCHAR(n), and TEXT.
CHAR(n) is a space-filled fixed-length character. If you add a string expression that is shorter than the column’s length, PostgreSQL fills in the blanks. If you add a string expression longer than the column’s length, PostgreSQL will throw an error.
VARCHAR(n) is a variable-length string of characters. With VARCHAR(n) you can store up to n characters. PostgreSQL does not fill in the blanks when the stored string is shorter than the length of the column.
TEXT is a variable-length string of characters. Theoretically, text data is a string of characters of unlimited length.
Numeric: PostgreSQL provides two different numeric types: Integer and Floating-point numbers.
Integer: There are three types of integers in PostgreSQL.
Small integer (SMALLINT); It is a 2-byte signed integer.
Integer (INT): A 4-byte signed integer.
Same as a serial integer except for PostgreSQL automatically generates and places values in the SERIAL column.
Floating-Point Number: There are three types in PostgreSQL.
Float(n): a number with a precision of at least n and up to a maximum of 8 bytes.
Real or float8: It is a 4-byte number.
Numeric or numeric(p,s): a real number with s and p after the decimal point.
Temporary data types allow for storing date and/or time. PostgreSQL has five main types of temporal data.
Date stores only dates.
Time stores time of day values.
Timestamp stores both date and time values.
Timestampz is a timezone sensitive timestamp data type.
Interval stores time slots.
Timestampz is PostgreSQL’s extension of the SQL standard to temporary data types.