Re: odd error... - Mailing list pgsql-general

From Doug McNaught
Subject Re: odd error...
Date
Msg-id m3u1c2jvti.fsf@varsoon.wireboard.com
Whole thread Raw
In response to odd error...  ("alex b." <mailinglists1@gmx.de>)
List pgsql-general
"alex b." <mailinglists1@gmx.de> writes:

> > Column "mp3checksum" of table "tcontent" needs a UNIQUE
> > constraint--does it have one?
>
> no it doesn't - because it is possible that the same exact file might
> be existent on multiple CDs...
> and therefore "mp3checksum" cannot have a UNIQUE constraint.
> am I right?

Then "mp3checksum" can't be a foreign key--a foreign key must be
unique in its own table.  If "tcontent" has a primary key, use that as
the foreign key in in the other table; if it doesn't, you might want
to create a SERIAL column to serve as the primary key.

-Doug

pgsql-general by date:

Previous
From: "alex b."
Date:
Subject: Re: odd error...
Next
From: Andy Lewis
Date:
Subject: Type Error