Re: INSERT OU UPDATE WITHOUT SELECT? - Mailing list pgsql-performance

From Jonah H. Harris
Subject Re: INSERT OU UPDATE WITHOUT SELECT?
Date
Msg-id 36e682920605301405u4d665fcftbe0a97b5753f5209@mail.gmail.com
Whole thread Raw
In response to INSERT OU UPDATE WITHOUT SELECT?  (Waldomiro <waldomiro@shx.com.br>)
Responses Re: INSERT OU UPDATE WITHOUT SELECT?  (PFC <lists@peufeu.com>)
List pgsql-performance
On 5/30/06, Waldomiro <waldomiro@shx.com.br> wrote:
>  Is there a command to Insert a record If It does not exists and a update if
> It exists?

Sure, it's called MERGE.  See http://en.wikipedia.org/wiki/Merge_%28SQL%29

>  I mean the postgres should test if a record exist before insert and if It
> exist then the postgres must do an update instead an insert.

PostgreSQL does not support MERGE at the moment, sorry.

--
Jonah H. Harris, Software Architect | phone: 732.331.1300
EnterpriseDB Corporation            | fax: 732.331.1301
33 Wood Ave S, 2nd Floor            | jharris@enterprisedb.com
Iselin, New Jersey 08830            | http://www.enterprisedb.com/

pgsql-performance by date:

Previous
From: Waldomiro
Date:
Subject: INSERT OU UPDATE WITHOUT SELECT?
Next
From: Ragnar
Date:
Subject: Re: Split select completes, single select doesn't and