pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Monnerie <michael.monnerie@it-management.at>
To: pgsql-admin@postgresql.org
Subject: Re: destroyed db/index (corruption) [SOLVED]
Date: Wed, 7 Feb 2007 23:07:41 +0100
Message-ID: <200702072307.45566@zmi.at> (raw)
In-Reply-To: <200702060946.35367.achill@matrix.gatewaynet.com>
References: <200702051500.19196@zmi.at>
	<200702052236.13498@zmi.at>
	<200702060946.35367.achill@matrix.gatewaynet.com>

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    -----      http://it-management.at
// Tel: 0676/846 914 666                      .network.your.ideas.
// PGP Key:        "curl -s http://zmi.at/zmi4.asc | gpg --import"
// Fingerprint: EA39 8918 EDFF 0A68 ACFB  11B7 BA2D 060F 1C6F E6B0
// Keyserver: www.keyserver.net                   Key-ID: 1C6FE6B0

view thread (2+ messages)  latest in thread

Message-ID: <200702072307.45566@zmi.at>
Permalink:  ../200702072307.45566@zmi.at/
Also on:    postgresql.org/message-id/200702072307.45566@zmi.at

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: michael.monnerie@it-management.at
  Subject: Re: destroyed db/index (corruption) [SOLVED]
  In-Reply-To: <200702072307.45566@zmi.at>
  References: <200702051500.19196@zmi.at> <200702052236.13498@zmi.at> <200702060946.35367.achill@matrix.gatewaynet.com> <200702072307.45566@zmi.at>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox