Re: updating table field whenever other table field changes

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: updating table field whenever other table field changes
Дата
Msg-id 20030403105228.V81447-100000@megazone23.bigpanda.com
обсуждение исходный текст
Ответ на updating table field whenever other table field changes  (tech7890@yahoo.com (Andrew))
Список pgsql-general
On 28 Mar 2003, Andrew wrote:

> Hello postgresql.questions group!
>
> What do you think the best way to attack the following is:
> parent table a - [status_field]
>
> child table b - [status_field]
>
> I need trigger or similar to achieve the following:
> if a.status_field changes than all children of table a have their
> b.status_field change to the same value as a.
>
> However if b.status_field changes its parent record, a.status_field,
> does not change.

How do the rows of a and b relate to each other?

> I also do not really understand CONSTRAINT TRIGGER and how it differs
> from a regular old TRIGGER.  What do these internal TRIGGERS,
> particularly "RI_FKey_noaction_upd" do?

That's the implementation for the ON UPDATE NO ACTION of a foreign key.
Generally speaking you won't want to make CONSTRAINT TRIGGERS (it's meant
as an internal thing for doing the foreign keys) unless you want it to
be deferrable.


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

Предыдущее
От: Jason Hihn
Дата:
Сообщение: Single Byte values
Следующее
От: Tom Lane
Дата:
Сообщение: Re: 'DROP INDEX' kills stored rpocedures