Re: Problems with UPDATE

From: Evan Zane Macosko <macosko(at)fas(dot)harvard(dot)edu>
To: Andrew Gould <andrewgould(at)yahoo(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Problems with UPDATE
Date: 2001-08-20 20:33:29
Message-ID: Pine.OSF.4.33.0108201633160.25326-100000@is03.fas.harvard.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Forgot to mention: these profiles are about 6000 rows long.

On Mon, 20 Aug 2001, Andrew Gould wrote:

> If orf is not associated with a primary key or unique
> index, the possible combinations might well exceed
> 14,000. For example, if 3 records in yeast1 and 4
> records in temp share the same orf value, the query
> will update yeast1 12 times (i.e. the 3 yeast1 records
> will be updated 4 times each).
>
> Can you clarify (for the server or for us) the
> relationship between the tables? What primary keys or
> indexes do these tables have?
>
> Andrew
>
> --- Evan Zane Macosko <macosko(at)fas(dot)harvard(dot)edu> wrote:
> > Hello everyone,
> >
> >
> > I am having a strange problem using the UPDATE
> > function in Postgresql. I
> > want to move a large number (6000) of entries in one
> > table to another, so
> > here is my syntax:
> >
> > UPDATE yeast1 SET c1 = temp.profile_1 FROM temp
> > WHERE yeast1.orf =
> > temp.orf;
> >
> > This query results in over 14000 entries being
> > added! I end up with
> > multiples of the same entry, which obviously is
> > undesirable. Does anyone
> > have any suggestions on how to fix this?
> >
> > thanks!
> > Evan
> >
> >
> >
> >
> >
> > ---------------------------(end of
> > broadcast)---------------------------
> > TIP 2: you can get off all lists at once with the
> > unregister command
> > (send "unregister YourEmailAddressHere" to
> majordomo(at)postgresql(dot)org)
>
>
> __________________________________________________
> Do You Yahoo!?
> Make international calls for as low as $.04/minute with Yahoo! Messenger
> http://phonecard.yahoo.com/
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2001-08-20 20:52:14 Re: WAL
Previous Message Ed Loehr 2001-08-20 20:32:30 Handling db errors within transactions