Search Postgresql Archives

Re: Postgres and multiple updates in one statement

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2009-07-27 at 11:50 -0400, Tom Lane wrote:
> Scott Marlowe <scott.marlowe@xxxxxxxxx> writes:
> > On Mon, Jul 27, 2009 at 8:48 AM, Jamie
> > Lawrence-Jenner<jamie.jenner@xxxxxxxxxxxxx> wrote:
> >> Our update statements are as follows
> >> 
> >> Update table set col1=x,col2=y where pkid=1;
> >> Update table set col1=x,col2=y where pkid=2;
> >> Update table set col1=x,col2=y where pkid=3;
> >> 
> >> Very simple and straight forward. Sometimes there could be as many as 50
> >> update statements to process.
> 
> > Might as well fire them each as separate statements inside one
> > transaction, since pkid is unique and non-repeated in the updates.
> 
> If they're all exactly the same pattern like that, it might be worth the
> trouble to set up a prepared statement.

Seems like an opportunity for the use of a function.

Joshua D. Drake


> 
> 			regards, tom lane
> 
-- 
PostgreSQL - XMPP: jdrake@xxxxxxxxxxxxxxxxxxxxx
   Consulting, Development, Support, Training
   503-667-4564 - http://www.commandprompt.com/
   The PostgreSQL Company, serving since 1997


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux