My database hurts "ERROR: duplicate key violates unique constraint"

From: Mike Hunter <mhunter(at)ack(dot)Berkeley(dot)EDU>
To: pgsql-general(at)postgresql(dot)org
Subject: My database hurts "ERROR: duplicate key violates unique constraint"
Date: 2004-05-06 23:32:16
Message-ID: 20040506233216.GA28617@ack.Berkeley.EDU
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

(Please CC me on any replies as I'm not on the list)

Hi,

After a recent power failure, a program that uses a pgsql backend
(netdisco) started to send me nastygrams. I tried the author's suggestion
of running a VACUUM FULL ANALYZE VERBOSE;, but it still sends me the
messages. The data in the database isn't too important, i.e. I'm willing
to blow away data to try to fix the problem. Any suggestions?

Thanks for your help and thanks on behalf of my whole department for
postgresql.

Mike

----- Forwarded message from Max Baker <max(at)warped(dot)org> -----

Date: Sat, 24 Apr 2004 13:53:16 -0400
From: Max Baker <max(at)warped(dot)org>
To: Mike Hunter <mhunter(at)ack(dot)Berkeley(dot)EDU>
Cc: netdisco-users(at)lists(dot)sourceforge(dot)net
Subject: Re: [Netdisco] pgsql error messages
In-Reply-To: <20040415230254(dot)GA8962(at)ack(dot)Berkeley(dot)EDU>
User-Agent: Mutt/1.4.2i

Mike,

The first thing I would try is the "Things are getting really slow"
procedure in README for the database.

After that I would end up posting the same question on one of the postgres
mailing lists.

-m
On Thu, Apr 15, 2004 at 04:02:54PM -0700, Mike Hunter wrote:
> Hey everybody,
>
> I can't really blame netdisco for this one; we had a power outage and this
> machine went down ungracefully. Now cron sends me these notes, but
> netdisco still seems to function.
>
> DBD::Pg::db do failed: ERROR: duplicate key violates unique constraint "node_pkey" at /usr/local/netdisco/netdisco.pm line 1076.
> DBD::Pg::db do failed: ERROR: duplicate key violates unique constraint "node_pkey" at /usr/local/netdisco/netdisco.pm line 967.
> insert_or_update(UPDATE node SET switch='128.32.11.11',active='1',time_last='Thu Apr 15 14:06:05 2004',mac='00:03:93:48:e8:f8',port='FastEthernet1/2',oui='00:03:93' WHERE switch = '128.32.11.11' AND port = 'FastEthernet1/2' AND mac = '00:03:93:48:e8:f8' ) ERROR: duplicate key violates unique constraint "node_pkey"
> at /usr/local/netdisco/netdisco line 1810
> DBD::Pg::db do failed: ERROR: duplicate key violates unique constraint "node_pkey" at /usr/local/netdisco/netdisco.pm line 1076.
> DBD::Pg::db do failed: ERROR: duplicate key violates unique constraint "node_pkey" at /usr/local/netdisco/netdisco.pm line 967.
> at /usr/local/netdisco/netdisco line 1810
>
> I'm gonna try rediscovering the device I suppose...any other advice?
>
> Mike

----- End forwarded message -----

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alvaro Herrera 2004-05-06 23:58:13 Re: Problem with commandprompt.com
Previous Message Marc G. Fournier 2004-05-06 23:30:55 Re: Problem with commandprompt.com