Re: Foreign Keys

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: Foreign Keys
Дата
Msg-id 20031121210445.GA8080@wolff.to
обсуждение исходный текст
Ответ на Foreign Keys  ("Thomas LeBlanc" <thomasatiem@hotmail.com>)
Список pgsql-general
On Fri, Nov 21, 2003 at 14:35:54 -0600,
  Thomas LeBlanc <thomasatiem@hotmail.com> wrote:
> I am able to enter a null in a foreign key field in one table(table2)
> without the foreign key relationship (table1.t1_id) validating the value.
> Why is this?

That is how foreign keys work. If you don't want null values for the
foreign key, use a not null constraint in addition to the foreign
key constraint.

You shouldn't be using null key values in the referenced table.

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

Предыдущее
От: Dima Tkach
Дата:
Сообщение: Re: Two rules on a view do not like each other :-(
Следующее
От: Alvaro Herrera Munoz
Дата:
Сообщение: Re: Execute vacuum