1/*Postgres is an object-relational database, while MySQL is a purely
2relational database. This means that Postgres includes features like
3table inheritance and function overloading, which can be important
4to certain applications. Postgres also adheres more closely to SQL
5standards.
6
7Postgres handles concurrency better than MySQL for multiple reasons:
8
9Postgres implements Multiversion Concurrency Control (MVCC) without
10read locks Postgres supports parallel query plans that can use multiple
11CPUs/cores Postgres can create indexes in a non-blocking way (through
12the CREATE INDEX CONCURRENTLY syntax), and it can create partial
13indexes (for example, if you have a model with soft deletes, you
14can create an index that ignores records marked as deleted)
15Postgres is known for protecting data integrity at the transaction
16level. This makes it less vulnerable to data corruption.*/
1MySQL PostgreSQL SQLite
2
3TINYINT SMALLINT INTEGER
4SMALLINT SMALLINT
5MEDIUMINT INTEGER
6BIGINT BIGINT
7BIT BIT INTEGER
8_______________________________________________________
9
10TINYINT UNSIGNED SMALLINT INTEGER
11SMALLINT UNSIGNED INTEGER
12MEDIUMINT UNSIGNED INTEGER
13INT UNSIGNED BIGINT
14BIGINT UNSIGNED NUMERIC(20)
15_______________________________________________________
16
17DOUBLE DOUBLE PRECISION REAL
18FLOAT REAL REAL
19DECIMAL DECIMAL REAL
20NUMERIC NUMERIC REAL
21_______________________________________________________
22
23BOOLEAN BOOLEAN INTEGER
24_______________________________________________________
25
26DATE DATE TEXT
27TIME TIME
28DATETIME TIMESTAMP
29_______________________________________________________
30
31TIMESTAMP DEFAULT TIMESTAMP DEFAULT TEXT
32NOW() NOW()
33_______________________________________________________
34
35LONGTEXT TEXT TEXT
36MEDIUMTEXT TEXT TEXT
37BLOB BYTEA BLOB
38VARCHAR VARCHAR TEXT
39CHAR CHAR TEXT
40_______________________________________________________
41
42columnname INT columnname SERIAL INTEGER PRIMARY
43AUTO_INCREMENT KEY AUTOINCREMENT