MySQLとPostgresのデータ型対応表

  • 6
    いいね
  • 0
    コメント

よく使うものを中心に。

:dolphin: MySQL :elephant: Postgres 容量
TINYINT - :dolphin: 1B
SMALLINT SMALLINT 2B
INT INT 4B
BIGINT BIGINT 8B
FLOAT NUMERIC 4B
DATE DATE :dolphin: 1000-01-01〜9999-12-31
:elephant: 4713-01-01 BC〜:9999-12-31
DATETIME - 1000-01-01 00:00:00〜9999-12-31 23:59:59
TIME TIME 00:00:00〜23:59:59
TIMESTAMP TIMESTAMP :dolphin: 1970-01-01 00:00:01〜2038-01-19 03:14:07
:elephant: 4713-01-01 00:00:00 BC〜9999-12-31 00:00:00
CHAR CHAR :dolphin: 255B
:elephant: 1GB
VARCHAR VARCHAR :dolphin: 65KB
:elephant: 1GB
TINYTEXT - :dolphin: 255B
TEXT TEXT :dolphin: 65KB
:elephant: 1GB
MEDIUMTEXT - :dolphin: 16MB
LONGTEXT - :dolphin: 4GB