Re: Why UPDATE gl SET gl.glnum = gl.glnum; cause error when UPDATE gl - Mailing list pgsql-general

From Douglas McNaught
Subject Re: Why UPDATE gl SET gl.glnum = gl.glnum; cause error when UPDATE gl
Date
Msg-id m2mzoxl0ym.fsf@Douglas-McNaughts-Powerbook.local
Whole thread Raw
In response to Re: Why UPDATE gl SET gl.glnum = gl.glnum; cause error when UPDATE gl  (David Gagnon <dgagnon@siunik.com>)
List pgsql-general
David Gagnon <dgagnon@siunik.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

pgsql-general by date:

Previous
From: Stephen Bowman
Date:
Subject: Re: Postgresql 7.4.8 inconsistent index usage
Next
From: Michael Fuhr
Date:
Subject: Re: dump the database data