Re: Corrupted sequences - Mailing list pgsql-general

From scott.marlowe
Subject Re: Corrupted sequences
Date
Msg-id Pine.LNX.4.33.0303141341420.24048-100000@css120.ihs.com
Whole thread Raw
In response to Re: Corrupted sequences  ("scott.marlowe" <scott.marlowe@ihs.com>)
Responses Re: Corrupted sequences  (Francisco Reyes <lists@natserv.com>)
List 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.


pgsql-general by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: The folding of unquoted names to lower case in PostgreSQL
Next
From: Tom Lane
Date:
Subject: Re: The folding of unquoted names to lower case in PostgreSQL