Sorry if this is not SA related, but I guess some of you could have already
met this problem and some could anyhow be interested. I have an application
in pygtk that uses sqlalchemy.  I noticed that it returns the floats rouded
(eg: 4.123 -> 4.0).

This turns out to be a problem of psycopg2 (psycopg behaves correctly) when
you 'import gtk' !!! It behaves correctly with numeric/decimal, though.

I'm totally clueless. Any hints?

sandro
*:-)




import gtk
import psycopg2 as ps2

DB = "host=localhost dbname=test user=test port=5432 password=xxx"
conn = ps2.connect(DB)
cursor = conn.cursor()
cursor.executeq("SELECT DISTINCT a_float FROM numbers ")
conn.commit()

rows = cursor.fetchall()
for row in rows:
    print row[0]

--
Sandro Dentella  *:-)
e-mail: [EMAIL PROTECTED] 
http://www.tksql.org                    TkSQL Home page - My GPL work


_______________________________________________
Sqlalchemy-users mailing list
Sqlalchemy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users

Reply via email to