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 19FC09DCCDD for ; Mon, 5 Dec 2005 19:41:23 -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 73609-09 for ; Mon, 5 Dec 2005 19:41:25 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from web35208.mail.mud.yahoo.com (web35208.mail.mud.yahoo.com [66.163.179.87]) by postgresql.org (Postfix) with SMTP id D92A19DCC70 for ; Mon, 5 Dec 2005 19:41:20 -0400 (AST) Received: (qmail 82347 invoked by uid 60001); 5 Dec 2005 23:41:23 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=VFdh0utOyVZAiuwvQUi1mhqa+M8X/72DlsfEiM+baLfis/3lrBWylCCsheRoikuenFIjwOMpAwNxQv9mOihNwnm2pRqEzkcwZqxW7nnQqzbOspfnrZpp/nyr2LzMTXFQmD/C7OtYTofrid8m9iiHkvqBVwv4nrKN9KahtpoHt3o= ; Message-ID: <20051205234123.82345.qmail@web35208.mail.mud.yahoo.com> Received: from [70.104.144.58] by web35208.mail.mud.yahoo.com via HTTP; Mon, 05 Dec 2005 15:41:23 PST Date: Mon, 5 Dec 2005 15:41:23 -0800 (PST) From: Matthew Peter Subject: Re: update question To: Jaime Casanova Cc: pgsql-sql@postgresql.org In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1718108945-1133826083=:79602" Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.36 required=5 tests=[AWL=-0.120, DNS_FROM_RFC_ABUSE=0.479, HTML_MESSAGE=0.001] X-Spam-Score: 0.36 X-Spam-Level: X-Archive-Number: 200512/30 X-Sequence-Number: 23572 --0-1718108945-1133826083=:79602 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit it's in a loop so there's an extra comma at the end so i was thinking i could put in a throw away value to keep the update from breaking if there's an additional comma Jaime Casanova wrote: On 12/5/05, Matthew Peter wrote: > I need a throw away value for an insert statement... example... > > update table > set value = 1, value = 2, throw_away_value -- so i don't break the query > where id = 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 ;) ---------------------------(end of broadcast)--------------------------- TIP 4: Have you searched our list archives? http://archives.postgresql.org --------------------------------- Yahoo! Personals Single? There's someone we'd like you to meet. Lots of someones, actually. Yahoo! Personals --0-1718108945-1133826083=:79602 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: 8bit
it's in a loop so there's an extra comma at the end so i was thinking i could put in a throw away value to keep the update from breaking if there's an additional comma

Jaime Casanova <systemguards@gmail.com> wrote:
On 12/5/05, Matthew Peter wrote:
> I need a throw away value for an insert statement... example...
>
> update table
> set value = 1, value = 2, throw_away_value -- so i don't break the query
> where id = 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 ;)

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org


Yahoo! Personals
Single? There's someone we'd like you to meet.
Lots of someones, actually. Yahoo! Personals --0-1718108945-1133826083=:79602--