Re: Error: heap_mark4update: (am)invalid tid - Mailing list pgsql-general

From Steve Wolfe
Subject Re: Error: heap_mark4update: (am)invalid tid
Date
Msg-id 002601c2cbd3$883afb60$88693fd1@WEASEL
Whole thread Raw
In response to Error: heap_mark4update: (am)invalid tid  ("Steve Wolfe" <nw@codon.com>)
Responses Re: Error: heap_mark4update: (am)invalid tid
List pgsql-general
> >   I'm receiving an error message that I'm not sure how to resolve:
> > heap_mark4update: (am)invalid tid .  The offending query is:
>
> > "update a set active = 'f' where a.expires < 'now' and a.active = 't'
and
> > a.cart_id = b.cart_id"
>
> Hmm ... a plain UPDATE doesn't invoke heap_mark4update.  Do you have any
> foreign keys involved here?

   Yes, a.cart_id is a primary key, and b.cart_id references a.cart_id.

> >   The error is a bit inconsistent.  Doing a select with the saem
criteria
> > will work fine - but the select gives a few more rows in the result
than
> > the update will when it works.  Often (but not always), vacuuming both
> > tables a and b will get the update to work - but again, not always.
>
> So once the error happens, it's persistent?  That's pretty interesting.
> I'd have expected it to depend on concurrent activity ...

   Once it's failed, it will kep failing until the vacuuming.  Once, the
vacuum didn't fix the problem.  On that occasion, doing the select (with
the same criteria) first, then the update *did* fix the problem.  The
database is fully vacuumed nightly.  It's only after rows have been
added.modified in a for a while that the problem crops up.

  Again, if there's any more information I can offer, let me know.

steve


pgsql-general by date:

Previous
From: Justin Clift
Date:
Subject: Re: Printer setup
Next
From: Jan Wieck
Date:
Subject: Re: 335 times faster (!)