Re: Adding PRIMARY KEY: Table contains duplicated values

From: Andreas Kretschmer <akretschmer(at)spamfence(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Adding PRIMARY KEY: Table contains duplicated values
Date: 2013-02-04 19:29:26
Message-ID: 20130204192926.GA20657@tux
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Alexander Farber <alexander(dot)farber(at)gmail(dot)com> wrote:

> Thank you -
>
> On Mon, Feb 4, 2013 at 5:06 PM, Andreas Kretschmer
> <akretschmer(at)spamfence(dot)net> wrote:
> >> # alter table pref_rep add primary key(id, author);
> >> NOTICE: ALTER TABLE / ADD PRIMARY KEY will create implicit index
> >> "pref_rep_pkey" for table "pref_rep"
> >> ERROR: could not create unique index "pref_rep_pkey"
> >> DETAIL: Table contains duplicated values.
>
> how do you get this DETAIL, is it a setting for psql prompt?

You means the 'DETAIL: Key (id1, id2)=(1, 2) is duplicated.'?

I'm using 9.2, i think, that's the reason.

Andreas
--
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect. (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly." (unknown)
Kaufbach, Saxony, Germany, Europe. N 51.05082°, E 13.56889°

In response to

Browse pgsql-general by date

  From Date Subject
Next Message AI Rumman 2013-02-04 20:06:45 Is it possible to migrate database from Postgresql 8.2 to 9.2 using pg_upgrade?
Previous Message Pavel Stehule 2013-02-04 19:10:42 Re: Options for passing values to triggers?