Hello,
I have problems with using OID as PK. I have created a
UNIQUE INDEX on the oid on a relation called CourseEvents.
The relation that is supposed to have a FK to CourseEvents
is CourseEventsForums and it has a field called ceid which
has oid as dtatype.
But when I try to create a FK to that table I get following
error:
---
PostgreSQL said: ERROR: UNIQUE constraint matching given
keys for referenced table "courseevents" not found
Your query:
ALTER TABLE CourseEventForums ADD CONSTRAINT
RefCourseEvents43
FOREIGN KEY (ceid)
REFERENCES CourseEvents(oid)
---
What is wrong?
Is it to prefer to use oid as PK? Or should I use SERIAL
instead? I thought it might be more efficient to use oid
and a waste of space to add another integer as PK.
Thanks in advance,
Jonas Bengtsson
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]