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 AA6BED1B513 for ; Mon, 10 May 2004 00:58:53 -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 27110-02 for ; Mon, 10 May 2004 00:58:33 -0300 (ADT) Received: from candle.pha.pa.us (candle.pha.pa.us [207.106.42.251]) by svr1.postgresql.org (Postfix) with ESMTP id 05250D1F07B for ; Mon, 10 May 2004 00:58:32 -0300 (ADT) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.11.6) id i4A3wCp02854; Sun, 9 May 2004 23:58:12 -0400 (EDT) From: Bruce Momjian Message-Id: <200405100358.i4A3wCp02854@candle.pha.pa.us> Subject: Re: Adding MERGE to the TODO list (resend with subject) In-Reply-To: <409DC28A.7010509@familyhealth.com.au> To: Christopher Kings-Lynne Date: Sun, 9 May 2004 23:58:12 -0400 (EDT) Cc: Alvaro Herrera , elein , PostgreSQL-development X-Mailer: ELM [version 2.4ME+ PL108 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII 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/456 X-Sequence-Number: 53534 Added to TODO: * Add MERGE command that does UPDATE, or on failure, INSERT --------------------------------------------------------------------------- Christopher Kings-Lynne wrote: > >>Except you can keep trying and trying without the outermost transaction > >>failing. > > > > But that won't provide the necessary next key locking you mentioned in > > your first email, will it? > > No, but since I can loop an infinite number of times until either the > update or insert works, I don't need next key locking. > > BTW, the reference in MySQL: > > http://dev.mysql.com/doc/mysql/en/REPLACE.html > > Hmm...no refernce to next key locking. Maybe that's an Innodb thing... > > Anyway, you can see how they've implemented their algorithm. > > Here is docs on the DB2 merge command from which the standard was derived: > > http://databasejournal.com/features/db2/article.php/10896_3322041_2 > > Chris > > ---------------------------(end of broadcast)--------------------------- > TIP 9: the planner will ignore your desire to choose an index scan if your > joining column's datatypes do not match > -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073