Re: AW: [HACKERS] inserts/updates problem under stressing !

Поиск
Список
Период
Сортировка
От Philip Warner
Тема Re: AW: [HACKERS] inserts/updates problem under stressing !
Дата
Msg-id 3.0.5.32.19990726191402.00a7e100@mail.rhyme.com.au
обсуждение исходный текст
Ответ на Re: AW: [HACKERS] inserts/updates problem under stressing !  (Oleg Bartunov <oleg@sai.msu.su>)
Ответы Re: AW: [HACKERS] inserts/updates problem under stressing !  (Oleg Bartunov <oleg@sai.msu.su>)
Список pgsql-hackers
At 12:54 26/07/99 +0400, Oleg Bartunov wrote:
>Andreas,
>
>I rewrote my function but got a problem how to know if update fails:
>
>CREATE FUNCTION "acc_hits" (int4) RETURNS datetime AS ' 
>Declare
>    keyval      Alias For $1;
>    cnt         int4;
>    curtime     datetime;
>Begin
>    curtime := ''now'';
>    Update hits set count = count + 1,last_access = curtime where msg_id =
keyval;
>    if Not Found then
>      ??????????

You need a patch to plpgsql with adds:
       GET DIAGNOSTICS SELECT PROCESSED INTO num_of_rows_affected;

where num_of_rows_affected is a local variable.

The patch is currently with Jan, who is quite busy.


>        -- first_access inserted on default, last_access is NULL
>        Insert Into hits (msg_id,count) values (keyval, 1);     
>    End If;
>    return curtime;   
>End;
>' LANGUAGE 'plpgsql';
>
>
>
>    regards,
>    
>        Oleg
>
>
>
>
>
>
>On Mon, 26 Jul 1999, Zeugswetter Andreas IZ5 wrote:
>

----------------------------------------------------------------
Philip Warner                    |     __---_____
Albatross Consulting Pty. Ltd.   |----/       -  \
(A.C.N. 008 659 498)             |          /(@)   ______---_
Tel: +61-03-5367 7422            |                 _________  \
Fax: +61-03-5367 7430            |                 ___________ |
Http://www.rhyme.com.au          |                /           \|                                |    --________--
PGP key available upon request,  |  /
and from pgp5.ai.mit.edu:11371   |/


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

Предыдущее
От: wieck@debis.com (Jan Wieck)
Дата:
Сообщение: Re: [HACKERS] plperl intial pass
Следующее
От: wieck@debis.com (Jan Wieck)
Дата:
Сообщение: Re: [HACKERS] plperl intial pass