Re: [HACKERS] TRUNCATE TABLE with IDENTITY

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: [HACKERS] TRUNCATE TABLE with IDENTITY
Дата
Msg-id 200807011809.m61I9SR02927@momjian.us
обсуждение исходный текст
Ответ на Re: [HACKERS] TRUNCATE TABLE with IDENTITY  (Alvaro Herrera <alvherre@commandprompt.com>)
Список pgsql-patches
Alvaro Herrera wrote:
> Tom Lane wrote:
>
> > 2. I had first dismissed Neil's idea of transactional sequence updates
> > as impossible, but on second look it could be done.  Suppose RESTART
> > IDENTITY does this for each sequence;
> >
> >     * obtain AccessExclusiveLock;
> >     * assign a new relfilenode;
> >     * insert a sequence row with all parameters copied except
> >       last_value copies start_value;
> >     * hold AccessExclusiveLock till commit.
>
> Hmm, this kills the idea of moving sequence data to a single
> non-transactional catalog :-(
>
> > So what I think we should do is leave the patch there, revise the
> > warning per Neil's complaint, and add a TODO item to reimplement RESTART
> > IDENTITY transactionally.
>
> I think the TODO item did not make it, but the docs do seem updated.

Done:

* Fix TRUNCATE ... RESTART IDENTITY so its affect on sequences is rolled
  back on transaction abort

--
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: [HACKERS] odd output in restore mode
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: LOCK_DEBUG documentation