Update on Insert

From: SebiF <sfeher(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Update on Insert
Date: 2009-11-16 18:31:05
Message-ID: 48624cbf-bdee-43f8-bc56-bd670c19570d@j4g2000yqe.googlegroups.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

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:39:58 Re: createdb errors and more
Previous Message Raymond Rodgers 2009-11-16 18:30:40 Need full search text on a shared hosting web site using 8.1.x

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2009-11-16 18:31:24 Re: ORDER BY vs. volatile functions
Previous Message Robert Haas 2009-11-16 18:23:53 Re: next CommitFest