Re: Corrupted sequences

From: "scott(dot)marlowe" <scott(dot)marlowe(at)ihs(dot)com>
To: Francisco Reyes <lists(at)natserv(dot)com>
Cc: pgsql General List <pgsql-general(at)postgresql(dot)org>
Subject: Re: Corrupted sequences
Date: 2003-03-14 20:44:09
Message-ID: Pine.LNX.4.33.0303141341420.24048-100000@css120.ihs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, 14 Mar 2003, scott.marlowe wrote:

> On Fri, 14 Mar 2003, Francisco Reyes wrote:
>
> > Got 2 corrupted sequences, that I have discovered so far, and fixed them
> > with 'setval'. Is there a way to check all sequences in a database?
> > Something simmilar to reindex but for sequences?
> >
> >
> > Running 7.2.4 (at my ISP so don't have a choice there..)
>
> You need to demand that your service providers test their hardware. When
> things randomly get corrupted in Postgresql it is about 95% of the time or
> more that you have either a bad disk or bad memory. Postgresql is good,
> but it can't overcome broken hardware.

The first could be a problem. Are you sure the sequence was being used to
update the table you were inserting it into? I.e. was the table loaded by
bulk load, so the sequence was set right? or has it been updated properly
by "insert into table (field1,field2,id) values ('a','b',DEFAULT)"

The second is normal. currval has no value within a tranaction until
after setval or nextval.

In those cases, your sequences aren't corrupted, they're just incorrect
because they weren't accessed the right way to stay in sync with the
table.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2003-03-14 20:46:06 Re: The folding of unquoted names to lower case in PostgreSQL
Previous Message Bruce Momjian 2003-03-14 20:41:50 Re: A question ....