Search Postgresql Archives

Re: Is this a bug?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Harry Jackson" <harryjackson@xxxxxxxxx> writes:
> If I made a mistake and changed the "id" column to "user_id" then from
> some the statement executes.

> =# delete from map_users_roles where user_id = (select user_id from
> users WHERE  username = 'blah');

This is a standard "outer reference" construction, ie, user_id refers to
the field exposed in the outer-level query if there's no match in the
inner query.  Possibly the SQL spec authors should have made it a little
harder to invoke an outer reference, but they didn't.

			regards, tom lane


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux