Expecting problems

The main problem is that we might have trouble moving data to PostgreSQL. Just imagine that you want to move some data and there is a NOT NULL constraint on the PostgreSQL side. We know that MySQL doesn't 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 09 (for good reason), but it might not accept the NULL value either if you have explicitly banned it (for good reason). What you have to do in this case is somehow fix the data to make sure that it honors the rules of your data models, which are in place for a reason. You shouldn't take this lightly, because you might have to change data that's actually wrong in the first place.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset