chtd / psycopg2cffi

Port to cffi with some speed improvements
Other
177 stars 43 forks source link

Wrong handling of postgresqls bigint #31

Closed pajowu closed 9 years ago

pajowu commented 9 years ago

If I use bigint, psycopg2cffi only uses unsigned int32. Large numbers become 2147483647.

lopuhin commented 9 years ago

Perhaps you can show some code that triggers it? I am just not quite sure which part or API is it - does it happen when reading bigint field from the database?

pajowu commented 9 years ago

Yes. I read large numbers ("5374144891846073" as an example in the databse), but I only get 2147483647 in the row via cursor.fetchone()

lopuhin commented 9 years ago

I need more info to reproduce - see b6d2dd4b - this test passes for me.

lopuhin commented 9 years ago

Ah, maybe it will fail on 32-bit

lopuhin commented 9 years ago

Should be fixed now (not uploaded to pypi yet), but could you give more information about your platform?

pajowu commented 9 years ago

32-Bit Arch Linux 3.17.6-1-ARCH Kernel with Pypy

lopuhin commented 9 years ago

Oh, that explains it. That was a really bad regression, thank you for reporting.

Uploaded to pypi