Re: A few questions about ltree

Поиск
Список
Период
Сортировка
От Alban Hertroys
Тема Re: A few questions about ltree
Дата
Msg-id 4449047A.9080106@magproductions.nl
обсуждение исходный текст
Ответ на Re: A few questions about ltree  (Stephan Szabo <sszabo@megazone.bigpanda.com>)
Ответы Re: A few questions about ltree  (Stephan Szabo <sszabo@megazone.bigpanda.com>)
Список pgsql-general
Stephan Szabo wrote:
>>SQL> CREATE TABLE ltree_test (path ltree PRIMARY KEY REFERENCES
>>ltree_test(path));
>>NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index
>>"ltree_test_pkey" for table "ltree_test"
>>CREATE TABLE
>>SQL> INSERT INTO ltree_test VALUES ('a'::ltree);
>>INSERT 84117368 1
>>SQL> INSERT INTO ltree_test VALUES ('a.b'::ltree);
>>INSERT 84117369 1
>>SQL> INSERT INTO ltree_test VALUES ('a.b.c'::ltree);
>>INSERT 84117370 1
>>SQL> DELETE FROM ltree_test WHERE path = 'a.b'::ltree;
>>DELETE 1
>
> I'm not sure why you expect this to error. Any row that would reference
> a.b would be removed by the delete AFAICS.

Nope, there's no ON DELETE CASCADE on the FK, and RESTRICT is the
default (thankfully).

But the FK constraint apparently doesn't get triggered by the delete, so
neither case matters much here.

--
Alban Hertroys
alban@magproductions.nl

magproductions b.v.

T: ++31(0)534346874
F: ++31(0)534346876
M:
I: www.magproductions.nl
A: Postbus 416
    7500 AK Enschede

// Integrate Your World //

В списке pgsql-general по дате отправления:

Предыдущее
От: Stephan Szabo
Дата:
Сообщение: Re: A few questions about ltree
Следующее
От: "Brandon Metcalf"
Дата:
Сообщение: IDT timezone