Re: [HACKERS] select order by for update

From: Vadim Mikheev <vadim(at)krs(dot)ru>
To: PostgreSQL Developers List <hackers(at)postgreSQL(dot)org>, Mark Wright <mwright(at)pro-ns(dot)net>
Subject: Re: [HACKERS] select order by for update
Date: 1999-06-10 03:33:32
Message-ID: 375F320C.B0AE576A@krs.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Chris Bitmead 1999-06-10 03:48:01 BUG in 6.5 - GROUP BY inheritance
Previous Message Vadim Mikheev 1999-06-10 03:14:33 select order by for update