Re: duplicate key value violates unique constraint "pg_class_relname_nsp_index"

From: Melvin Davidson <melvin6925(at)gmail(dot)com>
To: Mitu Verma <mitu(dot)verma(at)ericsson(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: duplicate key value violates unique constraint "pg_class_relname_nsp_index"
Date: 2015-05-27 13:05:57
Message-ID: CANu8Fix9awzDHEJjcWnnqSxTESaAhkUMwRVN34GZzD-X0D3FyQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

What this indicates is that someone, or some thing, is trying to create a
table in a schema that already exists.
Here is the structure of pg_class_relname_nsp_index:
CREATE UNIQUE INDEX pg_class_relname_nsp_index ON pg_class USING btree
(relname, relnamespace)

What you should also see in the error log is a line immediately following
that error which shows you exactly what the conflict is, but you have not
provided that to us.

On Wed, May 27, 2015 at 4:19 AM, Mitu Verma <mitu(dot)verma(at)ericsson(dot)com> wrote:

> HI,
>
>
>
> Following error is continuously seen with the postgreSQL database which we
> are using at customer site.
>
>
>
> Current Errors observed:
> ./fm_db_VoiceReprocessing1/data/pg_log/postgresql-04.log:2015-04-04
> 01:00:16 CESTERROR: duplicate key value violates unique constraint
> "pg_class_relname_nsp_index"
>
>
>
>
>
> Any pointers on why these errors are coming? What is the meaning of
> duplicate key value violates unique constraint "pg_class_relname_nsp_index"
>
> If it is due to some index corruption or duplicate index? Please help.
>
>
>
>
>
> Following tables are used frequently in our case
>
>
>
> CREATE TABLE AuditTrailLogEntry
>
> (
>
> event int2,
>
> inNodeID VARCHAR(80),
>
> inNodeName VARCHAR(80),
>
> sourceID VARCHAR(300),
>
> inTime TIMESTAMP, -- YYYY/MM/DD HH:MM:SS.mmm
>
> outNodeID VARCHAR(80),
>
> outNodeName VARCHAR(80),
>
> destinationID VARCHAR(300),
>
> outTime TIMESTAMP, -- YYYY/MM/DD HH:MM:SS.mmm
>
> bytes bigint,
>
> cdrs bigint,
>
> tableIndex bigint, -- Unique key
>
> noOfSubfilesInFile bigint,
>
> recordSequenceNumberList VARCHAR(1000),
>
> primary key (tableindex)
>
> ) TABLESPACE MMDATA; –
>
>
>
>
>
> CREATE TABLE EventLogEntry
>
> (
>
> tableIndex int4, -- Unique key
>
> object VARCHAR(80),
>
> method VARCHAR(80),
>
> bgwUser VARCHAR(80),
>
> time CHAR(23), -- YYYY/MM/DD HH:MM:SS.mmm
>
> realUser VARCHAR(80),
>
> host VARCHAR(80),
>
> application VARCHAR(80)
>
> ) TABLESPACE MMDATA;
>
>
>
>
>
> Regards
>
> Mitu
>
>
>

--
*Melvin Davidson*
I reserve the right to fantasize. Whether or not you
wish to share my fantasy is entirely up to you.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2015-05-27 13:32:37 Re: duplicate key value violates unique constraint "pg_class_relname_nsp_index"
Previous Message Sven R. Kunze 2015-05-27 11:09:51 [plainto_tsquery] using OR