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
 
IPv4
An IPv4 host address.
4-byte, network address in dotted-decimal notation (four decimal numbers, each ranging from 0 to 255, separated by dots). For example: 172.16.254.1
 
IPv6
An IPv6 host address.
16-byte, network address in eight groups of four hexadecimal digits separated by colons. For example: 2001:0db8:85a3:0042:1000:8a2e:0370:7334
 
UUID
A unique 128-bit integer
Binary
 
byte
 
 
byte varying
Boolean
BOOLEAN
Literal values TRUE or FALSE, strings 'TRUE' or 'FALSE'
Last modified date: 08/29/2024