Re: Adding a Foreign Key

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: Adding a Foreign Key
Дата
Msg-id Pine.BSF.4.21.0109031029270.76325-100000@megazone23.bigpanda.com
обсуждение исходный текст
Ответ на Adding a Foreign Key  (tankgirl@worldonline.es)
Список pgsql-general
On Mon, 3 Sep 2001 tankgirl@worldonline.es wrote:

>  Hello everyone,
>
>   I know that a Primary Key can be added to a table before it has been created, doing this...
>
> CREATE UNIQUE INDEX table_pkey ON table (atribute);
>
>   Well I wonder if a Foreign Key can also be added and what syntax does it follow.

alter table <table> add <table constraint definition>

ie something like:
alter table foo add constraint foo_fk foreign key(col)
 references bar(barcol) on update cascade deferrable
 initially deferred;



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

Предыдущее
От: Stephan Szabo
Дата:
Сообщение: Re: query not using index
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: Adding a Foreign Key