Re: 'tuple concurrently updated' error for alter role ... set - Mailing list pgsql-hackers

From Tom Lane
Subject Re: 'tuple concurrently updated' error for alter role ... set
Date
Msg-id 11572.1305239328@sss.pgh.pa.us
Whole thread Raw
In response to 'tuple concurrently updated' error for alter role ... set  (Alexey Klyukin <alexk@commandprompt.com>)
Responses Re: 'tuple concurrently updated' error for alter role ... set  (Robert Haas <robertmhaas@gmail.com>)
Re: 'tuple concurrently updated' error for alter role ... set  (Alexey Klyukin <alexk@commandprompt.com>)
List pgsql-hackers
Alexey Klyukin <alexk@commandprompt.com> writes:
> After digging in the code I've found that a RowExclusiveLock is acquired on a pg_db_role_setting table in
AlterSetting().While the name of the locks suggests that it should conflict with itself, it doesn't. After I've
replacedthe lock in question with ShareUpdateExclusiveLock, the problem disappeared. Attached is the simple patch with
thesechanges.
 

We're not likely to do that, first because it's randomly different from
the handling of every other system catalog update, and second because it
would serialize all updates on this catalog, and probably create
deadlock cases that don't exist now.  (BTW, as the patch is given I'd
expect it to still fail, though perhaps with lower probability than
before.  For this to actually stop all such cases, you'd have to hold
the lock till commit, which greatly increases the risks of deadlock.)

I see no particular reason why conflicting updates like those *shouldn't*
be expected to fail occasionally.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Unfriendly handling of pg_hba SSL options with SSL off
Next
From: "David E. Wheeler"
Date:
Subject: Re: Contrib Versions