Re: [BUGS] UNIQUE constraint no longer works under 6.5.1

Поиск
Список
Период
Сортировка
От Thomas Lockhart
Тема Re: [BUGS] UNIQUE constraint no longer works under 6.5.1
Дата
Msg-id 37B588A7.1DF3F239@alumni.caltech.edu
обсуждение исходный текст
Ответ на Re: [BUGS] UNIQUE constraint no longer works under 6.5.1  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
> Interesting.  Playing with some variants of your example shows that
> UNIQUE works fine *unless* there is another column marked PRIMARY KEY.
> Then the UNIQUE constraint is ignored.  Looks like a simple logic bug in
> the table-definition expander.
> A look at the CVS logs reveals this apparently related entry for
> parser/analyze.c:
> revision 1.102
> date: 1999/05/12 07:17:18;  author: thomas;  state: Exp;  lines: +68 -24
> Fix problem with multiple indices defined if using column- and table-
>  constraints. Reported by Tom Lane.
> Now, check for duplicate indices and retain the one which is a primary-key.

Yow! The problem reported earlier (by you, so you share some blame! ;)
was that if one specified a primary key *and* a unique constraint, and
they both pointed to the same column, then you got two indices
created. So I tried to go through the list of indices and drop any
which seemed to be the same as the primary key index.

I apparently hadn't tested for this reported case (obviously :() but
it should be easy to fix. I'll look at it soon, unless someone already
has.

                       - Thomas

--
Thomas Lockhart                lockhart@alumni.caltech.edu
South Pasadena, California

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [SQL] Anyone recognise this error from PL/pgSQL?
Следующее
От: Thomas Lockhart
Дата:
Сообщение: Re: [HACKERS] Re: [SQL] Anyone recognise this error from PL/pgSQL?