Re: contrib/ltree patches - Mailing list pgsql-hackers

From Teodor Sigaev
Subject Re: contrib/ltree patches
Date
Msg-id 3DE48D6B.1060302@stack.net
Whole thread Raw
In response to contrib/ltree patches  (Dan Langille <dan@langille.org>)
Responses Re: contrib/ltree patches
List pgsql-hackers

Dan Langille wrote:
> I have been looking at contrib/ltree in the PostgreSQL repository.  I've
> modified the code to allow / as a node delimiter instead of . which is the
> default.
What is the reason for changing delimiter?

> 
> Below are the patches to make this change.  I have also moved the
> delimiter to a DEFINE so that other customizations are easily done.  This
> is a work in progress.
It's good.

> 
> My thanks to DarbyD for assistance.
> 
> cheers
> 
> 
> --- ltree.h.orig    Tue Nov 26 18:57:58 2002
> +++ ltree.h    Tue Nov 26 20:16:40 2002
> @@ -6,6 +6,8 @@
>  #include "utils/palloc.h"
>  #include "utils/builtins.h"
> 
> +#define    NODE_DELIMITER    '/'
> +
>  typedef struct
>  {
>      uint8        len;
> @@ -88,7 +90,7 @@
>  #ifndef abs
>  #define abs(a)                    ((a) <    (0) ? -(a) : (a))
>  #endif
> -#define ISALNUM(x)    ( isalnum((unsigned int)(x)) || (x) == '_' )
> +#define ISALNUM(x)    ( isalnum((unsigned int)(x)) || (x) == '_' || (x) == NODE_DELIMITER )
It seems to me  that it's mistake. ISALNUM shoud define correct character in 
name of node (level).  Try to test
with incorrect ltree value 'a..b'.

-- 
Teodor Sigaev
teodor@stack.net




pgsql-hackers by date:

Previous
From: Hannu Krosing
Date:
Subject: Re: [mail] Re: Native Win32 sources
Next
From: david luo
Date:
Subject: How can i import database from MSSQL to Postgres?(NULL BODY)