Re: ERROR: relation "xxx" already exists but where???? - Mailing list pgsql-general

From Scott Marlowe
Subject Re: ERROR: relation "xxx" already exists but where????
Date
Msg-id dcc563d10708200806s60975c24gf0f4d57382eb64b4@mail.gmail.com
Whole thread Raw
In response to ERROR: relation "xxx" already exists but where????  ("Joost Kraaijeveld" <J.Kraaijeveld@Askesis.nl>)
List pgsql-general
On 8/20/07, Joost Kraaijeveld <J.Kraaijeveld@askesis.nl> wrote:
> I managed to drop a table without apparently droppig it's primary key
> After recreating the table I try to recreate the primary key.
>
> If I run the following:
>
> ALTER TABLE case_histories
>   ADD CONSTRAINT case_histories_pkey PRIMARY KEY(case_history_id);
>
> Postgresql responds with:
>
> NOTICE:  ALTER TABLE / ADD PRIMARY KEY will create implicit index "case_histories_pkey" for table "case_histories"
>
> ERROR: relation "case_histories_pkey" already exists
> SQL state: 42P07
>
> The table does not have this key. Assuming that the response is correct, where can I find and/or delete this
relation?I have deleted an entry inpg_constraint with that name but that did not do the trick 

A couple of things.

1:  Can you reproduce this, or is it a one time freak accident?
2:  What does \d from psql say about this table as it is?

If \d doesn't show a primary key but you can't add one, then something
is not right, and we'll have to go snooping through the system
catalogs to figure out what's what.

pgsql-general by date:

Previous
From: "Joost Kraaijeveld"
Date:
Subject: ERROR: relation "xxx" already exists but where????
Next
From: Richard Broersma Jr
Date:
Subject: Re: Table description