Update on Insert

From: Sebastian Feher <sfeher(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Update on Insert
Date: 2009-11-16 18:40:43
Message-ID: 33d2b7940911161040sf9a5fdm1818c525517b6cb7@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi Everyone,

Given a table "Items" with a PK "item1" and "Qty" - a numeric column
I'd like to define a way in Postgres to insert when item11 doesn't
exist already in "Items" and update the Qty by adding the new quantity
to the existent when the item11 exists. What is a good approach and
where should I be looking for details. Thanks.

Sebastian

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2009-11-16 18:51:08 Re: Need full search text on a shared hosting web site using 8.1.x
Previous Message Tom Lane 2009-11-16 18:39:58 Re: createdb errors and more