Re: create temp table ... inherits - Mailing list pgsql-bugs

From Tom Lane
Subject Re: create temp table ... inherits
Date
Msg-id 3768.1065978385@sss.pgh.pa.us
Whole thread Raw
In response to create temp table ... inherits  (Robert Creager <Robert_Creager@LogicalChaos.org>)
Responses Re: create temp table ... inherits
Re: create temp table ... inherits
List pgsql-bugs
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

pgsql-bugs by date:

Previous
From: Robert Creager
Date:
Subject: create temp table ... inherits
Next
From: Robert Creager
Date:
Subject: Re: create temp table ... inherits