Re: [HACKERS] [patch] PL/Python is too lossy with floats

2015-06-09 Thread Tom Lane
Peter Eisentraut writes: > On 6/1/15 5:34 AM, Marko Kreen wrote: >> Please reconsider backporting. > It's been like this forever, so I don't think it's appropriate to > backpatch this. http://www.postgresql.org/docs/devel/static/plpython-data.html states in so many words that floats are converte

Re: [HACKERS] [patch] PL/Python is too lossy with floats

2015-06-09 Thread Peter Eisentraut
On 6/1/15 5:34 AM, Marko Kreen wrote: > On Wed, Mar 11, 2015 at 9:49 PM, Peter Eisentraut wrote: >> On 3/3/15 9:32 AM, Marko Kreen wrote: >>> PL/Python uses str(v) to convert float data, but is lossy >>> by design. Only repr(v) is guaranteed to have enough >>> precision to make floats roundtrip p

Re: [HACKERS] [patch] PL/Python is too lossy with floats

2015-06-01 Thread Marko Kreen
On Wed, Mar 11, 2015 at 9:49 PM, Peter Eisentraut wrote: > On 3/3/15 9:32 AM, Marko Kreen wrote: >> PL/Python uses str(v) to convert float data, but is lossy >> by design. Only repr(v) is guaranteed to have enough >> precision to make floats roundtrip properly: > > committed In 9.3 and before, n

Re: [HACKERS] [patch] PL/Python is too lossy with floats

2015-03-11 Thread Peter Eisentraut
On 3/3/15 9:32 AM, Marko Kreen wrote: > PL/Python uses str(v) to convert float data, but is lossy > by design. Only repr(v) is guaranteed to have enough > precision to make floats roundtrip properly: committed -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make chang

[HACKERS] [patch] PL/Python is too lossy with floats

2015-03-03 Thread Marko Kreen
PL/Python uses str(v) to convert float data, but is lossy by design. Only repr(v) is guaranteed to have enough precision to make floats roundtrip properly: https://docs.python.org/2/library/functions.html#func-repr https://docs.python.org/2/library/functions.html#str Example: $ python >