Pivotal Knowledge Base

Follow

Query fails with "ERROR: tuple concurrently updated"

Problem

Running any query that updates the catalog ( say "grant" for example ) errors out with

ERROR:  tuple concurrently updated (heapam.c:3210)

Cause

As indicated by the error message , when you ran the query some one else was concurrently updating the same tuple , this can be easily reproduced with below steps.

  • open two terminals
  • run the below script on both of them
while true; do psql -c 'grant all on <tablename> to <rolename>'; done

Solution

  • Please try the query again after a few seconds.
  • Wait for another time when the database is free to run the query.

Comments

Powered by Zendesk