X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id CFD839DCCDD for ; Mon, 5 Dec 2005 19:08:43 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 71204-01 for ; Mon, 5 Dec 2005 19:08:45 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.200]) by postgresql.org (Postfix) with ESMTP id B12289DCCB0 for ; Mon, 5 Dec 2005 19:08:39 -0400 (AST) Received: by wproxy.gmail.com with SMTP id i1so205822wra for ; Mon, 05 Dec 2005 15:08:42 -0800 (PST) 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=eQlpTndImvcixZaw4Bf72sbGJmRma99T2ujAWT7TOMHfswWqMJIZNLVSrMF/M4DN+f1TCJkf2mGqF0HtWKedy///OPRbw+HLYvtDaR3Yg6EE1AFEwwTyO5GxSmkVNlbZGzvmxcBCgCKvX4VKHMQPSVgfS+AisbQNKJaRPdCRKCQ= Received: by 10.64.196.9 with SMTP id t9mr3379245qbf; Mon, 05 Dec 2005 15:08:42 -0800 (PST) Received: by 10.65.180.14 with HTTP; Mon, 5 Dec 2005 15:08:42 -0800 (PST) Message-ID: Date: Mon, 5 Dec 2005 18:08:42 -0500 From: Jaime Casanova To: Matthew Peter Subject: Re: update question Cc: pgsql-sql@postgresql.org In-Reply-To: <20051205225936.46340.qmail@web35212.mail.mud.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <20051205225936.46340.qmail@web35212.mail.mud.yahoo.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.227 required=5 tests=[AWL=0.227] X-Spam-Score: 0.227 X-Spam-Level: X-Archive-Number: 200512/29 X-Sequence-Number: 23571 On 12/5/05, Matthew Peter wrote: > I need a throw away value for an insert statement... example... > > update table > set value =3D 1, value =3D 2, throw_away_value -- so i don't break the qu= ery > where id =3D 1; > > Thanks > What do you mean by "throw away value"? are you trying to update and if the row doesn't exist then insert? if that is you can do a function in plpgsql and use exceptions for that... there is an example in the manuals -- regards, Jaime Casanova (DBA: DataBase Aniquilator ;)