Обсуждение: Thank you

Поиск
Список
Период
Сортировка

Thank you

От
Mateusz Mazur
Дата:
Hi.
Thanx for your help with "PSQL to Access" problem.

Mateusz Mazur
[vincent@waw.pdi.net]


select ... for update in plpgsql

От
Jie Liang
Дата:
Hi,

I have a question about 'select ... for update';
according to the docs,
clause 'for update' will lock selected rows,
I believe it should be put into a
begin;
select ... for update;
update ...;
end;
block.

however, if I use it in a plpgsql function,
do I need another pair of begin...end?
or say begin...end in plpgsql can lock chosen rows until
updated ALL ROWS?
if not, do you have any suggestion?



Jie LIANG

St. Bernard Software

10350 Science Center Drive
Suite 100, San Diego, CA 92121
Office:(858)320-4873

jliang@ipinc.com
www.stbernard.com
www.ipinc.com



Re: select ... for update in plpgsql

От
Cedar Cox
Дата:
'select ... for update' needs to be inside a transaction.  plpgsql cannot
start or end transactions.  'begin' and 'end' are not transaction
statements.  (read the docs).

-Cedar

On Fri, 20 Apr 2001, Jie Liang wrote:

>
> Hi,
>
> I have a question about 'select ... for update';
> according to the docs,
> clause 'for update' will lock selected rows,
> I believe it should be put into a
> begin;
> select ... for update;
> update ...;
> end;
> block.
>
> however, if I use it in a plpgsql function,
> do I need another pair of begin...end?
> or say begin...end in plpgsql can lock chosen rows until
> updated ALL ROWS?
> if not, do you have any suggestion?
>
>
>
> Jie LIANG
>
> St. Bernard Software
>
> 10350 Science Center Drive
> Suite 100, San Diego, CA 92121
> Office:(858)320-4873
>
> jliang@ipinc.com
> www.stbernard.com
> www.ipinc.com
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
>