[Psycopg] About data types

Federico Di Gregorio fog@initd.org
17 Apr 2002 15:04:47 +0200


--=-hYdn5wykfDDQKR4q79ZC
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

Il mer, 2002-04-17 alle 15:07, zammon@libero.it ha scritto:
> Federico Di Gregorio wrote:
[snip]
> >psycopg is converting the values to python floats. there is no DECIMAL
> >type in python (is there?)
> >
> DECIMAL is an exact numeric data type not a float data type,
> Why about using the FixedPoint module or the gmpy module to represent=20
> this kind of data?

that's an option but, apart from DateTime, i don't like to pull other
module dependencies inside psycopg. that's exactly why i wrote the
register_type() function. the best thing would be for you to write some
wrapper classes around FixedPoint or gmpy and register them with
register_type(). then send the code to the list, that way we'll be able
to buil a library of psycopg casting objects, usefull to everybody.

ciao,
federico

--=20
Federico Di Gregorio
Debian GNU/Linux Developer & Italian Press Contact        fog@debian.org
INIT.D Developer                                           fog@initd.org
  Put a GNOME on your desktop! [http://www.gnome.org]
                                      -- brought to you by One Line Spam

--=-hYdn5wykfDDQKR4q79ZC
Content-Type: application/pgp-signature; name=signature.asc

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: Per informazioni si veda http://www.gnupg.org

iEYEABECAAYFAjy9cu8ACgkQvcCgrgZGjetiHgCeOChxNoiS+qzS2yWMphy1/wTU
hD0AnRmjA6CL8PcihSeDJphxLttFj0/X
=iHic
-----END PGP SIGNATURE-----

--=-hYdn5wykfDDQKR4q79ZC--