juanefren
juanefren

Reputation: 2968

Django Postgresql DatabaseError when filtering decimals

Each time I filter/exclude against a decimal field I get a Database Error saying:

"cant' adapt"

This doesn't happen in my local enviroment.

I am using Postgresql 8.3.11 in production and 8.4.5 in local enviroment.

I have just recently migrated from MYSQL. (I migrated each database locally and then load a pg_dump in the server for each database)

In MySQL models.DecimalField fields appears as DECIMAL(12,2) but in Postgresql they appear as numeric(12,2)

Any Ideas?

Upvotes: 1

Views: 462

Answers (1)

juanefren
juanefren

Reputation: 2968

I have found my answer here:

http://www.defitek.com/blog/2010/06/29/cant-adapt-type-decimal-error-with-django-apache-postgresql-psycopg2/

I hope this helps to more people! :)

Upvotes: 1

Related Questions