[Django]-Django shift to PostgreSQL fails to import fixtures, stating data too long

3👍

Sqlite does not enforce the length of a varchar(n). From the sqlite FAQ:

http://www.sqlite.org/faq.html#q9

3👍

Check the Postgres log file, it will log the full failed SQL statement including table name and offending string value.

👤vladr

1👍

To solve the actual problem, change your declaration to text. That will allow you to import your data and get it cleaned up. Then you can reapply a constraint.

0👍

Check the length of data from SQLLite inside fixtures/core.json that you are trying to insert to Postgres. It looks like the data exceed 30 length characters. Check your django model for property that is limited to 30 characters, then check your fixtures for data that exceeds that maximum length.

Leave a comment