[Q]updating multiple rows with Different values

From: "V S P" <toreason(at)fastmail(dot)fm>
To: pgsql-general(at)postgresql(dot)org
Subject: [Q]updating multiple rows with Different values
Date: 2008-11-23 03:04:48
Message-ID: 1227409488.5936.1286260393@webmail.messagingengine.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Hello,
searched documentation, FAQ and mailing list archives
(mailing list archive search is volumous :-) )

but could not find an answer:

I would like to be able to update
several rows to different values at the same time

In oracle this used to be called Array update or
'collect' update or 'bulk' update -- but those
keywords did not bring anything for Postgresql.

for example tbl_1 has two columns id and col1

update tbl_1 set
col1=3 where id=25,
col1=5 where id=26

I am using PHP PDO (and hoping that if there is a mechanism
within postgresql to do that PDO will support it as well).

Thank you in advance,
VSP

--
V S P
toreason(at)fastmail(dot)fm

--
http://www.fastmail.fm - Access all of your messages and folders
wherever you are

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2008-11-23 03:08:00 Re: Postgres mail list traffic over time
Previous Message Scott Marlowe 2008-11-23 01:09:45 Re: Using Postgres to store high volume streams of sensor readings

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2008-11-23 03:34:21 Re: Cool hack with recursive queries
Previous Message Euler Taveira de Oliveira 2008-11-23 01:39:32 Re: portability of "designated initializers"