Re: UPDATE/DELETE XXX WHERE CURRENT OF cursor_name

Поиск
Список
Период
Сортировка
От Florian G. Pflug
Тема Re: UPDATE/DELETE XXX WHERE CURRENT OF cursor_name
Дата
Msg-id 44C4E352.6090704@phlo.org
обсуждение исходный текст
Ответ на Re: UPDATE/DELETE XXX WHERE CURRENT OF cursor_name  (Gavin Sherry <swm@linuxworld.com.au>)
Ответы Re: UPDATE/DELETE XXX WHERE CURRENT OF cursor_name  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: UPDATE/DELETE XXX WHERE CURRENT OF cursor_name  (Alvaro Herrera <alvherre@commandprompt.com>)
Список pgsql-hackers
Gavin Sherry wrote:
> On Mon, 24 Jul 2006, Golden Liu wrote:
> 
>> begin;
>> declare foo cursor for select * from bar for update;
>> fetch foo;
>> update bar set abc='def' where current of foo;
>> fetch foo;
>> delete from bar where current of foo;
>> commit;

> No one has stepped up to do this for 8.2 so unfortunately you will most
> likely not see this within the next year or so :-(.

Couldn't this be emulated by doing
begin;
declare foo cursor for select * from bar for update;
fetch foo into v_foo ;
update bar set abc='def' where ctid = v_foo.ctid;
fetch foo into v_foo ;
delete from bar where ctid = v_foo.ctid;
commit;

Or could a concurrent vacuum run lead to the wrong
rows being updated/deleted?

greetings, Florian Pflug


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

Предыдущее
От: "Sergey E. Koposov"
Дата:
Сообщение: Re: [PATCHES] patch implementing the multi-argument aggregates (SOC
Следующее
От: Tom Lane
Дата:
Сообщение: Better name/syntax for "online" index creation