Ispirer Ispirer
Ispirer
 


Ispirer Home Page Ispirer SQLWays Product Page - Migration to PostgreSQL Request SQLWays

PostgreSQL Data Types

Versions: PostgreSQL 8.x and 7.x

Data Type Parameters and Range
Character Data Types
CHAR(n) - Fixed-length character data 1 ⇐ n ⇐ 1G, default is 1
VARCHAR(n) - Variable-length character data 1 ⇐ n ⇐ 1G, default is 1G
TEXT - Variable-length character data 1G
Integer Data Types
BIGINT - 64-bit integer data -263 to 263-1
INT, INTEGER - 32-bit integer data -231 to 231-1 (2G)
SMALLINT - 16-bit integer data -32768 to 32767
SERIAL - 32-bit auto-increment integer data -231 to 231-1 (2G)
BIGSERIAL - 64-bit auto-increment integer data -263 to 263-1
Decimal Data Types
NUMERIC(p,s), DECIMAL(p,s) - Fixed-point numeric data 1 ⇐ p ⇐ 1000, default is 1000; 0 ⇐ s ⇐ p, default is 0
Floating-Point Data Types
FLOAT(p) - Floating-point numeric data 1E-307 to 1E+308, 1 ⇐ p ⇐ 53, default is 53
REAL - 32-bit floating-point numeric data 1E-37 to 1E+37
DOUBLE PRECISION - 64-bit floating-point numeric data 1E-307 to 1E+308
Date and Time Data Types
DATE - Date data (year, month and day) January 01, 4713 BC to December 31, 5874897
TIME(p) - Time data (hours, minutes, seconds and microseconds) 00:00:00.000000 to 23:59:59.999999
0 ⇐ p ⇐ 6, default is 6 (microseconds)
TIMESTAMP(p) - Date and time data (year, month, day, hours, minutes, seconds and microseconds) January 01, 4713 BC 12:00:00.000000 AM to December 31, 5874897 11:59:59.999999 PM
INTERVAL(p) - Period of time Interval units: microsecond, millisecond, second, minute, hour, day, week, month, year, decade, century and millennium
Binary Data Types
BYTEA - Variable-length binary data 231-1 bytes (2G)
Other Data Types
MONEY - Monetary data -92233720368547758.08 to 92233720368547758.07
BOOLEAN - Boolean (bit) data TRUE, FALSE and NULL
UUID - Universally unique identifier

Data Types in Other Databases


Ispirer Home Page Ispirer SQLWays Product Page - Migration to PostgreSQL Request SQLWays

sqlways/postgresql/data-types.txt · Last modified: March 20, 2013, 04:07:26 AM (external edit)
 
Ispirer Ispirer © 1999-2017, Ispirer Systems Ltd.
All Rights Reserved.  Privacy Statement