Re: Transaction size - Mailing list pgsql-general

From Tom Lane
Subject Re: Transaction size
Date
Msg-id 11099.1105363826@sss.pgh.pa.us
Whole thread Raw
In response to Re: Transaction size  (Alban Hertroys <alban@magproductions.nl>)
Responses Re: Transaction size
List pgsql-general
Alban Hertroys <alban@magproductions.nl> writes:
> Tom Lane wrote:
>> Alban Hertroys <alban@magproductions.nl> writes:
>>> As they're inserts, and therefore not even touching the same data, I'm
>>> quite certain it's not some kind of row locking issue (does that even
>>> happen at all with MVCC?).
>>
>> I'm not.  In particular this could be a foreign key locking issue ---
>> does the target table have foreign keys, and if so could inserts from
>> different transactions be referencing the same master row?

> It does have a reference to a table with statusses, but those are rather
> static. I suppose an integrity check is comparable to doing a select
> with respect to locking strategies? (Meaning that it wouldn't be the
> cause of my problem).

No, unfortunately it's more like a SELECT FOR UPDATE and it does take a
lock on the referenced row (with an eye to ensuring that the referenced
row can't go away before the new referencing row is committed).
I suspect this is indeed the cause of your problem.

            regards, tom lane

pgsql-general by date:

Previous
From: John Sidney-Woollett
Date:
Subject: Re: ORDER BY in UNION query
Next
From: Tom Lane
Date:
Subject: Re: ORDER BY in UNION query