Re: FK Constraint on index not PK

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: FK Constraint on index not PK
Дата
Msg-id 20070113134357.GS27743@alvh.no-ip.org
обсуждение исходный текст
Ответ на Re: FK Constraint on index not PK  (Stéphane Schildknecht<stephane.schildknecht@postgresqlfr.org>)
Ответы Re: FK Constraint on index not PK  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Stéphane Schildknecht wrote:
> Joshua D. Drake a écrit :
> > On Fri, 2007-01-12 at 17:50 +0100, Stéphane Schildknecht wrote:
> >
> >> Dear community members,
> >>
> >> I'm having a quite strange behaviour while trying to drop some index.
> >>
> >> We have some tables with two indexes on a primary key. The first one was
> >> automatically created by the primary constraint. The second one was
> >> manually created on the same column. Don't know why, but I would now
> >> want to suppress it.
> >>
> >
> > Drop the second index. It is redundant.
>
> I know it. But I can't.

The problem is that the constraint was defined with a dependence on the
second index.  I guess what you could do is drop the constraint, drop
the second index, and then recreate the constraint.  Try it within a
transaction block, just in case it doesn't work (but I don't see why it
wouldn't)

--
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

В списке pgsql-general по дате отправления:

Предыдущее
От: Richard Huxton
Дата:
Сообщение: Re: FK Constraint on index not PK
Следующее
От: Aleksander Kmetec
Дата:
Сообщение: index type for indexing long texts