Possible causes for "tuple concurrently updated" error

Started by Jacob Scottalmost 10 years ago5 messagesgeneral
Jump to latest
#1Jacob Scott
jacob.scott@gmail.com

Hi,

I'm seeing a "tuple concurrently updated" error thrown while executing
UPDATE statements. I've attempted to diligently review previous threads on
this error (e.g.,
https://www.google.com/webhp?ie=UTF-8#q=tuple+concurrently+updated+update+site:postgresql.org)
but am confused about what classes of queries can conflict to cause this
error.

- It seems clear from previous threads that
- two concurrent ANALYZE queries on the same table can cause this
this error.
- some access control/DDL statements (e.g. GRANT) run concurrently
can cause this error.
- Can a "VACUUM ANALYZE $TABLE" (e.g., from autovacuum) concurrent with
a "UPDATE $TABLE" cause this error?
- Can two concurrent "UPDATE $TABLE" queries which touch completely
disjoint sets of rows (e.g. where clause on primary key with disjoint
filters) cause this error?

Thanks,

Jacob

#2Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Jacob Scott (#1)
Re: Possible causes for "tuple concurrently updated" error

On Wed, May 04, 2016 at 11:52:47PM -0700, Jacob Scott wrote:

Hi,

I'm seeing a "tuple concurrently updated" error thrown while executing
UPDATE statements. I've attempted to diligently review previous threads on
this error (e.g.,
https://www.google.com/webhp?ie=UTF-8#q=tuple+concurrently+updated+update+site:postgresql.org)
but am confused about what classes of queries can conflict to cause this
error.

What Postgres version are you running?

--
�lvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#3Jacob Scott
jacob.scott@gmail.com
In reply to: Alvaro Herrera (#2)
Re: Possible causes for "tuple concurrently updated" error

Arg, should have included this in my initial email :-(

9.3.11

On Thu, May 5, 2016 at 7:46 AM, Alvaro Herrera <alvherre@2ndquadrant.com>
wrote:

Show quoted text

On Wed, May 04, 2016 at 11:52:47PM -0700, Jacob Scott wrote:

Hi,

I'm seeing a "tuple concurrently updated" error thrown while executing
UPDATE statements. I've attempted to diligently review previous threads

on

this error (e.g.,

https://www.google.com/webhp?ie=UTF-8#q=tuple+concurrently+updated+update+site:postgresql.org
)

but am confused about what classes of queries can conflict to cause this
error.

What Postgres version are you running?

--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

#4Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Jacob Scott (#3)
Re: Possible causes for "tuple concurrently updated" error

Jacob Scott wrote:

Arg, should have included this in my initial email :-(

9.3.11

OK. So what are the updates doing? Are there any FKs involved?

--
�lvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#5Jacob Scott
jacob.scott@gmail.com
In reply to: Alvaro Herrera (#4)
Re: Possible causes for "tuple concurrently updated" error

Pinpoint updates of the form

UPDATE $TABLE set field1=$FOO, field2=$BAR ... WHERE pk=$ID

- All fields are specified
- Table has no foreign keys (but does have a unmber of indexes)
- executed as a prepared statement with bind params & data for multiple
rows provided

On Thu, May 5, 2016 at 8:13 AM, Alvaro Herrera <alvherre@2ndquadrant.com>
wrote:

Show quoted text

Jacob Scott wrote:

Arg, should have included this in my initial email :-(

9.3.11

OK. So what are the updates doing? Are there any FKs involved?

--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services