X-Original-To: pgsql-hackers-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 6E9BDD1F70C for ; Sat, 8 May 2004 22:50:15 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 49711-03 for ; Sat, 8 May 2004 22:49:58 -0300 (ADT) Received: from vscan01.westnet.com.au (vscan01.westnet.com.au [203.10.1.131]) by svr1.postgresql.org (Postfix) with ESMTP id 84250D1EFAF for ; Sat, 8 May 2004 22:49:54 -0300 (ADT) Received: from localhost (localhost.localdomain [127.0.0.1]) by localhost (Postfix) with ESMTP id 14F4352406; Sun, 9 May 2004 09:49:58 +0800 (WST) Received: from [192.168.1.9] (dsl-202-72-133-22.wa.westnet.com.au [202.72.133.22]) by vscan01.westnet.com.au (Postfix) with ESMTP id 961D15190C; Sun, 9 May 2004 09:49:57 +0800 (WST) Message-ID: <409D8E48.3070805@familyhealth.com.au> Date: Sun, 09 May 2004 09:50:00 +0800 From: Christopher Kings-Lynne User-Agent: Mozilla Thunderbird 0.6 (Windows/20040502) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Bruce Momjian Cc: elein , PostgreSQL-development Subject: Re: Adding MERGE to the TODO list (resend with subject) References: <200405082246.i48MkTQ29755@candle.pha.pa.us> In-Reply-To: <200405082246.i48MkTQ29755@candle.pha.pa.us> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200405/436 X-Sequence-Number: 53514 > What does the MERGE command do? I have never heard of it, so I doubt > someone is working on it. It is basically the SQL standard version of MySQL's REPLACE syntax. It does an update-else-insert set. However, the trick is that it uses some sort of next key locking to ensure that it cannot fail. Something that is impossible to do in PostgreSQL at the moment. Nested transactions will help, however. Chris