[PyGreSQL] PyGreSQL Digest, Vol 84, Issue 3

Maxim Yegorushkin maxim.yegorushkin at gmail.com
Sun Jul 17 12:20:20 EDT 2011


On Jul 17, 2011 4:30 PM, "Christoph Zwerschke" <cito at online.de> wrote:
>
> Am 16.07.2011 19:48 schrieb Christoph Zwerschke:
>
>> Good question. Pygres supports "pyformat", which means "extended" format
>> codes. Not sure whether the "extended" refers only to dictionary style
>> parameters or also other format codes - the specs are unclear. But we
>> should clarify this first.
>
>
> Seems there is no clear answer (I even asked on the DB-SIG mailing list).
If you use '%f' format then I think you should make sure you operate with
finite values.

Thinking more about this, if nan value gets formatted with %f the resulting
unquoted nan gets rejected by postgre. With this change such user code still
causes an exception, but a different one.

>
> So I've checked this in anyway, similar to what Maxim suggested, but with
some changes to make it work with older Py versions down to 2.3.

Nice one, thanks guys for turning this issue around so promptly.

-- Maxim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.vex.net/pipermail/pygresql/attachments/20110717/ce865c9c/attachment.html>


More information about the PyGreSQL mailing list