Search Postgresql Archives

Re: Add Foreign Keys To Table

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On July 7, 2011 10:40:11 AM Rich Shepard wrote:
> alter table station_information add column sta_type varchar(50)
> unique not null references station_type(sta_type);
> NOTICE:  ALTER TABLE / ADD UNIQUE will create implicit index
> "station_information_sta_type_key" for table "station_information"
> ERROR:  there is no unique constraint matching given keys for referenced
> table "station_type"
>    Reading the alter table document page for 9.x does not show me what I'm
> doing incorrectly.

You need a unique index on station_type.sta_type


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux