Re: Help on Procedure running external function

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Zac <zaccheob(at)inwind(dot)it>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Help on Procedure running external function
Date: 2005-07-05 12:39:48
Message-ID: 20050705123948.GB11379@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Tue, Jul 05, 2005 at 13:47:24 +0200,
Zac <zaccheob(at)inwind(dot)it> wrote:
> I think you should use 'FOR UPDATE' clause in your first "select":
>
> select into vnrBon maxnrbon+1 from MagMaxNrBon where magazie =
> dsgroup.magazie_implicita_lansare FOR UPDATE;
>
> In this way you lock the rows eventually returned and no one can update
> them (or select them "for update") until your transaction finished.

That doesn't work because you don't lock rows which aren't in the table
yet. You need to use a lock table instead.

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Bricklen Anderson 2005-07-05 14:26:15 Re: Create connection with Oracle database from Postgres plpgsql
Previous Message Zac 2005-07-05 11:47:24 Re: Help on Procedure running external function