Re: Strange error dropping foreign key

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Pgsql-hackers(at)postgresql(dot)org
Subject: Re: Strange error dropping foreign key
Date: 2007-10-19 13:29:26
Message-ID: 20071019132926.GN6268@svr2.hagander.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Oct 18, 2007 at 10:48:02AM -0400, Tom Lane wrote:
> "Magnus Hagander" <magnus(at)hagander(dot)net> writes:
> > db=# alter table isi.items_stat drop constraint items_stat_item_id_fkey;
> > ERROR: "items_pkey" is an index
>
> Context please?

Yeah, I had that one coming, didn't it... That's what I get for trying to
type it up on my phone on the way home.

Anyway. I've asked for a dump of the db to get all the details, but basically:
CREATE TABLE items (
id int not null primary key,
<bunchoffields>
);
CREATE TABLE items_stat (
item_id int not null references items.id,
<bunchoffields>
);

One thing that might be related - items is a Slony slave table. items_stat
is *not* in the Slony set. It's not *supposed* to have a foreign key to the
items table, which is why I'm trying to drop it.

It had the same scenario on teh primary slony node, but there the ALTER
TABLE to drop the constraint worked fine. Again, items is master in the
slony set, items_stat is not in any slony set.

//Magnus

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Hannu Krosing 2007-10-19 13:54:48 Re: Strange error dropping foreign key
Previous Message Gregory Stark 2007-10-19 13:16:20 Re: Debugger