I am migrating from a test SQLite database to a PostgreSQL database.
I have a sample object that is inserted in the database, that worked on SQLite but is giving me an error in PostgreSQL.
Code snippet is:
car = CarItem.objects.create(
user = motor_trend,
name = 'Camaro 2010',
category = cars,
condition = 'Used',
price = '28,547.00',
production_year = '2010',
color_interior = 'Black',
color_exterior = 'Inferno Orange Metallic',
reference = 'PRC17288',
location_of_creation = 'Undisclosed',
location_current = 'Columbus, OH, USA',
description = 'GORGEOUS ORANGE SS!!',
)
car.save()
I am getting a:
DatabaseError at /create/
value too long for type character varying(512)
Traceback
(...)
description = 'GORGEOUS ORANGE SS!!',
(...)
The description field of my model has a 512 max char length:
description = models.CharField(max_length=512,default='')
But there is no way that string is over 512 bytes.
I have read previous posts about this error, one referring to the encoding. Does not appear to be the case.
I am hosted on Webfaction. I created a database, with utf-8 encoding, and proceeded to use syncdb. Syncdb worked perfectly but now this object insertion fails.
Can somebody give some input? Thank you.