Problem with FOR UPDATE
Problem with FOR UPDATE
От:
Kaloyan Iliev <news1@faith.digsys.bg>
Дата:
Hi All, I have a query in which I want to SELECT FOR UPDATE same rows but only from one table. Firs I try just with SELECT FOR UPDATE but I receive an error because of the LEFT JOIN - "ERROR: SELECT FOR UPDATE/SHARE cannot be applied to the nullable side of an outer join". So I decide to use SELECT FOR UPDATE OF
Re: Problem with FOR UPDATE
От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Kaloyan Iliev writes: > rsr=# SELECT > ... > rsr-# FROM debts_desc DD LEFT JOIN config > C ON (DD.conf_id = C.id), > ... > rsr-# FOR UPDATE OF > debts_desc; > ERROR: relation "debts_desc" in FOR UPDATE/SHARE clause not found in > FROM clause Use the alias, ie, DD. Remember that an alias hides the real name of that table for all purposes in the current query. regards, tom lane
Re: Problem with FOR UPDATE
От:
Stephan Szabo <sszabo@megazone.bigpanda.com>
Дата:
On Thu, 7 Sep 2006, Kaloyan Iliev wrote: > Hi All, > I have a query in which I want to SELECT FOR UPDATE same rows but only > from one table. > Firs I try just with SELECT FOR UPDATE but I receive an error > because of the LEFT JOIN - "ERROR: SELECT FOR UPDATE/SHARE cannot be > applied to the nullable side of an outer join". > So I decide to use SELECT FOR UPDATE OF
Thanks
От:
Kaloyan Iliev <news1@faith.digsys.bg>
Дата:
Thanks a lot!
It works!
Regards,
Kaloyan Iliev
Tom Lane wrote:Kaloyan Iliev <news1@faith.digsys.bg> writes:rsr=# SELECT ... rsr-# FROM debts_desc DD LEFT JOIN config C ON (DD.conf_id = C.id), ... rsr-# FOR UPDATE OF debts_desc; ERROR: relation "debts_desc" in FOR UPDATE/SHARE clause not found in FROM clauseUse the alias, ie, DD. Remember that an alias hides the real name of that table for all purposes in the current query. regards, tom lane ---------------------------(end of broadcast)--------------------------- TIP 4: Have you searched our list archives? http://archives.postgresql.org