Re: how to do merge in postgres ("with upsert as" not supported)

From: Jim Nasby <Jim(dot)Nasby(at)BlueTreble(dot)com>
To: Tong Michael <michaelbleedgreen(at)gmail(dot)com>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: how to do merge in postgres ("with upsert as" not supported)
Date: 2015-02-27 08:34:40
Message-ID: 54F02C20.2030900@BlueTreble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 2/26/15 2:23 PM, Tong Michael wrote:
> I saw some people use "with upsert as", but my pgAdmin version(1.8)
> doesn't support it. Anyone has any ideas how to do merge in postgres?____

Actually, this feature is in active development and will hopefully make
it into 9.5.

In the meantime, take a look at Example 40-2 in the Trapping Errors
section of the plpgsql docs for how you can do this today:
http://www.postgresql.org/docs/9.4/interactive/plpgsql-control-structures.html#PLPGSQL-ERROR-TRAPPING
--
Jim Nasby, Data Architect, Blue Treble Consulting
Data in Trouble? Get it in Treble! http://BlueTreble.com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jim Nasby 2015-02-27 08:52:34 Re: Re: [pgadmin-support] Issue with a hanging apply process on the replica db after vacuum works on primary
Previous Message Marc Mamin 2015-02-27 07:57:15 Re: range type expression syntax