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