Thread: Foreign Key Dialog: Disabled "Add" Button

Foreign Key Dialog: Disabled "Add" Button

From
Ryan Adams
Date:
I am attempting to add a table with a foreign key referencing the
primary key of another table in the same schema.  When I try to add the
foreign key constraint, the Add button under the Columns tab is always
disabled.  I must be doing something incorrectly, and I'd like an idea
as what I need to change.  I am using pgAdmin III 1.02 under Linux.

For example, if I have a table:

CREATE TABLE development.referenced
( id int4 NOT NULL, CONSTRAINT referenced_id_pkey PRIMARY KEY (id)
) WITHOUT OIDS;

And another table:

CREATE TABLE development.referencer
( referenced int4 NOT NULL
) WITHOUT OIDS;

I could like to add the constraint that
development.referencer.referenced is a foreign key to the other table. 
I can do so in psql with:

ALTER TABLE development.referencer ADD FOREIGN KEY (referenced)
REFERENCES development.referenced (id);

I can't do this using the dialogs in pgAdmin III, however.  Any ideas
why?

Thanks in advance...

Ryan Adams