Re: Add Foreign Keys To Table

Поиск
Список
Период
Сортировка
От David Johnston
Тема Re: Add Foreign Keys To Table
Дата
Msg-id 01c301cc3ce4$eaa34380$bfe9ca80$@yahoo.com
обсуждение исходный текст
Ответ на Add Foreign Keys To Table  (Rich Shepard <rshepard@appl-ecosys.com>)
Список pgsql-general

-----Original Message-----
From: Rich Shepard [mailto:rshepard@appl-ecosys.com]
Sent: Thursday, July 07, 2011 4:05 PM
To: David Johnston
Subject: RE: [GENERAL] Add Foreign Keys To Table

On Thu, 7 Jul 2011, David Johnston wrote:

> To do what you want to do look up "CREATE INDEX" in the documentation.

David,

   Now I understand this.

> You probably need to add "BOTH" fields to "station_information" and
> then say something like.
>
> FOREIGN KEY (field1, field2) REFERENCES table (field1, field2) ...

   And this would be for each of the two added fields? Same syntax? I've not
used this approach before.

Thanks,

Rich

>>>>>>>>>>>>>>>>>>>>>>>>>

You would HAVE to do it at the TABLE level since a column-level constraint
can only reference that single column.

David J.




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

Предыдущее
От: Guillaume Lelarge
Дата:
Сообщение: Re: DELETE taking too much memory
Следующее
От: Rich Shepard
Дата:
Сообщение: Re: Add Foreign Keys To Table