Re: [SQL] Verificate values in other table?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [SQL] Verificate values in other table?
Дата
Msg-id 15068.942643093@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Verificate values in other table?  ("juman" <juman@spray.se>)
Список pgsql-sql
"juman" <juman@spray.se> writes:
> What I want to do is that if someone adds or updates a row in in table2 I
> want to verify that the <id> given exists in table1.

You can do this with a trigger --- I'd suggest writing it in plpgsql.
No canned example at hand, sorry, but there are examples of triggers
applying error checks in the plpgsql section of the manual.
        regards, tom lane


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

Предыдущее
От: Mark Stosberg
Дата:
Сообщение: how can tell if a column is a primary key?
Следующее
От: "Gary MacMinn"
Дата:
Сообщение: Re: [SQL] how can tell if a column is a primary key?