Re: contrib/ltree patches

From: Teodor Sigaev <teodor(at)stack(dot)net>
To: Dan Langille <dan(at)langille(dot)org>
Cc: pgsql-hackers(at)postgresql(dot)org, oleg(at)sai(dot)msu(dot)su
Subject: Re: contrib/ltree patches
Date: 2002-11-27 09:16:27
Message-ID: 3DE48D6B.1060302@stack.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)stack(dot)net

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Luis Sousa 2002-11-27 10:05:24 Re: SQL query help!
Previous Message Jason E. Stewart 2002-11-27 09:15:20 Re: Interface update for 7.3