Referencing Serial Type as Foreign Key - Mailing list pgsql-general

From Rich Shepard
Subject Referencing Serial Type as Foreign Key
Date
Msg-id Pine.LNX.4.62.0506031006480.21666@salmo.appl-ecosys.com
Whole thread Raw
Responses Re: Referencing Serial Type as Foreign Key  ("Joshua D. Drake" <jd@commandprompt.com>)
List pgsql-general
   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

pgsql-general by date:

Previous
From: Sean Davis
Date:
Subject: Re: Test for array slice?
Next
From: "Joshua D. Drake"
Date:
Subject: Re: Referencing Serial Type as Foreign Key