Re: Why UPDATE gl SET gl.glnum = gl.glnum; cause error when UPDATE gl

From: Douglas McNaught <doug(at)mcnaught(dot)org>
To: David Gagnon <dgagnon(at)siunik(dot)com>
Cc: Bruno Wolff III <bruno(at)wolff(dot)to>, pgsql-general(at)postgresql(dot)org
Subject: Re: Why UPDATE gl SET gl.glnum = gl.glnum; cause error when UPDATE gl
Date: 2005-07-08 16:25:05
Message-ID: m2mzoxl0ym.fsf@Douglas-McNaughts-Powerbook.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

David Gagnon <dgagnon(at)siunik(dot)com> writes:

> update test set id=test2.id from test2 where id=test2.id;
>
> ERROR: column reference "id" is ambiguous

It's complaining about the second use of "id", which could mean either
"test2.id" (which would be a self-join) or "test.id" (which is what
you want).

-Doug

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Michael Fuhr 2005-07-08 16:52:29 Re: dump the database data
Previous Message Stephen Bowman 2005-07-08 16:04:07 Re: Postgresql 7.4.8 inconsistent index usage