Expecting problems

The main problem is that you might have trouble moving data to PostgreSQL. Just imagine you want to move some data and there is a NOT NULL constraint on the PostgreSQL side. We know MySQL does not care:

MariaDB [test]> SELECT      CAST('2014-02-99 10:00:00' AS datetime) AS x,      CAST('2014-02-09 10:00:00' AS datetime) AS y; +------+---------------------+ | x | y | +------+---------------------+ | NULL | 2014-02-09 10:00:00 | +------+---------------------+ 1 row in set, 1 warning (0.00 sec)

PostgreSQL will definitely reject February 99 (for a good reason), but it might not accept the NULL value either if you have explicitly banned it (for a good reason). What you have to do in this case is to somehow fix the data to make sure ...

Get Mastering PostgreSQL 10 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.