473,664 Members | 3,066 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ERROR: duplicate key violates unique constraint "pg_class_oid_i ndex"

ERROR: duplicate key violates unique constraint "pg_class_oid_i ndex"

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 to cluster the isbn_table

cluster isbn_index_code on isbn_table;
ERROR: duplicate key violates unique constraint "pg_class_oid_i ndex"

The table looks like this

Table "public.isbn_ta ble"
Column | Type | Modifiers
---------+--------+-----------
item_id | bigint | not null
date | date |
code | isbn |
Indexes:
"isbn_pkey_item _id" primary key, btree (item_id)
"isbn_index_cod e" btree (code)
"isbn_index_dat e" btree (date)
"isbn_index_dat e_code" btree (date, code)
Triggers:
checkisbn BEFORE INSERT OR UPDATE ON isbn_table FOR EACH ROW EXECUTE PROCEDURE isbntrigger()

Here is the vacuum verbose of pg_class

INFO: vacuuming "pg_catalog.pg_ class"
INFO: index "pg_class_oid_i ndex" now contains 698 row versions in 7 pages
DETAIL: 168 index row versions were removed.
0 index pages have been deleted, 0 are currently reusable.
CPU 0.00s/0.00u sec elapsed 0.00 sec.
INFO: index "pg_class_relna me_nsp_index" now contains 698 row versions in 23 pages
DETAIL: 168 index row versions were removed.
0 index pages have been deleted, 0 are currently reusable.
CPU 0.00s/0.00u sec elapsed 0.00 sec.
INFO: "pg_class": removed 170 row versions in 10 pages
DETAIL: CPU 0.00s/0.00u sec elapsed 0.00 sec.
INFO: "pg_class": found 170 removable, 698 nonremovable row versions in 143 pages
DETAIL: 0 dead row versions cannot be removed yet.
There were 5717 unused item pointers.
0 pages are entirely empty.
CPU 0.00s/0.00u sec elapsed 0.00 sec.
VACUUM


select * from pg_class where relname='isbn_t able';

relname | relnamespace | reltype | relowner | relam | relfilenode | relpages | reltuples | reltoastrelid | reltoastidxid | relhasindex | relisshared | relkind | relnatts | relchecks | reltriggers | relukeys | relfkeys | relrefs | relhasoids | relhaspkey | relhasrules | relhassubclass | relacl
------------+--------------+------------+----------+-------+-------------+----------+-------------+---------------+---------------+-------------+-------------+---------+----------+-----------+-------------+----------+----------+---------+------------+------------+-------------+----------------+--------
isbn_table | 2200 | 4280007913 | 1 | 0 | 4281669172 | 13950 | 2.03181e+06 | 0 | 0 | t | f | r | 3 | 0 | 1 | 0 | 0 | 0 | f | t | f | f |
(1 row)
select oid,ctid,cmax,x max,cmin,xmin,* from pg_class
where relname='isbn_t able';

oid | ctid | cmax | xmax | cmin | xmin | relname | relnamespace | reltype | relowner | relam | relfilenode | relpages | reltuples | reltoastrelid | reltoastidxid | relhasindex | relisshared | relkind |relnatts | relchecks | reltriggers | relukeys | relfkeys | relrefs | relhasoids | relhaspkey | relhasrules | relhassubclass | relacl
------------+----------+------+------+------+----------+------------+--------------+------------+----------+-------+-------------+----------+-------------+---------------+---------------+-------------+-------------+---------+----------+-----------+-------------+----------+----------+---------+------------+------------+-------------+----------------+--------
4280007912 | (132,16) | 3 | 0 | 0 | 46981456 | isbn_table | 2200 | 4280007913 | 1 | 0 | 4281669172 | 13950 | 2.03181e+06 | 0 | 0 | t | f | r |3 | 0 | 1 | 0 | 0 | 0 | f | t | f | f |
(1 row)

Nov 23 '05 #1
2 3222
"borajetta" <bo*******@hotm ail.com> writes:
I tried to cluster the isbn_table cluster isbn_index_code on isbn_table;
ERROR: duplicate key violates unique constraint "pg_class_oid_i ndex"


Is this repeatable? If so, could you get a debugger stack trace from
the point of the error?

Also, exactly which PG version are you using?

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 23 '05 #2
I am using PG version 7.4.3.2.

----- Original Message -----
From: "Tom Lane" <tg*@sss.pgh.pa .us>
To: "borajetta" <bo*******@hotm ail.com>
Cc: <pg***********@ postgresql.org>
Sent: Saturday, August 21, 2004 8:55 AM
Subject: Re: [GENERAL] ERROR: duplicate key violates unique constraint
"pg_class_oid_i ndex"

"borajetta" <bo*******@hotm ail.com> writes:
I tried to cluster the isbn_table

cluster isbn_index_code on isbn_table;
ERROR: duplicate key violates unique constraint "pg_class_oid_i ndex"


Is this repeatable? If so, could you get a debugger stack trace from
the point of the error?

Also, exactly which PG version are you using?

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend


---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Nov 23 '05 #3

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

Similar topics

0
3382
by: David Garamond | last post by:
postgresql 7.4.0, redhat 7.3 (under vmware 4.0 on win2k) Windows crashed and some of the files on Redhat got corrupted, including some files in /var/lib/pgsql/data/pg_xlog/. When I tried to start postmaster, it fails with message "Invalid primary checkPoint record". I think it was trying to look for files named "0000000000000021" but only files named "0000000000000022" through "0000000000000027" were there. So I ran pg_resetxlog (this is...
0
8437
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8348
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8861
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8636
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7375
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5660
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4351
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2003
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1759
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.