X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 3CD779FA5E9 for ; Tue, 30 May 2006 19:35:14 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 25946-04 for ; Tue, 30 May 2006 19:35:10 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from peufeu.com (boutiquenumerique.com [82.67.9.10]) by postgresql.org (Postfix) with ESMTP id E053A9FA5E1 for ; Tue, 30 May 2006 19:35:09 -0300 (ADT) Received: (qmail 16389 invoked from network); 31 May 2006 00:35:16 +0200 Received: from boutiquenumerique.com (HELO apollo13) (82.67.9.10) by boutiquenumerique.com with SMTP; 31 May 2006 00:35:16 +0200 To: "Jonah H. Harris" , Waldomiro Cc: pgsql-performance@postgresql.org Subject: Re: INSERT OU UPDATE WITHOUT SELECT? References: <447C8F1D.8090404@shx.com.br> <36e682920605301405u4d665fcftbe0a97b5753f5209@mail.gmail.com> Message-ID: Date: Wed, 31 May 2006 00:35:15 +0200 From: PFC Content-Type: text/plain; format=flowed; delsp=yes; charset=utf-8 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit In-Reply-To: <36e682920605301405u4d665fcftbe0a97b5753f5209@mail.gmail.com> User-Agent: Opera M2/8.54 (Linux, build 1745) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200605/553 X-Sequence-Number: 19340 > PostgreSQL does not support MERGE at the moment, sorry. Issue an UPDATE, and watch the rowcount ; if the rowcount is 0, issue an INSERT. Be prepared to retry if another transaction has inserted the row meanwhile, though. MERGE would be really useful.