Concurrency problem

From: Dag Gullberg <dag(dot)gullberg(at)telia(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Concurrency problem
Date: 2004-10-03 10:58:52
Message-ID: 1096801131.5238.32.camel@hemma
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi,

I have a problem with concurrency,
where ordinary selects render me

Warning: pg_query(): Query failed: ERROR: tuple concurrently updated
CONTEXT: PL/pgSQL function "get_rights" line 5 at SQL statement in
/home/site/PHP/db_func.php on line 301

Code of get_rights:
GRANT SELECT ON c.users TO
adm,w3;
SELECT rights INTO result
FROM c.users
WHERE usr_id=uid;

REVOKE ALL ON c.users FROM w3,adm;
RETURN result;

What function is in error at a specific point in time appears to
be random. There are no "update" SQL commands issued between two loads
(actually two meny selections in sequence, the first not being served
completely). Still the db complain about "updates". I use triggers only
at "create" and in some instances "update", not when doing "select".
Tables are interconnected by foreign keys, sometimes mutliple.

Is there anybody out there with similar experiences?
Someone who might point in some directions in terms of
documentation of *how* to design and use a database to
avoid concurrency problems?

Any thoughts on this are greatly appreciated.

/Dag

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Gaetano Mendola 2004-10-03 11:18:27 Re: Mislabeled timestamp functions (was Re: [SQL] [NOVICE] date_trunc'd
Previous Message Bosko Vukov 2004-10-03 07:36:09