pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: max@suse.de
To: pgsql-bugs@postgresql.org
Subject: BUG #7594: "tuple concurrently updated" error on concurrent GRANT ON DATABASE statements
Date: Wed, 10 Oct 2012 16:02:05 +0000
Message-ID: <E1TLyjV-0008JC-OV@wrigleys.postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      7594
Logged by:          Reinhard Max
Email address:      max@suse.de
PostgreSQL version: 9.1.6
Operating system:   openSUSE
Description:        

Is it intentional, that concurrent GRANT statements for the same database
may result in a "tuple concurrently updated" error?

It can be reproduced by running the following loop from two shells at the
same time:

while true; do psql -c "GRANT ALL ON DATABASE foo TO foo" ; done

I found that wrapping the GRANT statement in a transaction and explicitly
locking pg_table in SHARE UPDATE EXCLUSIVE mode makes the error disappear.
According to the documentation of the lock modes, statements like VACUUM
acquire this lock by itself, so I wonder if GRANT ON DATABASE should do the
same.





Message-ID: <E1TLyjV-0008JC-OV@wrigleys.postgresql.org>
Permalink:  ../E1TLyjV-0008JC-OV@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/E1TLyjV-0008JC-OV@wrigleys.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: max@suse.de
  Subject: Re: BUG #7594: "tuple concurrently updated" error on concurrent GRANT ON DATABASE statements
  In-Reply-To: <E1TLyjV-0008JC-OV@wrigleys.postgresql.org>
  References: <E1TLyjV-0008JC-OV@wrigleys.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox