From: Tom Lane <tgl@sss.pgh.pa.us>
To: Filip RembiaĆkowski <filip.rembialkowski@gmail.com>
Cc: Pgsql Hackers <pgsql-hackers@postgresql.org>
Cc: Teodor Sigaev <teodor@sigaev.ru>
Cc: Oleg Bartunov <obartunov@postgrespro.ru>
Subject: Re: fix for BUG #3720: wrong results at using ltree
Date: Sat, 06 Apr 2019 11:46:02 -0400
Message-ID: <28639.1554565562@sss.pgh.pa.us> (raw)
In-Reply-To: <CAP_rww=waX2Oo6q+MbMSiZ9ktdj6eaJj0cQzNu=Ry2cCDij5fw@mail.gmail.com>
References: <CAP_rww=waX2Oo6q+MbMSiZ9ktdj6eaJj0cQzNu=Ry2cCDij5fw@mail.gmail.com>
=?UTF-8?Q?Filip_Rembia=C5=82kowski?= <filip.rembialkowski@gmail.com> writes:
> Here is my attempt to fix a 12-years old ltree bug (which is a todo item).
> I see it's not backward-compatible, but in my understanding that's
> what is documented. Previous behavior was inconsistent with
> documentation (where single asterisk should match zero or more
> labels).
> http://archives.postgresql.org/pgsql-bugs/2007-11/msg00044.php
I took a quick look through this. I see where you're going with this,
and I agree that this coding seems like a better match to what it says
in the documentation:
... you can put ! (NOT) at the start to match any label that
doesn't match any of the alternatives.
However, it seems like Teodor and Oleg went to an awful lot of trouble
to implement some other behavior. It looks like what's there is trying
to do something like "true if this pattern does not match any label
between the matches for whatever's around it", rather than just "true
if this pattern does not match at one specific position". The number
of changes in the expected output for existing regression test cases
is also disheartening: it's fairly hard to believe that whoever wrote
the test cases didn't think those expected outputs were correct.
In short, I'm wondering if we should treat this as a documentation
bug not a code bug. But to do that, we'd need a more accurate
description of what the code is supposed to do, because the statement
quoted above is certainly not a match to the actual behavior.
BTW, if we do proceed in this direction, I wonder whether the
ltree_gist code needs any adjustments.
Thoughts?
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, filip.rembialkowski@gmail.com, teodor@sigaev.ru, obartunov@postgrespro.ru
Subject: Re: fix for BUG #3720: wrong results at using ltree
In-Reply-To: <28639.1554565562@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox