MySQL, PostgreSQL and SQLite data types comparisons

MySQL PostgreSQL SQLite
int integer integer
tinyint smallint integer
smallint smallint integer
mediumint integer integer
bigint bigint integer
bit bit integer
int unsigned bigint integer
smallint unsigned integer integer
bigint unsigned numeric(20) integer
float real real
double double precision real
decimal decimal real
numeric numeric real
boolean boolean integer
date date text
time time text
datetime timestamp text
timestamp timestamp text
now() now() text
char char text
varchar varchar text
text text text
mediumtext text text
longtext text text
blob bytea blob

Leave a Reply

Your email address will not be published. Required fields are marked *