Re: Ltree syntax improvement

From: Nikolay Shaplov <dhyan(at)nataraj(dot)su>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Cc: Chris Travers <chris(dot)travers(at)adjust(dot)com>, Dmitry Belyavsky <beldmit(at)gmail(dot)com>
Subject: Re: Ltree syntax improvement
Date: 2019-03-31 19:01:03
Message-ID: 2022407.P79Vr7n7W3@x200m
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

В письме от четверг, 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-defined
> hierarchies of labels, which might contain whitespace, Chinese, Japanese,
> or Korean characters, etc.
>
> I would love to be able to deprecate our work on this extension and
> eventually use stock ltree.
I am afraid, that if would not be possible to have ltree with custom
separator. Or we need to pass a very long way to reach there.

To have custom separator we will need some place to store it.

We can use GUC variable, and set separator for ltree globally. It might solve
some of the problems. But will get some more. If for example we dump database,
and then restore it on instance where that GUC option is not set, everything
will be brocken.

It is not opclass option (that are discussed here on the list), because
opclass options is no about parsing, but about comparing things that was
already parsed.

It is not option of an attribute (if we can have custom attribute option),
because we can have ltree as a variable, without creating an attribute...

It should be an option of ltree type itself. I have no idea how we can
implement this. And who will allow us to commit such strange thing ;-)

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2019-03-31 19:05:18 Re: COPY FROM WHEN condition
Previous Message Tom Lane 2019-03-31 18:46:51 Re: speeding up planning with partitions