Re: "on existing update" construct - Mailing list pgsql-hackers

From Dev Kumkar
Subject Re: "on existing update" construct
Date
Msg-id CALSLE1N8R0VDHF=c-Sm11GObe=+jeBXQuVdRoHP-DEhfzMHo2g@mail.gmail.com
Whole thread Raw
In response to Re: "on existing update" construct  (Daniel Farina <daniel@heroku.com>)
List pgsql-hackers
Well ya, stored procedure also was thinking about pre-insert trigger.

Am sure folks here must have gone thru this and had alternatives. Also was reading about merge_by_key.

On Wed, May 15, 2013 at 12:51 PM, Daniel Farina <daniel@heroku.com> wrote:
On Wed, May 15, 2013 at 11:44 AM, Dev Kumkar <devdas.kumkar@gmail.com> wrote:
> Hello,
>
> Is there an alternative of Sybase "on existing update" construct in pgsql.
>
> "ON DUPLICATE KEY UPDATE" doesn't work.
>
> Thanks in advance!

No, you'll have to either handle this in the application or use a
stored procedure at this time.  The omission of such a construct from
psql's "\h" command and the manual is not in error.

pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Heap truncation without AccessExclusiveLock (9.4)
Next
From: Jon Nelson
Date:
Subject: Re: fallocate / posix_fallocate for new WAL file creation (etc...)