On 1 August 2013 01:53, Noah Misch <noah@leadboat.com> wrote:
> A remediation strategy that seemed attractive when I last contemplated this
> problem is to repoint rd_att immediately but arrange to free the obsolete
> TupleDesc in AtEOXact_RelationCache().
I agree that the best way to resolve this is to retain a copy of the
TupleDesc, so that copied pointers to it remain valid.
EOXact is actually longer than strictly necessary in some cases, but
trying to work out a more minimal approach seems hard and possibly
inefficient.
Comments in relcache.c indicate that the Relation swapping concept
might be replaced by refcounting approach. I can't see how that
differs from your suggested route.
Which means I can't see any other way of doing this other than the way
you suggest. Will implement.
-- Simon Riggs http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training & Services