From: Tom Lane <tgl@sss.pgh.pa.us>
To: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Cc: Michael Paquier <michael@paquier.xyz>
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 09:43:59 -0500
Message-ID: <32505.1550241839@sss.pgh.pa.us> (raw)
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>
Peter Eisentraut <peter.eisentraut@2ndquadrant.com> writes:
> What is the general coding principle here? "You need an CCI $WHEN"?
The general principle is "there should be a CCI after each independent
set of data/catalog changes". You don't typically need CCI between
the primitive actions of a single DDL statement like CREATE SEQUENCE,
because you know that those actions are independent and don't look at
each others' output. But you need one at the end, in case whatever
happens next should be able to see the results of the statement.
In another universe the rule might have been "CCI before each independent
set of actions", rather than after. But we haven't done it that way.
Mixing those two styles as a method of fixing bugs seems like a horrid
idea: you eventually end up with fore-AND-aft CCIs everywhere, because
nobody knows what the preceding or following statements might've done.
For better or worse, the PG rule is CCI-after, and the stuff that does
DDL on identity sequences has to fall in line.
regards, tom lane
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: tgl@sss.pgh.pa.us, peter.eisentraut@2ndquadrant.com, michael@paquier.xyz, 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: <32505.1550241839@sss.pgh.pa.us>
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> <32505.1550241839@sss.pgh.pa.us>
* 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