Re: AW: [HACKERS] inserts/updates problem under stressing ! - Mailing list pgsql-hackers

From Oleg Bartunov
Subject Re: AW: [HACKERS] inserts/updates problem under stressing !
Date
Msg-id Pine.GSO.3.96.SK.990726160517.19354A-100000@ra
Whole thread Raw
In response to Re: AW: [HACKERS] inserts/updates problem under stressing !  (Philip Warner <pjw@rhyme.com.au>)
List pgsql-hackers
On Mon, 26 Jul 1999, Philip Warner wrote:

> Date: Mon, 26 Jul 1999 19:14:02 +1000
> From: Philip Warner <pjw@rhyme.com.au>
> To: Oleg Bartunov <oleg@sai.msu.su>,
>     Zeugswetter Andreas IZ5 <Andreas.Zeugswetter@telecom.at>
> Cc: pgsql-hackers@postgreSQL.org
> Subject: Re: AW: [HACKERS] inserts/updates problem under stressing !
> 
> 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.
> 

Jan, did you approve the patch. Is it usable with 6.5.1 ?
Oleg

> 
> >        -- 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   |/
> 

_____________________________________________________________
Oleg Bartunov, sci.researcher, hostmaster of AstroNet,
Sternberg Astronomical Institute, Moscow University (Russia)
Internet: oleg@sai.msu.su, http://www.sai.msu.su/~megera/
phone: +007(095)939-16-83, +007(095)939-23-83



pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] Arbitrary tuple size
Next
From: Oleg Bartunov
Date:
Subject: postgres Web problem