Was this helpful?
Data Types
There are four classes of data types: character, numeric, abstract and binary. Character strings can be fixed length (c and char) or variable length (text and varchar). Numeric strings can be exact numeric (i4, i2, or i1) or approximate numeric (float4 and float8). The abstract data types are date and money. Binary data can be fixed length (byte) or variable length (byte varying).
Class
Category
Data Type (Synonyms)
Character
Fixed length
c
 
 
char (character)
 
Varying length
text
 
 
varchar
Numeric
Exact numeric
integer4 (i4, integer)
 
 
integer2 (i2, smallint)
 
 
integer8 (i8, bigint)
 
 
integer1 (i1, tinyint)
 
 
decimal
 
Approximate numeric
float (float8, double precision)
 
 
float4 (real)
Abstract
(none)
date
 
(none)
money
Binary
 
byte
 
 
byte varying
Last modified date: 04/03/2024