Thread: vacuum analyze - cannot insert duplicate key...

vacuum analyze - cannot insert duplicate key...

From
Patrick Coulombe
Date:
medias=> vacuum analyze;
ERROR:  Cannot insert a duplicate key into a unique index


why i get this message, it's not the first time that i vacuum analyze my db.
but today, for a reason that i don't know, i got this message.

can you help me to find the error and fix it.
[PostgreSQL 6.5.3 on i686-pc-linux-gnu, compiled by gcc egcs-2.91.66]

i know, my version of postgresql is old. if you have a url who explain step
by step how to upgrade to 7.1, i will probably find the time to do it.

patrick


Re: vacuum analyze - cannot insert duplicate key...

From
Einar Karttunen
Date:
On Mon, Oct 01, 2001 at 09:31:51AM -0400, Patrick Coulombe wrote:
> medias=> vacuum analyze;
> ERROR:  Cannot insert a duplicate key into a unique index
>
>
> why i get this message, it's not the first time that i vacuum analyze my db.
> but today, for a reason that i don't know, i got this message.
You have probably somehow gotten a duplicate a value to a column
that has a unique constraint. This can happen if you for example
use copy and don't make sure that there are no conflicts...

> can you help me to find the error and fix it.
> [PostgreSQL 6.5.3 on i686-pc-linux-gnu, compiled by gcc egcs-2.91.66]
>
> i know, my version of postgresql is old. if you have a url who explain step
> by step how to upgrade to 7.1, i will probably find the time to do it.
>
Yes, you should upgrade in any case. The upgrade
should be done by dumping the db installing new
pg and restoring it. If you want to make sure that
nothing bad happens take a backup of your original
installation & databases before you start with the
upgrade.

- Einar Karttunen