select for update problem (maybe mine)

Поиск
Список
Период
Сортировка
От Theodore Petrosky
Тема select for update problem (maybe mine)
Дата
Msg-id 20021213145245.5583.qmail@web41012.mail.yahoo.com
обсуждение исходный текст
Ответ на Re: Fix for PSQL 7.2.2 doesn't compile on OS X 10.2  (Deron Brookins <deron.brookins@verizon.net>)
Список pgsql-bugs
Is this a bug or is this how it is supposed to work?

postgresql 7.3 (release)
mac osx 10.2.2

select for update

I have two terminal sessions open with psql running
and talking to the same db.

in window 1 : begin;
in window 1 : select column1 from table where column1
= 'text' for update;

in window 2 : update table set column1  = 'text 2'
where column1 = 'text';

then nothing...(until I commit window 1 then window 2
just does the update)
.. I expected an error or warning in window 2... sorry
column/row locked for update...

how can I trap for this. If client 1 is updating,
client 2 needs to know, not just be stuck waiting.
He/She has no idea why there is a delay.

but then again, maybe I am using this wrong.

Thanks,

Ted

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: possible INSERT bug
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: postmaster segfaults when pg_hba.cof is missing