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

From: Philip Warner <pjw(at)rhyme(dot)com(dot)au>
To: Oleg Bartunov <oleg(at)sai(dot)msu(dot)su>, Zeugswetter Andreas IZ5 <Andreas(dot)Zeugswetter(at)telecom(dot)at>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: AW: [HACKERS] inserts/updates problem under stressing !
Date: 1999-07-26 09:14:02
Message-ID: 3.0.5.32.19990726191402.00a7e100@mail.rhyme.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 |/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jan Wieck 1999-07-26 09:15:25 Re: [HACKERS] plperl intial pass
Previous Message Hannu Krosing 1999-07-26 09:04:22 Re: [HACKERS] RE: [INTERFACES] Re: SSL patch