David David - 1 month ago 19
Python Question

Cryptic Psycopg2 error message

I am using Psycopg2 with PostgreSQL 8.4. While reading from a huge table, I suddenly get this cryptic error at the following line of code, after this same line of code has successfully fetched a few hundred thousand rows.

somerows = cursorToFetchData.fetchmany(30000)


psycopg2.DataError: invalid value "LÃ" for "DD"

DETAIL: Value must be an integer.

My problem is that I have no column named "DD", and about 300 columns in that table (I know 300 columns is a design flaw). I would appreciate a hint about the meaning of this error message, or how to figure out where the problem lies. I do not understand how Psycop2 can have any requirements about the datatype while fetching rows.

ed. ed.
Answer

Can you paste in the data from the row that's causing the problem? At a guess I'd say it's a badly formatted date entry, but hard to say.

(Can't comment, so has to be in a answer...)