prevent an update from occurring under certain conditions

Поиск
Список
Период
Сортировка
От Carol Cheung
Тема prevent an update from occurring under certain conditions
Дата
Msg-id 49CCF7B7.1060709@consumercontact.com
обсуждение исходный текст
Ответы Re: prevent an update from occurring under certain conditions
Список pgsql-novice
Hi,
I'm not sure where to look for information about how to accomplish this:

TABLES
state:
  id | state_name | active
----+------------+--------
   1 | Washington | t
   2 | Illinois   | t

county:
  id | county_name | active | state_id
----+-------------+--------+----------
   1 | King        | t      |        1
   2 | Jefferson   | t      |        1

I want to prevent an update to set a state's active to false if there
are any counties in that state that are active (county.active = true and
county.state_id = state.id)
Is this possible?

Thanks in advance for your help.

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

Предыдущее
От: Ruzsinszky Attila
Дата:
Сообщение: pgAdminIII and pg_dump upgrade
Следующее
От: David Saracini
Дата:
Сообщение: Re: prevent an update from occurring under certain conditions