On Mon, 3 Sep 2001 tankgirl(at)worldonline(dot)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;