473,395 Members | 1,623 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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

(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 <ma*@warped.org> -----

Date: Sat, 24 Apr 2004 13:53:16 -0400
From: Max Baker <ma*@warped.org>
To: Mike Hunter <mh*****@ack.Berkeley.EDU>
Cc: ne************@lists.sourceforge.net
Subject: Re: [Netdisco] pgsql error messages
In-Reply-To: <20*******************@ack.Berkeley.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 -----

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

Nov 23 '05 #1
1 6656
Mike Hunter <mh*****@ack.Berkeley.EDU> writes:
After a recent power failure, a program that uses a pgsql backend
(netdisco) started to send me nastygrams.


Hmm. Try REINDEX on the index involved.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

Nov 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Maria L | last post by:
I have a client who needs to copy an existing sale. The problem is the Sale is made up of three tables: Sale, SaleEquipment, SaleParts. Each sale can have multiple pieces of equipment with...
2
by: Terry Fleming | last post by:
I have upgrade a 97 access database to 2003. I have a vb6 front end that I am trying to connect to the database. I am getting the "3343 Unrecognized database" error. I checked the references and...
10
by: jaire | last post by:
In my application I have two threads. Each of them creates a new propertygrid. In the property grid I have a property with a color editor. Whenever i am clicking on the combo box to change the...
3
by: Jon | last post by:
I'm learning about datatables. When using the example provided by MS in the ..NET Framework Class Library for DATATABLE (see below) I get an error on line 3 that says "Type expected". Is something...
2
by: borajetta | last post by:
ERROR: duplicate key violates unique constraint "pg_class_oid_index" I found a post earlier but wanted to post up my info as the other persons did not look like the same type of error: I tried...
3
by: fuimens | last post by:
Hi, With mysql-4.0.20, I have a problem inserting data with foreign key references, MySQL saying ERROR 1216: Cannot add or update a child row: a foreign key constraint fails The message is...
3
by: Joanne | last post by:
I have searched through previous threads regarding this error. I went back through all my code to make sure I closed and set to nothing all open db's and rs's. However, I still have one computer...
1
by: amindi | last post by:
Hi, I wrote a VB6 program to read some data records from a Ms Access database and to write them into a SQL server database.(I use Ms Access 2000 and SQL server 2000).After reading each record in...
0
by: UT-BadBoy | last post by:
Hi, I've been working with ASP.NET for about a year so I'm still considering myself to be somewhat of a novice in this field. I am receiving this particualr error when trying to hit a...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.