Re: Problems with bulk update

From: Richard Huxton <dev(at)archonet(dot)com>
To: Venelin Arnaudov <v(dot)arnaudov(at)prosyst(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Problems with bulk update
Date: 2007-09-27 09:27:09
Message-ID: 46FB776D.5080406@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Venelin Arnaudov wrote:
> Hi
>
> I want to update the values of one column of a table based on the
> matches in a second table

> something like
> update table1
> set table1.field2_new=table2.new_id
> from table2
> where table1.field2_old=table2.old_id;

Did you try it?

http://www.postgresql.org/docs/8.2/static/sql-update.html

PG has a non-standard "FROM" extension for just this purpose.

--
Richard Huxton
Archonet Ltd

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Venelin Arnaudov 2007-09-27 10:38:03 Re: Problems with bulk update
Previous Message Venelin Arnaudov 2007-09-27 08:21:54 Problems with bulk update