cascading delete - recursivity

Поиск
Список
Период
Сортировка
От Postgresql
Тема cascading delete - recursivity
Дата
Msg-id 9fti5q$2ccg$1@news.tht.net
обсуждение исходный текст
Ответы Re: cascading delete - recursivity  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Re: cascading delete - recursivity  (Jan Wieck <JanWieck@Yahoo.com>)
Список pgsql-sql
Hi,

I have a table of categories (it's pseudo-sql...) :

CATEGORIES
(   id_category PRIMARY KEY,   id_category_parent (FOREIGN KEY ? CONSTRAINT ??) ,   cat_text
)

There is recursivity : id_category_parent is -1 (= no parent cat) or the
id_category of a category in this table.
What is the SQL statements to create such a table so that when you delete a
category, all sub-categories
are automatically deleted ?
I've tried many things like CONSTRAINT... but the query fails !


Thanks !




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

Предыдущее
От: Hans-Jürgen Schönig
Дата:
Сообщение: Re: Distinct Values
Следующее
От: Markus Wagner
Дата:
Сообщение: audit trail and system catalogs