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 9B1809FAE4E for ; Tue, 30 May 2006 18:05:25 -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 17455-03 for ; Tue, 30 May 2006 18:05:20 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.186]) by postgresql.org (Postfix) with ESMTP id BBD3B9FA5E9 for ; Tue, 30 May 2006 18:05:19 -0300 (ADT) Received: by nf-out-0910.google.com with SMTP id y25so14354nfb for ; Tue, 30 May 2006 14:05:18 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=F8b0lzP3vGYMi8JaKMEZvvCxyOfvHmVUmjg5qkuySlnV+qu0Zf8kiV3y6XGcxrkpwFD8MMAD0DAyOXzEQLrdH5EYYZSjspGLBzPpSVEhqKq1QI1PpKRmCL3GnlHQAAWgov4TpOo/o8Ej7326ZM9khlynVx1Mn1SSunJr4ZxG8NY= Received: by 10.48.218.19 with SMTP id q19mr44804nfg; Tue, 30 May 2006 14:05:17 -0700 (PDT) Received: by 10.67.87.1 with HTTP; Tue, 30 May 2006 14:05:17 -0700 (PDT) Message-ID: <36e682920605301405u4d665fcftbe0a97b5753f5209@mail.gmail.com> Date: Tue, 30 May 2006 17:05:17 -0400 From: "Jonah H. Harris" To: Waldomiro Subject: Re: INSERT OU UPDATE WITHOUT SELECT? Cc: pgsql-performance@postgresql.org In-Reply-To: <447C8F1D.8090404@shx.com.br> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <447C8F1D.8090404@shx.com.br> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200605/550 X-Sequence-Number: 19337 On 5/30/06, Waldomiro wrote: > Is there a command to Insert a record If It does not exists and a update if > It exists? Sure, it's called MERGE. See http://en.wikipedia.org/wiki/Merge_%28SQL%29 > I mean the postgres should test if a record exist before insert and if It > exist then the postgres must do an update instead an insert. PostgreSQL does not support MERGE at the moment, sorry. -- Jonah H. Harris, Software Architect | phone: 732.331.1300 EnterpriseDB Corporation | fax: 732.331.1301 33 Wood Ave S, 2nd Floor | jharris@enterprisedb.com Iselin, New Jersey 08830 | http://www.enterprisedb.com/