On Tue, 24 Mar 2009 23:37:04 +0800
OnMyWay <[email protected]> wrote:
> I get 0.0 value of money type from postgresql database when i am
> using DB.query('sql').getresult(). I research on google but most of
> the change log said it fixed after 3.5.1. Could any one know about
> this issue?
Can you clarify the problem? Is there a short SQL CREATE TABLE
definition and Python script that you can supply that shows the actual
error that you see? Here, for example, is what you seem to be trying
to describe above. Note parens after DB and assumption of default
database being available.
import pg
print pg.DB().query('sql').getresult()
And the result:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/pkg/lib/python2.5/site-packages/pg.py", line 313, in query
return self.db.query(qstr)
pg.ProgrammingError: ERROR: syntax error at or near "sql"
LINE 1: sql
^
If I change the second line to this:
print pg.DB().query("select '0.0'::money").getresult()
I get this:
[(Decimal("0.00"),)]
If this doesn't help then please explain your problem in more detail.
--
D'Arcy J.M. Cain
PyGreSQL Development Group
http://www.PyGreSQL.org
_______________________________________________
PyGreSQL mailing list
[email protected]
http://mailman.vex.net/mailman/listinfo/pygresql