Do I need serializable for this query? - Mailing list pgsql-general

From William Garrison
Subject Do I need serializable for this query?
Date
Msg-id 461BDB32.8040904@mobydisk.com
Whole thread Raw
Responses Re: Do I need serializable for this query?  ("Florian G. Pflug" <fgp@phlo.org>)
Re: Do I need serializable for this query?  (Jeff Davis <pgsql@j-davis.com>)
Re: Do I need serializable for this query?  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-general
I have a table that keeps running totals.  It is possible that this
would get called twice simultaneously for the same UserID.  Do I need to
put this in a serializable transaction?  Since this gets called often,
could it be a performance problem if I make it serializable?

CREATE FUNCTION UpdateTotals(IN UserID int,
                              IN AddToCount int,
                              IN AddToSize bigint)
RETURNS void AS $$
BEGIN
     UPDATE
         Totals
     SET
         TotalSize = TotalSize + $2,
         TotalCount = TotalCount + $3
     WHERE
         UserID = $1;
     END IF;
END
$$ LANGUAGE 'plpgsql' VOLATILE;

pgsql-general by date:

Previous
From: Peter Wilson
Date:
Subject: Re: programmatic way to fetch latest release for a given major.minor version
Next
From: Sean Davis
Date:
Subject: Versioning