Re: contrib/ltree patches

Поиск
Список
Период
Сортировка
От Teodor Sigaev
Тема Re: contrib/ltree patches
Дата
Msg-id 3DE48D6B.1060302@stack.net
обсуждение исходный текст
Ответ на contrib/ltree patches  (Dan Langille <dan@langille.org>)
Ответы Re: contrib/ltree patches  ("Dan Langille" <dan@langille.org>)
Список 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 по дате отправления:

Предыдущее
От: Hannu Krosing
Дата:
Сообщение: Re: [mail] Re: Native Win32 sources
Следующее
От: david luo
Дата:
Сообщение: How can i import database from MSSQL to Postgres?(NULL BODY)