Search Postgresql Archives

Re: Add Foreign Keys To Table

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

 




-----Original Message-----
From: Rich Shepard [mailto:rshepard@xxxxxxxxxxxxxxx] 
Sent: Thursday, July 07, 2011 4:05 PM
To: David Johnston
Subject: RE:  Add Foreign Keys To Table

On Thu, 7 Jul 2011, David Johnston wrote:

> To do what you want to do look up "CREATE INDEX" in the documentation.

David,

   Now I understand this.

> You probably need to add "BOTH" fields to "station_information" and 
> then say something like.
>
> FOREIGN KEY (field1, field2) REFERENCES table (field1, field2) ...

   And this would be for each of the two added fields? Same syntax? I've not
used this approach before.

Thanks,

Rich

>>>>>>>>>>>>>>>>>>>>>>>>>

You would HAVE to do it at the TABLE level since a column-level constraint
can only reference that single column.

David J.




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