Re: ERROR: duplicate key violates unique constraint "pg_type_typname_nsp_index"

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Guerin <guerin(at)rentec(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: ERROR: duplicate key violates unique constraint "pg_type_typname_nsp_index"
Date: 2004-11-27 19:06:07
Message-ID: 28194.1101582367@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Michael Guerin <guerin(at)rentec(dot)com> writes:
> I'm not sure what the cause of this error is, but I figured I
> should post it.

> ERROR: duplicate key violates unique constraint "pg_type_typname_nsp_index"
> ERROR: duplicate key violates unique constraint "pg_type_typname_nsp_index"
> CONTEXT: SQL statement "create temp table tmp_children ( uniqid bigint,
> memberid bigint, membertype varchar(50), ownerid smallint, tag varc
> har(50), level int4 )"

Hmm. It looks like the source of the problem is an
only-partially-deleted temp table left behind by some prior failure.
Specifically, the rowtype entry for the table is still there in
pg_type, though its pg_class entry must be gone or you'd have gotten
a different error message. This seems pretty odd, since the catalog
entries should have been deleted in a single transaction.

Can you look back just before you started getting these, and see if
there is any record of a backend crashing during exit?

It's too bad you already restored from backup, since you've now wiped
out all the evidence ...

regards, tom lane

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Thomas Hermann(Software) 2004-11-27 20:07:03 views with parameters
Previous Message Keith Worthington 2004-11-27 18:25:45 Re: missing function?