Re: Jsonb transform for pl/python

2018-10-05 Thread Peter Eisentraut
On 27/09/2018 16:58, Nikita Glukhov wrote: > Working on the new lazy transform for jsonb I found another memory leak in > PLyObject_ToJsonbValue(): palloc() for output boolean JsonbValue is > unnecessary, > 'out' variable is already initialized. > > Fix is attached. Committed, thanks. -- Peter

Re: Jsonb transform for pl/python

2018-09-27 Thread Nikita Glukhov
Working on the new lazy transform for jsonb I found another memory leak in PLyObject_ToJsonbValue(): palloc() for output boolean JsonbValue is unnecessary, 'out' variable is already initialized. Fix is attached. On 15.06.2018 14:42, Alexander Korotkov wrote: Hi! On Fri, Jun 15, 2018 at 2:11 PM

Re: Jsonb transform for pl/python

2018-07-11 Thread Alexander Korotkov
On Wed, Jul 11, 2018 at 12:30 AM Tom Lane wrote: > Peter Eisentraut writes: > > On 6/23/18 01:44, Nikita Glukhov wrote: > >> We are simply trying first to convert numeric to int64 if is does not have > >> digits after the decimal point, and then construct Python Int instead of > >> Decimal. Stan

Re: Jsonb transform for pl/python

2018-07-10 Thread Tom Lane
Peter Eisentraut writes: > On 6/23/18 01:44, Nikita Glukhov wrote: >> We are simply trying first to convert numeric to int64 if is does not have >> digits after the decimal point, and then construct Python Int instead of >> Decimal. Standard Python json.loads() does the same for exact integers.

Re: Jsonb transform for pl/python

2018-06-27 Thread Peter Eisentraut
On 6/23/18 01:44, Nikita Glukhov wrote: > We are simply trying first to convert numeric to int64 if is does not have > digits after the decimal point, and then construct Python Int instead of > Decimal. Standard Python json.loads() does the same for exact integers. We just had a very similar but

Re: Jsonb transform for pl/python

2018-06-22 Thread Nikita Glukhov
Hi! We have found another performance problem in this transform -- very slow conversion via I/O from PostgreSQL numerics (which are used for the representation of jsonb numbers) to Python Decimals. Attached patch with fix. We are simply trying first to convert numeric to int64 if is does not h

Re: Jsonb transform for pl/python

2018-06-15 Thread Alexander Korotkov
Hi! On Fri, Jun 15, 2018 at 2:11 PM Nikita Glukhov wrote: > > On 28.03.2018 15:43, Peter Eisentraut wrote: > > > On 3/21/18 18:50, Peter Eisentraut wrote: > >> On 3/12/18 11:26, Nikita Glukhov wrote: > >>> I have reviewed this patch. Attached new 6th version of the patch with > >>> v5-v6 delta-p

Re: Jsonb transform for pl/python

2018-06-15 Thread Nikita Glukhov
On 28.03.2018 15:43, Peter Eisentraut wrote: On 3/21/18 18:50, Peter Eisentraut wrote: On 3/12/18 11:26, Nikita Glukhov wrote: I have reviewed this patch. Attached new 6th version of the patch with v5-v6 delta-patch. Thanks for the update. I'm working on committing this. Committed. Everyt

Re: Jsonb transform for pl/python

2018-03-28 Thread Peter Eisentraut
On 3/21/18 18:50, Peter Eisentraut wrote: > On 3/12/18 11:26, Nikita Glukhov wrote: >> I have reviewed this patch. Attached new 6th version of the patch with >> v5-v6 delta-patch. > > Thanks for the update. I'm working on committing this. Committed. Everything seemed to work well. I just did

Re: Jsonb transform for pl/python

2018-03-21 Thread Peter Eisentraut
On 3/12/18 11:26, Nikita Glukhov wrote: > I have reviewed this patch. Attached new 6th version of the patch with > v5-v6 delta-patch. Thanks for the update. I'm working on committing this. -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote

Re: Jsonb transform for pl/python

2018-03-12 Thread Nikita Glukhov
On 01.02.2018 19:06, Peter Eisentraut wrote: On 1/12/18 10:43, Aleksander Alekseev wrote: The following review has been posted through the commitfest application: make installcheck-world: tested, passed Implements feature: tested, passed Spec compliant: tested, passed Documenta

Re: Jsonb transform for pl/python

2018-02-01 Thread Peter Eisentraut
On 1/12/18 10:43, Aleksander Alekseev wrote: > The following review has been posted through the commitfest application: > make installcheck-world: tested, passed > Implements feature: tested, passed > Spec compliant: tested, passed > Documentation:tested, passed > > LG

Re: Jsonb transform for pl/python

2018-01-12 Thread Aleksander Alekseev
The following review has been posted through the commitfest application: make installcheck-world: tested, passed Implements feature: tested, passed Spec compliant: tested, passed Documentation:tested, passed LGTM. The new status of this patch is: Ready for Committer

Re: Jsonb transform for pl/python

2018-01-12 Thread Anthony Bykov
On Fri, 12 Jan 2018 13:33:56 +1300 Thomas Munro wrote: > On Thu, Dec 7, 2017 at 12:40 AM, Anthony Bykov > wrote: > > Hello, > > fixed the issues: > > 1. Rising errors when invalid object being transformed. > > 2. We don't rise the exception when transforming range(3) only in > > python 2. In thi

Re: Jsonb transform for pl/python

2018-01-11 Thread Thomas Munro
On Thu, Dec 7, 2017 at 12:40 AM, Anthony Bykov wrote: > Hello, > fixed the issues: > 1. Rising errors when invalid object being transformed. > 2. We don't rise the exception when transforming range(3) only in > python 2. In third one it is an error. > > Please, find the 4-th version of the patch i

Re: Jsonb transform for pl/python

2017-12-11 Thread Tom Lane
Peter Eisentraut writes: > On 12/11/17 03:22, Anthony Bykov wrote: >>> Why not make this part of the plpythonu extension? It doesn't have to >>> be a separate contrib module. >> I thought about that, but the problem is that there will be no >> possibilities to create custom transform if we creat

Re: Jsonb transform for pl/python

2017-12-11 Thread Peter Eisentraut
On 12/11/17 03:22, Anthony Bykov wrote: >> Why not make this part of the plpythonu extension? It doesn't have to >> be a separate contrib module. >> > Hello, > I thought about that, but the problem is that there will be no > possibilities to create custom transform if we create this extension by >

Re: Jsonb transform for pl/python

2017-12-11 Thread Anthony Bykov
On Sat, 9 Dec 2017 16:57:05 -0500 Peter Eisentraut wrote: > On 12/6/17 06:40, Anthony Bykov wrote: > > Hello, > > fixed the issues: > > 1. Rising errors when invalid object being transformed. > > 2. We don't rise the exception when transforming range(3) only in > > python 2. In third one it is an

Re: Jsonb transform for pl/python

2017-12-09 Thread Peter Eisentraut
On 12/6/17 06:40, Anthony Bykov wrote: > Hello, > fixed the issues: > 1. Rising errors when invalid object being transformed. > 2. We don't rise the exception when transforming range(3) only in > python 2. In third one it is an error. > > Please, find the 4-th version of the patch in attachments t

Re: Jsonb transform for pl/python

2017-12-06 Thread Anthony Bykov
Hello, fixed the issues: 1. Rising errors when invalid object being transformed. 2. We don't rise the exception when transforming range(3) only in python 2. In third one it is an error. Please, find the 4-th version of the patch in attachments to this message. -- Anthony Bykov Postgres Professiona

Re: Jsonb transform for pl/python

2017-11-28 Thread Michael Paquier
On Mon, Nov 20, 2017 at 10:48 PM, Aleksander Alekseev wrote: > Well frankly I very much doubt that this: > [snip] > I'm afraid that tests fail on Python 3: So this still needs more work.. I am marking it as returned with feedback as there has been no updates for more than 1 week. -- Michael

Re: Jsonb transform for pl/python

2017-11-20 Thread Aleksander Alekseev
Hi Anthony, > thank you for your review. I took your comments into account in the > third version of the patch. In the new version, I've added all the > tests you asked for. The interesting thing is that: > 1. set or any other non-jsonb-transformable object is transformed into > string and added t

Re: Jsonb transform for pl/python

2017-11-20 Thread Anthony Bykov
On Mon, 13 Nov 2017 15:08:16 + Aleksander Alekseev wrote: > The following review has been posted through the commitfest > application: make installcheck-world: tested, passed > Implements feature: tested, passed > Spec compliant: tested, passed > Documentation:tes

Re: Jsonb transform for pl/python

2017-11-13 Thread Aleksander Alekseev
The following review has been posted through the commitfest application: make installcheck-world: tested, passed Implements feature: tested, passed Spec compliant: tested, passed Documentation:tested, passed Hi Anthony, Thank you for the new version of the patch! Here