Re: Merging item codes using referential integrity

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: "Thomas F(dot)O'Connell" <tfo(at)sitening(dot)com>
Cc: Andrus Moor <nospameetasoftnospam(at)online(dot)ee>, pgsql-general(at)postgresql(dot)org
Subject: Re: Merging item codes using referential integrity
Date: 2005-03-28 16:23:11
Message-ID: 20050328162311.GA70881@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Mar 28, 2005 at 09:41:03AM -0600, Thomas F.O'Connell wrote:

> I've only been explaining general database theory and the rules of SQL
> in response to your posts because I'm still having a difficult time
> understanding what you're trying to accomplish.

I think he's trying to exploit ON UPDATE CASCADE so he can execute
a single UPDATE on the referenced table instead of having to write
multiple UPDATE statements, one for each referencing table. The
problem is that he's trying to change the referenced value from 2
to 1 but 1 already exists, so he gets a duplicate key error.

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message jian chen 2005-03-28 16:37:20 sorting Chinese varchar field
Previous Message Richard_D_Levine 2005-03-28 16:11:03 US DoD FOSS Recommendation