Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TLyjY-0000ui-73 for pgsql-bugs@postgresql.org; Wed, 10 Oct 2012 16:02:08 +0000 Received: from mahout.postgresql.org ([98.129.198.123]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TLyjW-0008LI-W7 for pgsql-bugs@postgresql.org; Wed, 10 Oct 2012 16:02:07 +0000 Received: from [204.145.124.246] (helo=wrigleys.postgresql.org) by mahout.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TLyjW-0000lG-8N for pgsql-bugs@postgresql.org; Wed, 10 Oct 2012 16:02:06 +0000 Received: from www-data by wrigleys.postgresql.org with local (Exim 4.72) (envelope-from ) id 1TLyjV-0008JC-OV for pgsql-bugs@postgresql.org; Wed, 10 Oct 2012 16:02:05 +0000 Date: Wed, 10 Oct 2012 16:02:05 +0000 Message-Id: Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: BUG #7594: "tuple concurrently updated" error on concurrent GRANT ON DATABASE statements To: pgsql-bugs@postgresql.org From: max@suse.de X-Pg-Spam-Score: -4.0 (----) X-Archive-Number: 201210/77 X-Sequence-Number: 34377 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.