PostgreSQL & Mysql data types
PostgreSQL & Mysql data types
MySQL. This is one of the reasons why PostgreSQL is preferred for certain
applications that require complex data structures or advanced data types. Here’s a
comparison of some key data types supported by both databases:
Char, Varchar
Text
Varchar (with length), Char (with length)
Character (with length), Character Varying (with length)
MySQL:
Char, Varchar
Text (Tinytext, Text, Mediumtext, Longtext)
Enum, Set
Date/Time Data Types
PostgreSQL:
Date, Time
Datetime, Timestamp
Year
Boolean Data Type
PostgreSQL:
Boolean
MySQL:
JSON, JSONB
MySQL:
JSON
Geometric Data Types
PostgreSQL:
Point, Line, Lseg, Box, Path, Polygon, Circle
MySQL:
UUID
MySQL:
XML
MySQL:
XML