Re: [HACKERS] select order by for update - Mailing list pgsql-hackers

From Vadim Mikheev
Subject Re: [HACKERS] select order by for update
Date
Msg-id 375F320C.B0AE576A@krs.ru
Whole thread Raw
In response to select order by for update  (Vadim Mikheev <vadim@krs.ru>)
List pgsql-hackers
> There is another problem in subj - sometimes application gets
> ERROR: EvalPlanQual: t_xmin is uncommitted ?!
> I'll try to find why. Mark (Wright), could you avoid
> order by in PL function? If you really need in ordered
> updates then try to create index on id_number and add
> id_number >= 0 to WHERE in select for update.

Ops, this will not work in all cases. Try to rewrite select:

SELECT * FROM test_attendees
WHERE print_status = 'R'
AND id_number = (select min(id_number) from test_attendees)
FOR UPDATE OF test_attendees

and run it in loop.

Vadim


pgsql-hackers by date:

Previous
From: Vadim Mikheev
Date:
Subject: select order by for update
Next
From: Chris Bitmead
Date:
Subject: BUG in 6.5 - GROUP BY inheritance