pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
To: dnsl48@gmail.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #15631: Generated as identity field in a temporary table with on commit drop corrupts system catalogs
Date: Tue, 12 Feb 2019 15:00:34 +0100
Message-ID: <043b0c10-5a27-b9ff-7451-b8a2ca9327b1@2ndquadrant.com> (raw)
In-Reply-To: <24188.1549917188@sss.pgh.pa.us>
References: <15631-188663b383e1e697@postgresql.org>
	<24188.1549917188@sss.pgh.pa.us>

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




view thread (23+ messages)  latest in thread

Message-ID: <043b0c10-5a27-b9ff-7451-b8a2ca9327b1@2ndquadrant.com>
Permalink:  ../043b0c10-5a27-b9ff-7451-b8a2ca9327b1@2ndquadrant.com/
Also on:    postgresql.org/message-id/043b0c10-5a27-b9ff-7451-b8a2ca9327b1@2ndquadrant.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: peter.eisentraut@2ndquadrant.com, tgl@sss.pgh.pa.us, dnsl48@gmail.com
  Subject: Re: BUG #15631: Generated as identity field in a temporary table with on commit drop corrupts system catalogs
  In-Reply-To: <043b0c10-5a27-b9ff-7451-b8a2ca9327b1@2ndquadrant.com>
  References: <15631-188663b383e1e697@postgresql.org> <24188.1549917188@sss.pgh.pa.us> <043b0c10-5a27-b9ff-7451-b8a2ca9327b1@2ndquadrant.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox