Re: 'UPDATE OR INSERT' command - Mailing list pgsql-sql

From Stephen Frost
Subject Re: 'UPDATE OR INSERT' command
Date
Msg-id 20040715174932.GS21419@ns.snowman.net
Whole thread Raw
In response to 'UPDATE OR INSERT' command  (Jeff Kowalczyk <jtk@yahoo.com>)
List pgsql-sql
* Jeff Kowalczyk (jtk@yahoo.com) wrote:
> Is there a postgresql SQL idiom to perform an UPDATE, which becomes an
> INSERT if the primary key does not exist?
>
> I'm not sure I *should* use it in my application, I just want to know if
> it can be done. Thanks.

Unfortunately, I don't believe there's one in PostgreSQL yet.  MERGE is
similar to this, and is defined in the latest SQL spec.  Hopefully it'll
be implemented in PostgreSQL sometime soon.
Stephen

pgsql-sql by date:

Previous
From: Bruno Wolff III
Date:
Subject: Re: 'UPDATE OR INSERT' command
Next
From: Luis Sousa
Date:
Subject: Problem in age on a dates interval