Re: odd error...

From: Doug McNaught <doug(at)mcnaught(dot)org>
To: "alex b(dot)" <mailinglists1(at)gmx(dot)de>
Cc: Postgresql General <pgsql-general(at)postgresql(dot)org>
Subject: Re: odd error...
Date: 2003-05-10 22:11:53
Message-ID: m3u1c2jvti.fsf@varsoon.wireboard.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"alex b." <mailinglists1(at)gmx(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Andy Lewis 2003-05-11 01:12:38 Type Error
Previous Message alex b. 2003-05-10 22:03:26 Re: odd error...