Re: Table locks

Поиск
Список
Период
Сортировка
От Andreas Seltenreich
Тема Re: Table locks
Дата
Msg-id 877jr377m4.fsf@gate450.dyndns.org
обсуждение исходный текст
Ответ на Table locks  (Jake Stride <nsuk@users.sourceforge.net>)
Ответы Re: Table locks  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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

В списке pgsql-novice по дате отправления:

Предыдущее
От: Jake Stride
Дата:
Сообщение: Re: Table locks
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Table locks