Search Postgresql Archives

Re: Add Foreign Keys To Table

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

 



On Thu, 7 Jul 2011, John R Pierce wrote:

Since your PK of station_type is a composite, your foreign key must also be composite.

CREATE TABLE stuffed (
   id serial;
   otherestuffs text;
   sta varchar(50),
   sec varchar(50),
FOREIGN KEY (sta, sec) REFERENCES station_type(sta_type, secondary_type) );

  Thanks, John, for showing me how to apply this approach.

Rich

--
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