Search Postgresql Archives

Referencing Serial Type as Foreign Key

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

 



  Don't know why I've not come across this before, but I have now.

  In a table definition I reference the primary key of another table. That
key is of datatype SERIAL. In the referencing table, do I define the column
as

  col_name INTEGER REFERENCES other-table (primary_key_field),

or is the datatype SERIAL because that's what the referenced
primary_key_field is?

Thanks,

Rich

--
Dr. Richard B. Shepard, President
Applied Ecosystem Services, Inc. (TM)
<http://www.appl-ecosys.com>   Voice: 503-667-4517   Fax: 503-667-8863

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
     subscribe-nomail command to majordomo@xxxxxxxxxxxxxx so that your
     message can get through to the mailing list cleanly

[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