Robert Creager <Robert_Creager@LogicalChaos.org> writes:
> CREATE TEMP TABLE is being executed in two processes (same Perl/DBI script). It occurs when the scripts are executed
atthe same time. One of the processes dies with the following:
> Oct 12 09:39:45 thunder postgres[31398]: [2-1] ERROR: tuple concurrently updated
> Oct 12 09:39:45 thunder postgres[31398]: [2-2] STATEMENT: CREATE TEMP TABLE temp_obs_v() INHERITS( obs_root ) ON
COMMITDELETE ROWS
The two temp tables share a common parent?
My guess is that it's failing because setRelhassubclassInRelation just
does an unconditional simple_heap_update even when it doesn't need to.
We could fix that fairly easily, which would greatly reduce the odds
of the problem although not prevent it completely. (I think complete
prevention would require locking the parent table, which cure seems
worse than the disease.)
Can you get a backtrace from the errfinish call to confirm this theory?
regards, tom lane