Re: BUG #15631: Generated as identity field in a temporary table with on commit drop corrupts system catalogs

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #15631: Generated as identity field in a temporary table with on commit drop corrupts system catalogs
Дата
Msg-id 32505.1550241839@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: BUG #15631: Generated as identity field in a temporary table withon commit drop corrupts system catalogs  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Ответы Re: BUG #15631: Generated as identity field in a temporary table withon commit drop corrupts system catalogs  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Список pgsql-bugs
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


В списке pgsql-bugs по дате отправления:

Предыдущее
От: Francisco Olarte
Дата:
Сообщение: Re: BUG #15637: Problem insert data 【Japanese】
Следующее
От: John Klann
Дата:
Сообщение: Re: BUG #15636: PostgreSQL 11.1 pg_basebackup backup to a CIFSdestination throws fsync error at end of backup