Re: pg primary key bug?

From: pginfo <pginfo(at)t1(dot)unisoftbg(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Richard_D_Levine(at)raytheon(dot)com, Michael Glaesemann <grzm(at)myrealbox(dot)com>, pgsql-sql(at)postgresql(dot)org
Subject: Re: pg primary key bug?
Date: 2005-02-22 05:25:37
Message-ID: 421AC251.7060806@t1.unisoftbg.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi Tom,

Tom Lane wrote:

>pginfo <pginfo(at)t1(dot)unisoftbg(dot)com> writes:
>
>
>>sorry, but we have the case number 3 in with the same problem.
>>Also this time we do not find any linux box crash nor pg stop or restart.
>>
>>
>
>Hmm, well there's *something* mighty curious about the history of this
>table. The xmin values span a range of almost 400,000 transactions and
>yet the oids are twenty-three consecutive values. Is this the only
>table you've inserted into during the last 400K transactions?
>
>
No.

>It's also odd that there's so much empty space (only 37 rows in 60
>pages). It's hard to see how that could be unless there were many
>updates on the table, but judging from the name and contents of the
>table I can hardly see a reason for lots of updates. How is this table
>used exactly?
>
In this table we store the last value for the ID of part from other tables.
For each table we have one constant in this table. We are using the
table as sequence.
For Example if we nee to insert the next record in some table we make:
select constvalue from a_constants_str where constname ='...' for update;
increase the value and make
update a_constants_str set constvalue= (new value) where...

It is not so easy as I described, but in general this is the case.
Al this is connected with replications and data syncronisation and so on.

> Do you do UPDATEs on it?
>
Yes, see the description.

> DELETEs?
>
No, never.

> SELECT FOR UPDATE?
>
Yes.

>Do you do VACUUM, or VACUUM FULL, or both?
>
Only vacuum full analyze once per day.
Also once per 4h pg_dump (for pg 7.x we do not have any chance to
restore data without full dump. With 8.0 we will test the ne solution
and stop to make pg_dump.

We have > 200 relative big installs for this ERP and all are using pg.
For the last 3 y. we have one time data corruption and in this 3 cases
problem with pkey's.
All the time pg is working relative well .

regards,
ivan.

>
> regards, tom lane
>
>
>
>

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Bruno Wolff III 2005-02-22 06:59:46 Re: Timestamp with timezone question.
Previous Message Tom Lane 2005-02-21 22:51:34 Re: pg primary key bug?