Re: Ltree syntax improvement

2020-09-30 Thread Michael Paquier
On Wed, Jul 01, 2020 at 03:23:30PM +0200, Daniel Gustafsson wrote: > Please submit a rebased version of the patch. Which has not happened after two months, so I have marked the patch as returned with feedback. -- Michael signature.asc Description: PGP signature

Re: Ltree syntax improvement

2020-07-01 Thread Daniel Gustafsson
> On 4 Apr 2020, at 01:26, Nikita Glukhov wrote: > Fixed patch attached. This patch cause a regression in the ltree_plpython module, it needs the below trivial change to make it pass again: --- a/contrib/ltree_plpython/expected/ltree_plpython.out +++ b/contrib/ltree_plpython/expected/ltree_plpy

Re: Ltree syntax improvement

2020-04-04 Thread Tom Lane
Nikita Glukhov writes: > Fixed patch attached. I looked through this again, and I still don't feel very happy with it. As I mentioned upthread, I'm not convinced that we ought to have *both* quoting and backslash-escaping in these datatypes. TIMTOWTDI may be a virtue to the Perl crowd, but to a

Re: Ltree syntax improvement

2020-04-03 Thread Nikita Glukhov
On 02.04.2020 19:16, Tom Lane wrote: Nikita Glukhov writes: Rebased patch attached. Thanks for rebasing! The cfbot's not very happy though: 4842ltxtquery_io.c: In function ‘makepol’: 4843ltxtquery_io.c:188:13: error: ‘escaped’ may be used uninitialized in this function [-Werror=maybe-unini

Re: Ltree syntax improvement

2020-04-02 Thread Tom Lane
Nikita Glukhov writes: > Rebased patch attached. Thanks for rebasing! The cfbot's not very happy though: 4842ltxtquery_io.c: In function ‘makepol’: 4843ltxtquery_io.c:188:13: error: ‘escaped’ may be used uninitialized in this function [-Werror=maybe-uninitialized] 4844 if (lenval - escaped <=

Re: Ltree syntax improvement

2020-04-02 Thread Nikita Glukhov
On 02.04.2020 2:46, Tom Lane wrote: Nikita Glukhov writes: [ latest version of ltree syntax extension ] This is going to need another rebase after all the other ltree hacking that just got done. However, I did include 0001 (use a switch) in the commit I just pushed, so you don't need to worr

Re: Ltree syntax improvement

2020-04-01 Thread Tom Lane
Nikita Glukhov writes: > [ latest version of ltree syntax extension ] This is going to need another rebase after all the other ltree hacking that just got done. However, I did include 0001 (use a switch) in the commit I just pushed, so you don't need to worry about that.

Re: Ltree syntax improvement

2020-03-26 Thread Nikita Glukhov
On 25.03.2020 2:08, Tom Lane wrote: Nikita Glukhov writes: Attached new version of the patch. I spent a little bit of time looking through this, and have a few comments: * You have a lot of places where tests for particular ASCII characters are done like this: if ((charlen == 1) &&

Re: Ltree syntax improvement

2020-03-24 Thread Tom Lane
Nikita Glukhov writes: > Attached new version of the patch. I spent a little bit of time looking through this, and have a few comments: * You have a lot of places where tests for particular ASCII characters are done like this: if ((charlen == 1) && t_iseq(src, '\\')) This is a tedious

Re: Ltree syntax improvement

2020-03-06 Thread Nikita Glukhov
Attached new version of the patch. I did major refactoring of ltree label parsing, extracting common parsing code for ltree, lquery, and ltxtquery. This greatly simplified state machines. On the advice of Tomas Vondra, I also extracted a preliminary patch with 'if' to 'switch' conversion. On 2

Re: Ltree syntax improvement

2020-01-21 Thread Tom Lane
Dmitry Belyavsky writes: > If the C part will be reviewed and considered mergeable, I'll update the > plpython tests. I haven't looked at any of the code involved in this, but I did examine the "failing" plpython test, and I'm quite distressed about that change of behavior. Simply removing the t

Re: Ltree syntax improvement

2020-01-21 Thread Dmitry Belyavsky
Dear Tomas, If the C part will be reviewed and considered mergeable, I'll update the plpython tests. On Mon, Jan 6, 2020 at 4:49 PM Tomas Vondra wrote: > Hi, > > This patch got mostly ignored since 2019-07 commitfest :-( The latest > patch (sent by Nikita) does not apply because of a minor conf

Re: Ltree syntax improvement

2020-01-06 Thread Tomas Vondra
Hi, This patch got mostly ignored since 2019-07 commitfest :-( The latest patch (sent by Nikita) does not apply because of a minor conflict in contrib/ltree/ltxtquery_io.c. I see the patch removes a small bit of ltree_plpython tests which would otherwise fail (with the "I don't know plpython" ju

Re: Ltree syntax improvement

2019-08-01 Thread Thomas Munro
On Thu, Jul 18, 2019 at 1:28 AM Nikita Glukhov wrote: > 1. I fixed some bugs (fixed patch with additional test cases is attached): Hi Nikita, Thanks. I have set this to "Needs review", in the September 'fest. -- Thomas Munro https://enterprisedb.com

Re: Ltree syntax improvement

2019-07-17 Thread Nikita Glukhov
Hi! I have looked at the patch and found some problems. 1. I fixed some bugs (fixed patch with additional test cases is attached): -- NULL 'lptr' pointer dereference at lquery_in() =# SELECT '*'::lquery; -- crash -- '|' after '*{n}' is wrongly handled (LQPRS_WAITEND state) =# SELECT '*{1}|2':

Re: Ltree syntax improvement

2019-07-11 Thread Dmitry Belyavsky
Dear Thomas, On Thu, Jul 11, 2019 at 11:20 AM Thomas Munro wrote: > On Wed, Jul 10, 2019 at 7:40 AM Dmitry Belyavsky > wrote: > > [ltree_20190709.diff] > > Hi Dmitry, > > You need to update contrib/ltree_plpython/expected/ltree_plpython.out, > otherwise check-world fails when built with Python

Re: Ltree syntax improvement

2019-07-11 Thread Thomas Munro
On Wed, Jul 10, 2019 at 7:40 AM Dmitry Belyavsky wrote: > [ltree_20190709.diff] Hi Dmitry, You need to update contrib/ltree_plpython/expected/ltree_plpython.out, otherwise check-world fails when built with Python support. The good news is that it looks like it fails because you fixed something!

Re: Ltree syntax improvement

2019-07-09 Thread Dmitry Belyavsky
On Mon, Jul 8, 2019 at 11:33 PM Alvaro Herrera wrote: > On 2019-Jul-08, Dmitry Belyavsky wrote: > > > I did not introduce any functions. I've just changed the parser. > > I mean the C-level functions -- count_parts_ors() and so on. > > Added a comment to count_parts_ors() The other functions in

Re: Ltree syntax improvement

2019-07-08 Thread Alvaro Herrera
On 2019-Jul-08, Dmitry Belyavsky wrote: > I did not introduce any functions. I've just changed the parser. I mean the C-level functions -- count_parts_ors() and so on. > I'm not sure that it makes sense to remove any tests as most of them were > written to catch really happened bugs during the i

Re: Ltree syntax improvement

2019-07-08 Thread Dmitry Belyavsky
Dear Alvaro, On Mon, Jul 8, 2019 at 11:16 PM Alvaro Herrera wrote: > On 2019-Jul-08, Dmitry Belyavsky wrote: > > > Dear Thomas, > > > > Thank you for your proofreading! > > > > Please find the updated patch attached. It also contains the missing > > escaping. > > I think all these functions you'

Re: Ltree syntax improvement

2019-07-08 Thread Alvaro Herrera
On 2019-Jul-08, Dmitry Belyavsky wrote: > Dear Thomas, > > Thank you for your proofreading! > > Please find the updated patch attached. It also contains the missing > escaping. I think all these functions you're adding should have a short sentence explaining what it does. I'm not really convin

Re: Ltree syntax improvement

2019-07-08 Thread Dmitry Belyavsky
Dear Thomas, Thank you for your proofreading! Please find the updated patch attached. It also contains the missing escaping. On Mon, Jul 8, 2019 at 10:39 AM Thomas Munro wrote: > On Wed, Apr 17, 2019 at 5:29 AM Dmitry Belyavsky > wrote: > > I've applied your patch. > > From my point of view,

Re: Ltree syntax improvement

2019-07-08 Thread Thomas Munro
On Wed, Apr 17, 2019 at 5:29 AM Dmitry Belyavsky wrote: > I've applied your patch. > From my point of view, there is no major difference between case and chain if > here. > Neither case nor ifs allow extracting the common code to separate function - > just because there seem to be no identical p

Re: Ltree syntax improvement

2019-04-16 Thread Dmitry Belyavsky
Dear Nikolay, Many thanks for your efforts! On Sat, Apr 6, 2019 at 2:29 PM Nikolay Shaplov wrote: > В письме от воскресенье, 24 февраля 2019 г. 14:31:55 MSK пользователь > Dmitry > Belyavsky написал: > > Hi! Am back here again. > > I've been thinking about this patch a while... Come to some con

Re: Ltree syntax improvement

2019-04-06 Thread Nikolay Shaplov
В письме от воскресенье, 24 февраля 2019 г. 14:31:55 MSK пользователь Dmitry Belyavsky написал: Hi! Am back here again. I've been thinking about this patch a while... Come to some conclusions and wrote some examples... First I came to idea that the best way to simplify the code is change the

Re: Ltree syntax improvement

2019-03-31 Thread Nikolay Shaplov
В письме от четверг, 7 марта 2019 г. 13:09:49 MSK пользователь Chris Travers написал: > We maintain an extension (https://github.com/adjust/wltree) > which has a fixed separator (::) and allows any utf-8 character in the tree. > > In our case we currently use our extended tree to store user-def

Re: Ltree syntax improvement

2019-03-07 Thread Filip Rembiałkowski
Good day. Sorry to pop in, but if you are active users of ltree, please let me know if you rely on the exclamation operator (negative matching)? I have just filed a patch, fixing very old bug - and it changes the logic substantially. https://commitfest.postgresql.org/23/2054/ - I'd be grateful fo

Re: Ltree syntax improvement

2019-03-07 Thread Chris Travers
On Tue, Feb 5, 2019 at 2:27 PM Nikolay Shaplov wrote: > В письме от вторник, 29 января 2019 г. 20:43:07 MSK пользователь Dmitry > Belyavsky написал: > > > Please find attached the patch extending the sets of symbols allowed in > > ltree labels. The patch introduces 2 variants of escaping symbols,

Re: Re: Ltree syntax improvement

2019-03-07 Thread David Steele
Hi Dmitry, This patch appears too complex to be submitted to the last CF, as Andres has also noted [1]. I have set the target version to PG13. Regards, -- -David da...@pgmasters.net [1] https://www.postgresql.org/message-id/20190216054526.zss2cufdxfeudr4i%40alap3.anarazel.de

Re: Ltree syntax improvement

2019-02-24 Thread Dmitry Belyavsky
Dear Nikolay, On Wed, Feb 20, 2019 at 12:28 PM Nikolay Shaplov wrote: > В письме от вторник, 29 января 2019 г. 20:43:07 MSK пользователь Dmitry > Belyavsky написал: > > Dear all, > > > > Please find attached the patch extending the sets of symbols allowed in > > ltree labels. The patch introduce

Re: Ltree syntax improvement

2019-02-20 Thread Nikolay Shaplov
В письме от вторник, 29 января 2019 г. 20:43:07 MSK пользователь Dmitry Belyavsky написал: > Dear all, > > Please find attached the patch extending the sets of symbols allowed in > ltree labels. The patch introduces 2 variants of escaping symbols, via > backslashing separate symbols and via quoti

Re: Ltree syntax improvement

2019-02-05 Thread Nikolay Shaplov
В письме от вторник, 29 января 2019 г. 20:43:07 MSK пользователь Dmitry Belyavsky написал: > Please find attached the patch extending the sets of symbols allowed in > ltree labels. The patch introduces 2 variants of escaping symbols, via > backslashing separate symbols and via quoting the labels

Ltree syntax improvement

2019-01-29 Thread Dmitry Belyavsky
Dear all, Please find attached the patch extending the sets of symbols allowed in ltree labels. The patch introduces 2 variants of escaping symbols, via backslashing separate symbols and via quoting the labels in whole for ltree, lquery and ltxtquery datatypes. -- SY, Dmitry Belyavsky diff --git