Re: deleting referenced data

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: deleting referenced data
Дата
Msg-id 20030826175542.GA17741@wolff.to
обсуждение исходный текст
Ответ на Re: deleting referenced data  (Richard Huxton <dev@archonet.com>)
Ответы Re: deleting referenced data  (Richard Huxton <dev@archonet.com>)
Re: deleting referenced data  (Andreas Fromm <Andreas.Fromm@physik.uni-erlangen.de>)
Список pgsql-general
On Tue, Aug 26, 2003 at 18:34:04 +0100,
  Richard Huxton <dev@archonet.com> wrote:
> On Tuesday 26 August 2003 15:06, Andreas Fromm wrote:
> >
> > When I delete a record of the table realtions I also want to delete the
> > record on the data-tables if there is no other record referencing them.
> > How can I do this?
>
> You want to add "ON DELETE CASCADE" to the REFERENCES... clause.
> See the SQL reference for full syntax details.

I don't think that is what he wants. He seems to want to go in the other
direction. That is going to require custom triggers and probably adding a
reference count column to data-tables.

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

Предыдущее
От: "Philip Boonzaaier"
Дата:
Сообщение: Re: Bulk Insert / Update / Delete
Следующее
От: Robby Russell
Дата:
Сообщение: Re: Fwd: installing postgres7.3.4 problem II