On Wed, 8 Oct 2003, Josh Berkus wrote:
> Dan,
>
> > UPDATE commit_log_ports_elements X
> >SET X.needs_refresh = CLP.needs_refresh,
> >X.port_version = CLP.port_version,
> >X.port_revision = CLP.port_revision
>
> FROM commit_log_ports CLP
> WHERE X.commit_log_id = CLP.commit_lo
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
Dan,
> UPDATE commit_log_ports_elements X
>SET X.needs_refresh = CLP.needs_refresh,
>X.port_version = CLP.port_version,
>X.port_revision = CLP.port_revision
FROM commit_log_ports CLP
WHERE X.commit_log_id = CLP.commit_log_id
You can always ask this kind of thing on IRC .
I know there is a simple solution, but I can't remember what it is. :(
I have two similar tables. I want to update the fields from one table to
contain the values form the other. The two tables are:
laptop.freshports.org=# \d commit_log_ports
Table "public.commit_log_ports"
Column |