Re: Table locks

From: Andreas Seltenreich <seltenreich(at)gmx(dot)de>
To: nsuk(at)users(dot)sourceforge(dot)net (Jake Stride)
Cc: <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Table locks
Date: 2004-09-09 16:02:59
Message-ID: 877jr377m4.fsf@gate450.dyndns.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Jake Stride writes:

> I thought of doing:
>
> SELECT max(jobno) from jobs where companyid=1;
>
> Then use the result as the job number, is there a way I can lock the table
> to do this or a better way of achieving the required result.

I think SELECT FOR UPDATE should work fine here.

See: http://www.postgresql.org/docs/7.4/static/mvcc.html

HTH
Andreas

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2004-09-09 16:52:26 Re: Table locks
Previous Message Jake Stride 2004-09-09 15:55:18 Re: Table locks