[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Question about what to do on duplicated parts keys



On Thursday 28 June 2007 17:36, Leah Kubik wrote:
> This gets us past that set of db updates, but now have a problem with
>
> ALTER TABLE partstax ADD PRIMARY KEY (parts_id, chart_id);
>
> If I don't set this primary key, I get stuck at the next lines:
>
> ALTER TABLE partstax ADD FOREIGN KEY (chart_id) REFERENCES chart (id);
> ALTER TABLE partstax ADD FOREIGN KEY (parts_id) REFERENCES parts (id);
>
> ERROR:  insert or update on table "partstax" violates foreign key
> constraint "partstax_parts_id_fkey"
> DETAIL:  Key (parts_id)=(14590) is not present in table "parts".
>
> Any idears what is best thing to do about this?

Just for the record for the list, we decided to do the following (thanks 
Chris):

http://ledgersmb.frauerpower.com/index.php/Database_Upgrade_Issuse_and_Work-arounds#Problems_with_partstax

Think it is going to work, but will update if problems.

Leah

-- 
Leah Kubik : d416-585-9971x692 : d416-703-5977 : m416-559-6511
Frauerpower! Co. : www.frauerpower.com : Toronto, ON Canada
MSN: ..hidden.. | AIM: frauerpower | Yahoo: h3inous
F9B6 FEFE 080B 8299 D7EA  1270 005C EC73 47C9 B7A6