Re: A few questions about ltree
От | Teodor Sigaev |
---|---|
Тема | Re: A few questions about ltree |
Дата | |
Msg-id | 44490764.6070900@sigaev.ru обсуждение исходный текст |
Ответ на | Re: A few questions about ltree (Alban Hertroys <alban@magproductions.nl>) |
Список | 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@sigaev.ru WWW: http://www.sigaev.ru/
В списке pgsql-general по дате отправления: