> 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