Thread: Ltree: set of allowed charcters is limited to [A-Za-z0-9_]. Could thedash "-" be included?

Dear friends,

I would like to use ltree for search paths in a warehouse application, something like "Material-Entry-01.Main-Aisle.Shelf-Aisle-R07/R08.R07-12-03"
Unfortunately I can not use common separators like dash (-) or slash(/)

Documentation states only thes characters [A-Za-z0-9_] are allowed.https://www.postgresql.org/docs/10/static/ltree.html

As far as I can see this limitation is set in source code of ltree, line 83: https://doxygen.postgresql.org/ltree_8h_source.html
#define ISALNUM(x) ( t_isalpha(x) || t_isdigit(x) || ( pg_mblen(x) == 1 && t_iseq((x), '_') ) )

I would appreciate if at least the dash (-) and perhaps also the slash(/) would be included to the list of allowed characters.

It is not only me, also other users are interested in this feature, some of them even changed the source code themselves to recompile their own Postgresql version..

best regards

Jörn Jaenecke

On Saturday, October 27, 2018, joernbs <joern.jaenecke@gmail.com> wrote:
Dear friends,

I would like to use ltree for search paths in a warehouse application, something like "Material-Entry-01.Main-Aisle.Shelf-Aisle-R07/R08.R07-12-03"
Unfortunately I can not use common separators like dash (-) or slash(/)

Documentation states only thes characters [A-Za-z0-9_] are allowed.https://www.postgresql.org/docs/10/static/ltree.html

I don’t see how this would be possible to do with the existing type - too much potential breakage of existing data.  Your example itself shows why using dash as a separator is a bad idea.

David J.

On Saturday, October 27, 2018, joernbs <joern.jaenecke@gmail.com> wrote:
Dear friends,

I would like to use ltree for search paths in a warehouse application, something like "Material-Entry-01.Main-Aisle.Shelf-Aisle-R07/R08.R07-12-03"
Unfortunately I can not use common separators like dash (-) or slash(/)

Documentation states only thes characters [A-Za-z0-9_] are allowed.https://www.postgresql.org/docs/10/static/ltree.html

I don’t see how this would be possible to do with the existing type - too much potential breakage of existing data.  Your example itself shows why using dash as a separator is a bad idea.

David J.

> On 27 Oct 2018, at 18:14, David G. Johnston <david.g.johnston@gmail.com> wrote:
>
>> On Saturday, October 27, 2018, joernbs <joern.jaenecke@gmail.com> wrote:
>> Dear friends,
>>
>> I would like to use ltree for search paths in a warehouse application, something like
"Material-Entry-01.Main-Aisle.Shelf-Aisle-R07/R08.R07-12-03"
>> Unfortunately I can not use common separators like dash (-) or slash(/)
>>
>> Documentation states only thes characters [A-Za-z0-9_] are
allowed.https://www.postgresql.org/docs/10/static/ltree.html
>>
> I don’t see how this would be possible to do with the existing type - too much potential breakage of existing data.
Yourexample itself shows why using dash as a separator is a bad idea. 

David,

I don't think he's talking about separators ;)

Alban Hertroys
--
If you can't see the forest for the trees,
cut the trees and you'll find there is no forest.



> On 27 Oct 2018, at 18:14, David G. Johnston <david.g.johnston@gmail.com> wrote:
>
>> On Saturday, October 27, 2018, joernbs <joern.jaenecke@gmail.com> wrote:
>> Dear friends,
>>
>> I would like to use ltree for search paths in a warehouse application, something like
"Material-Entry-01.Main-Aisle.Shelf-Aisle-R07/R08.R07-12-03"
>> Unfortunately I can not use common separators like dash (-) or slash(/)
>>
>> Documentation states only thes characters [A-Za-z0-9_] are
allowed.https://www.postgresql.org/docs/10/static/ltree.html
>>
> I don’t see how this would be possible to do with the existing type - too much potential breakage of existing data.
Yourexample itself shows why using dash as a separator is a bad idea. 

David,

I don't think he's talking about separators ;)

Alban Hertroys
--
If you can't see the forest for the trees,
cut the trees and you'll find there is no forest.




Hello David,

I think this is a misunderstanding.
The seperator in ltree is the dot (.) , of cause I did not asked to change that.
I asked about to expand allowed characters in the ltree-string [A-Za-z0-9_] to [a-zA-Z0-9_/- ] including dash(-), slash(/) and whitespace( ), common charcaters in wording or real path-names to be transformed into and from ltree.

Jörn

Am Sa., 27. Okt. 2018 um 18:14 Uhr schrieb David G. Johnston <david.g.johnston@gmail.com>:
On Saturday, October 27, 2018, joernbs <joern.jaenecke@gmail.com> wrote:
Dear friends,

I would like to use ltree for search paths in a warehouse application, something like "Material-Entry-01.Main-Aisle.Shelf-Aisle-R07/R08.R07-12-03"
Unfortunately I can not use common separators like dash (-) or slash(/)

Documentation states only thes characters [A-Za-z0-9_] are allowed.https://www.postgresql.org/docs/10/static/ltree.html

I don’t see how this would be possible to do with the existing type - too much potential breakage of existing data.  Your example itself shows why using dash as a separator is a bad idea.

David J.


Hello David,

I think this is a misunderstanding.
The seperator in ltree is the dot (.) , of cause I did not asked to change that.
I asked about to expand allowed characters in the ltree-string [A-Za-z0-9_] to [a-zA-Z0-9_/- ] including dash(-), slash(/) and whitespace( ), common charcaters in wording or real path-names to be transformed into and from ltree.

Jörn

Am Sa., 27. Okt. 2018 um 18:14 Uhr schrieb David G. Johnston <david.g.johnston@gmail.com>:
On Saturday, October 27, 2018, joernbs <joern.jaenecke@gmail.com> wrote:
Dear friends,

I would like to use ltree for search paths in a warehouse application, something like "Material-Entry-01.Main-Aisle.Shelf-Aisle-R07/R08.R07-12-03"
Unfortunately I can not use common separators like dash (-) or slash(/)

Documentation states only thes characters [A-Za-z0-9_] are allowed.https://www.postgresql.org/docs/10/static/ltree.html

I don’t see how this would be possible to do with the existing type - too much potential breakage of existing data.  Your example itself shows why using dash as a separator is a bad idea.

David J.