From: | Teodor Sigaev <teodor(at)sigaev(dot)ru> |
---|---|
To: | Alban Hertroys <alban(at)magproductions(dot)nl> |
Cc: | Postgres General <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: A few questions about ltree |
Date: | 2006-04-21 16:25:08 |
Message-ID: | 44490764.6070900@sigaev.ru |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
> Is it really necessary to insert an 'empty' record for the root node?
> The 'a' record from my experiments seems to be quite suited for the
> task, unless I'm missing something.
The root should be and it will be unremovable, because of foreign keys. But it
can be, of course, not empty.
>
>> alter table foo add foreign key subpath( path, 0, -1) references foo(
>> path )
>> deferrable initially deferred,;
>
> IIRC, you can define equality for custom types depending on the
> direction of the comparison. Isn't something like that possible for
> foreign keys? You'd be able to check whether the left hand of the
> comparison is a parent of the right hand and vice versa. That'd be just
> what we need...
Sorry, I don't know. I don't think that pgsql allows to use particular operator
for foreign key...
>
> I must be missing something, you've obviously put a lot of thought in
> ltree. Maybe it'll be possible with a future version of PostgreSQL :)
Make a patch to allow function in FK :)
--
Teodor Sigaev E-mail: teodor(at)sigaev(dot)ru
WWW: http://www.sigaev.ru/
From | Date | Subject | |
---|---|---|---|
Next Message | Stephan Szabo | 2006-04-21 16:33:14 | Re: A few questions about ltree |
Previous Message | Alban Hertroys | 2006-04-21 16:12:42 | Re: A few questions about ltree |