Re: FK question

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: FK question
Дата
Msg-id 20040828002515.GA9819@svana.org
обсуждение исходный текст
Ответ на FK question  ("Igor Kryltsov" <kryltsov@yahoo.com>)
Список pgsql-general
The second will allow combinations of (survey_id,employee_id) that are
not in employee_survey as long as the individual survey_id and
employee_id's exist. Whether that's a problem or not depends on your
schema....

On Thu, Aug 26, 2004 at 04:48:12PM +1000, Igor Kryltsov wrote:
> Hi,
>
> What is a difference, if any, between:
> _________________________________
> ALTER TABLE ONLY employee_role
>     ADD CONSTRAINT fk_survey_id_employee_id FOREIGN KEY (survey_id,
> employee_id) REFERENCES employee_survey(survey_id, employee_id) MATCH FULL
> ON UPDATE C
> ASCADE ON DELETE CASCADE;
> __________________________________
>
> AND
> ___________________________________
> ALTER TABLE ONLY employee_role
>     ADD CONSTRAINT fk_survey_id FOREIGN KEY (survey_id) REFERENCES
> employee_survey(survey_id) MATCH FULL ON UPDATE C
> ASCADE ON DELETE CASCADE;
>
> ALTER TABLE ONLY employee_role
>     ADD CONSTRAINT fk_employee_id FOREIGN KEY (employee_id) REFERENCES
> employee_survey(employee_id) MATCH FULL ON UPDATE C
> ASCADE ON DELETE CASCADE;
> _____________________________________
>
>
> Thank you,
>
>
> Igor
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)

--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

Вложения

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

Предыдущее
От: "Igor Kryltsov"
Дата:
Сообщение: FK question
Следующее
От: Michael Glaesemann
Дата:
Сообщение: Re: job for sql, pl/pgsql,gawk,perl or ??