Re: [HACKERS] Re: [SQL] inserts/updates problem understressing ! - Mailing list pgsql-hackers

From Vadim Mikheev
Subject Re: [HACKERS] Re: [SQL] inserts/updates problem understressing !
Date
Msg-id 379BCCF4.B95C7092@krs.ru
Whole thread Raw
In response to Re: [HACKERS] Re: [SQL] inserts/updates problem under stressing !  (Philip Warner <pjw@rhyme.com.au>)
Responses Re: [HACKERS] Re: [SQL] inserts/updates problem understressing !
List pgsql-hackers
Philip Warner wrote:
> 
> The usual way around this sort of problem is to update the counter as the
> first thing you do in any transaction. This locks the row and prevents any
> possible deadlock:

But if there was no record then nothing will be locked...
Without ability to read dirty data LOCK is the only way.

...

> diagnostics' is not yet applied (I may not have mailed it yet...), and I am
> not sure if plpgsql starts a new TX for each statment - if so, you need to
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
It doesn't.

> start a TX in the procedure, or prior to valling it.

Vadim


pgsql-hackers by date:

Previous
From: "D'Arcy" "J.M." Cain
Date:
Subject: Re: [HACKERS] Problem with dlopen and PostgreSQL - load of file failed
Next
From: Michael Robinson
Date:
Subject: Re: [HACKERS] A multi-lang patch for psql 6.5.1