From: | Jeff Boes <jboes(at)nexcerpt(dot)com> |
---|---|
To: | Postgres-general <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Foreign key constraint generates unique index? |
Date: | 2001-05-18 15:13:22 |
Message-ID: | 20010518111322.6a518f96.jboes@nexcerpt.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Regarding my just-sent message about the addition of a unique key
where I didn't want one...
Aha! I now realize that just declaring a column as SERIAL is what
triggers the addition of the UNIQUE constraint. I thought it had to do
withe the REFERENCES clause.
I was thinking of SERIAL as a data type, and that it was desirable to
declare the foreign key column as SERIAL so that it would have the
same base type. I'll have to declare it as INTEGER of course.
That raises the next question: ideally, I'd want to make sure that my
FK column retains the same base type as the column it's pointing
at. So, for example, a future PG version might implement SERIAL as a
BIGINT or something, and I'd want my FK to reflect that. Doesn't seem
possible.
--
Jeff Boes vox 616.226.9550
Database Engineer fax 616.349.9076
Nexcerpt, Inc. jboes(at)nexcerpt(dot)com
From | Date | Subject | |
---|---|---|---|
Next Message | Dave Cramer | 2001-05-18 15:16:19 | Re: Java Access to Postgresql |
Previous Message | larry a price | 2001-05-18 15:10:48 | Re: Which OS to Use for Postgresql |