From: Richard Huxton <dev@archonet.com>
To: Venelin Arnaudov <v.arnaudov@prosyst.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Problems with bulk update
Date: Thu, 27 Sep 2007 10:27:09 +0100
Message-ID: <46FB776D.5080406@archonet.com> (raw)
In-Reply-To: <46FB6822.9060507@prosyst.com>
References: <46FB6822.9060507@prosyst.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: dev@archonet.com, v.arnaudov@prosyst.com
Subject: Re: Problems with bulk update
In-Reply-To: <46FB776D.5080406@archonet.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox