Re: Help on Procedure running external function

Поиск
Список
Период
Сортировка
От Din Adrian
Тема Re: Help on Procedure running external function
Дата
Msg-id opstgptjdbawcxfg@adi
обсуждение исходный текст
Ответ на Re: Help on Procedure running external function  (Bruno Wolff III <bruno@wolff.to>)
Список pgsql-sql
I am sorry but:
the table is TEMPORARY ... I don't need to do any lock on it ....
(eventualy I should do a lock on the table where I want to insert the  
documents - the MagMaxNrBon is only a temp table used for storing the max  
document nr for each user's setings in this transaction - I did that temp  
table instead of running always the return_next_number function (the  
problem I postit first) - I run once the function for every user's  
settings - get the max doc free number, store in the temp table, do the  
insert in onother table and next time I get this number and raise by 1  
instead of running again the get_next_number function (because as I said  
-  it give the same max number (the insert into table is not 'visible') ))

...
as I said it's 'solved' ...

thank you,
Adrian Din


On Tue, 5 Jul 2005 07:39:48 -0500, Bruno Wolff III <bruno@wolff.to> wrote:

> On Tue, Jul 05, 2005 at 13:47:24 +0200,
>   Zac <zaccheob@inwind.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.
>
> ---------------------------(end of broadcast)---------------------------
> TIP 7: don't forget to increase your free space map settings
>



-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/



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

Предыдущее
От: Bruno Wolff III
Дата:
Сообщение: Re: Help on Procedure running external function
Следующее
От: Bricklen Anderson
Дата:
Сообщение: Re: Create connection with Oracle database from Postgres plpgsql