Query Fails with "ERROR: tuple concurrently updated"
search cancel

Query Fails with "ERROR: tuple concurrently updated"

book

Article ID: 295311

calendar_today

Updated On:

Products

VMware Tanzu Greenplum

Issue/Introduction

Symptoms:

Running any query that updates the catalog ( say "grant" for example ) gives the following error:

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

 

Environment


Cause

As indicated by the error message, when you ran the query someone 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

 

Resolution

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