Re: create temp table ... inherits

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Creager <Robert_Creager(at)LogicalChaos(dot)org>
Cc: PGBugs <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: create temp table ... inherits
Date: 2003-10-12 17:06:25
Message-ID: 3768.1065978385@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Robert Creager <Robert_Creager(at)LogicalChaos(dot)org> writes:
> CREATE TEMP TABLE is being executed in two processes (same Perl/DBI script). It occurs when the scripts are executed at the 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 COMMIT DELETE 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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Robert Creager 2003-10-12 17:38:31 Re: create temp table ... inherits
Previous Message Robert Creager 2003-10-12 16:08:10 create temp table ... inherits