Re: Bug #807: Sequence currupted on recovery after kill -9

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Robert Hentosh <hentosh(at)io(dot)com>
Cc: mthomp(at)tierfleet(dot)com, pgsql-bugs(at)postgresql(dot)org
Subject: Re: Bug #807: Sequence currupted on recovery after kill -9
Date: 2002-10-29 18:54:22
Message-ID: 200210291854.g9TIsMZ14339@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Robert Hentosh wrote:
> On Tue, 29 Oct 2002 pgsql-bugs(at)postgresql(dot)org wrote:
>
> > Matt Thompson (mthomp(at)tierfleet(dot)com) reports a bug with a severity of 2
> > The lower the number the more severe it is.
> >
> > Short Description
> > Sequence currupted on recovery after kill -9
> >
> > Long Description
> > If you create a file with an implied sequence and do a couple of inserts, then do a kill -9, when you start up again, the sequence will have a corrupted next_value field. In the example, the value of last_value is 4 before the kill -9 and 34 when it comes back up.
> >
>
>
> The purpose of a sequence is not to insure that the numbers are
> consecutive, only to insure that they are unique. If you have failed
> inserts, you will see holes also.
>
> I don't know off the top of my head how to do consecutive numbers. Maybe
> only with a table lock.

Right. Sequences aren't consecutive anyway because an ABORT will not
reuse the sequence value. There is an FAQ on that.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Vitaliy Fuks 2002-10-29 19:13:15 Re: Bug #805: pg_dump examines all tables even with -t "table_name" speficied
Previous Message Tom Lane 2002-10-29 17:49:34 Re: Bug #807: Sequence currupted on recovery after kill -9