Re: INSERT ON DUPLICATE KEY UPDATE

From: Eduardo Pérez Ureta <eperez(at)it(dot)uc3m(dot)es>
To: Richard Huxton <dev(at)archonet(dot)com>
Cc: Duane Lee - EGOVX <DLee(at)mail(dot)maricopa(dot)gov>, pgsql-general(at)postgresql(dot)org
Subject: Re: INSERT ON DUPLICATE KEY UPDATE
Date: 2004-06-18 20:36:21
Message-ID: 20040618203621.GA8023@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 2004-06-18 18:02:18 UTC, Richard Huxton wrote:
> Out of curiosity, why don't you know whether you're inserting or
> updating? It always worries me when I don't know what my application is
> doing.

This is the example:

I'm downloading a list of products from the web and they already have a
product_id (that's the primary key), in my table I have many fields that
I use myself like comments, stock, ... But when downloading the list I
only have the product_id, the product name, the price and the remote
stock. So I must insert data like the remote stock without removing any
of my data and leaving all the other columns unmodified.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2004-06-18 20:37:54 Re: PgSQL shut down
Previous Message Dennis Gearon 2004-06-18 20:16:45 UTF8 vs C_LOCALE