Skip site navigation (1) Skip section navigation (2)

Re: destroyed db/index (corruption) [SOLVED]

From: Michael Monnerie <michael(dot)monnerie(at)it-management(dot)at>
To: pgsql-admin(at)postgresql(dot)org
Subject: Re: destroyed db/index (corruption) [SOLVED]
Date: 2007-02-07 22:07:41
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-admin
On Dienstag, 6. Februar 2007 08:46 Achilleas Mantzios wrote:
> Thats what i mean, postmaster is alive, and accepting connections
> during the above command, so what would prevent a 2nd client (from
> your mail server setup most likely)
> from inserting a value that is later present in the dump,
> which is later attempted to be COPY'ed to the table
> and ofcource that violates the PRIMARY KEY CONSTRAINT?
> In other words, do you have full control of your DB when that
> happens? If some 2nd client, not controled by you, inserts a value
> that is later found in the dump, it is completely normal that this
> ERROR will be thrown. Have you tried, for instance, disabling all
> unwanted access to postmaster, e.g. through data/pg_hba.conf ?

After your tip, I rechecked the old logs. There, I had
"Tabelle enthält duplizierte Werte"
(table contains duplicate values)
but now the log message was
"duplizierter Schlüssel verletzt Unique-Constraint »bayes_token_pkey«"
(duplicate key violates unique constraint)

The latter message is just an INFO, though its logged as ERROR. It 
happens when you try to INSERT a primary key that's already there, but 
this got only logged once:
ZUSAMMENHANG:  SQL-Anweisung »INSERT INTO bayes_token (id, token, 
spam_count, ham_count, atime) VALUES ( $1 ,  $2 ,  $3 ,  $4 ,  $5 )«
        PL/pgSQL function "put_tokens" line 18 at SQL statement
All other times just the violation was logged.

I double checked with a dump and reload to a fresh db - there is no 
spoon [The Matrix], and also no duplicate values exist.

The error I got december 2006 with the duplicate values was really a 
situation where values seem to have been inserted during a reload, but 
before the index was there. I was just nervous and mixed the two 
different warnings.

But I'd like to suggest changing the ERROR to WARNING for "duplicate key 
violates unique constraint", as it's not serious - but it sounds like a 
big problem.

Efharisto, Achilleas!

mfg zmi
// Michael Monnerie, Ing.BSc    -----
// Tel: 0676/846 914 666                      .network.your.ideas.
// PGP Key:        "curl -s | gpg --import"
// Fingerprint: EA39 8918 EDFF 0A68 ACFB  11B7 BA2D 060F 1C6F E6B0
// Keyserver:                   Key-ID: 1C6FE6B0

In response to


pgsql-admin by date

Next:From: Karthikeyan SundaramDate: 2007-02-08 00:49:45
Subject: question on passing parameter in sql query
Previous:From: Joshua D. DrakeDate: 2007-02-07 21:08:27
Subject: Re: [RFC] mysql compatibility project

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group