Re: UPDATE one table with values from another

From: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
To: Josh Berkus <josh(at)agliodbs(dot)com>
Cc: Dan Langille <dan(at)langille(dot)org>, pgsql-sql(at)postgresql(dot)org
Subject: Re: UPDATE one table with values from another
Date: 2003-10-09 00:12:00
Message-ID: 20031008170912.Y3825@megazone.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Wed, 8 Oct 2003, Josh Berkus wrote:

> > UPDATE commit_log_ports_elements X
IIRC, PostgreSQL doesn't like aliases of the
update table, so I think you'll need to spell it
out in the WHERE.

> > SET X.needs_refresh = CLP.needs_refresh,
> > X.port_version = CLP.port_version,
> > X.port_revision = CLP.port_revision
I don't think you need the X.'s here anyway, there's
only one update table.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Dan Langille 2003-10-09 03:41:31 Re: UPDATE one table with values from another
Previous Message Josh Berkus 2003-10-08 23:37:57 Re: UPDATE one table with values from another