pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
To: Michael Paquier <michael@paquier.xyz>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: 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: Fri, 15 Feb 2019 14:02:58 +0100
Message-ID: <0bc96c3e-8a3f-414f-8ba7-f7f95a787d48@2ndquadrant.com> (raw)
In-Reply-To: <20190213044104.GE5746@paquier.xyz>
References: <15631-188663b383e1e697@postgresql.org>
	<24188.1549917188@sss.pgh.pa.us>
	<043b0c10-5a27-b9ff-7451-b8a2ca9327b1@2ndquadrant.com>
	<31358.1549981670@sss.pgh.pa.us>
	<20190213023817.GD5746@paquier.xyz>
	<20190213044104.GE5746@paquier.xyz>

On 2019-02-13 05:41, Michael Paquier wrote:
> On Wed, Feb 13, 2019 at 11:38:17AM +0900, Michael Paquier wrote:
>> Agreed.  I don't think that it is the correct logic to put an
>> after-the-fact CCI just before executing any drop or truncate actions.
>> It should happen after the creation of the new object so as it becomes
>> correctly visible within the transaction.
> 
> The problem comes from process_owned_by() in sequence.c which has
> added in v10 some handling for internal dependencies in the case of an
> identity sequence, and the dependency link between the sequence and
> its relation is added there.
> 
> Another thing I was wondering is if we should add the CCI directly to
> recordMultipleDependencies() for internal dependencies, still it seems
> to me that it would be an overkill as some dependency registrers may
> do the CCI by themselves after adding the pg_depend link and doing
> some other operations, so I discarded the idea.
> 
> The patch attached solves the problem, for consistency I would suggest
> doing the CCI even for auto dependencies.

What is the general coding principle here?  "You need an CCI $WHEN"?

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




view thread (23+ messages)  latest in thread

Message-ID: <0bc96c3e-8a3f-414f-8ba7-f7f95a787d48@2ndquadrant.com>
Permalink:  ../0bc96c3e-8a3f-414f-8ba7-f7f95a787d48@2ndquadrant.com/
Also on:    postgresql.org/message-id/0bc96c3e-8a3f-414f-8ba7-f7f95a787d48@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, michael@paquier.xyz, 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: <0bc96c3e-8a3f-414f-8ba7-f7f95a787d48@2ndquadrant.com>
  References: <15631-188663b383e1e697@postgresql.org> <24188.1549917188@sss.pgh.pa.us> <043b0c10-5a27-b9ff-7451-b8a2ca9327b1@2ndquadrant.com> <31358.1549981670@sss.pgh.pa.us> <20190213023817.GD5746@paquier.xyz> <20190213044104.GE5746@paquier.xyz> <0bc96c3e-8a3f-414f-8ba7-f7f95a787d48@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