Re: BUG #15631: Generated as identity field in a temporary table withon commit drop corrupts system catalogs - Mailing list pgsql-bugs

From Peter Eisentraut
Subject Re: BUG #15631: Generated as identity field in a temporary table withon commit drop corrupts system catalogs
Date
Msg-id 043b0c10-5a27-b9ff-7451-b8a2ca9327b1@2ndquadrant.com
Whole thread Raw
In response to Re: BUG #15631: Generated as identity field in a temporary table with on commit drop corrupts system catalogs  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: BUG #15631: Generated as identity field in a temporary table with on commit drop corrupts system catalogs  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
On 11/02/2019 21:33, Tom Lane wrote:
> I don't have time to probe further right now, but I believe what is
> wrong is that we're missing a CommandCounterIncrement call after the
> sequence is created, or at least after its internal dependency on the
> table column is created.  When the transaction commits immediately,
> dependency.c fails to see the internal dependency entry and so it
> doesn't remove the sequence.  Wrapped in a transaction, there's a
> CCI somewhere and all is well.

Right.  I think it would be good to put a CommandCounterIncrement() at
the top of PreCommit_on_commit_actions().  That ensures that the
dependency code always see the latest state.

> That bollixes later attempts to clean out the temp
> namespace, since deletion tries to recurse to the missing table.

Should there be some warnings when this happens?

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


pgsql-bugs by date:

Previous
From: Dean Rasheed
Date:
Subject: Re: BUG #15623: Inconsistent use of default for updatable view
Next
From: Tom Lane
Date:
Subject: Re: BUG #15631: Generated as identity field in a temporary table with on commit drop corrupts system catalogs