Re: Problem when adding an existing primary key

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: "Insyde" <insyde(at)insyde(dot)com(dot)br>, <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: Problem when adding an existing primary key
Date: 2003-02-02 20:28:53
Message-ID: 200302021228.53812.josh@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-novice

Ricardo,

> When I try to insert via application a registry that already exists
> Postgres shows an error "Unable to insert duplicate primary key on index
> 'index' ". I think it's an error, because I would treat this error, just
> like others.

You're getting that message becuase you are trying to insert a value into the
PK column which is a duplicate of a value already present. This is not
permitted ... definitionally, primary keys must be unique.

In other words, the above is a valid error message being sent to you because
you violated a table constraint.

If there is more to the story than that, I suggest that you post your problems
to the PGSQL-NOVICE mailing list, where other users will help you fix your
queries. For that matter, I believe that there are other Brazillians on some
of the other mailing lists (you could try PGSQL-GENERAL as well), which would
spare you the pain of translating your questions.

--
Josh Berkus
Aglio Database Solutions
San Francisco

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Stefanos Harhalakis 2003-02-02 20:47:04 psql 7.3.1: signal 11 + replace_vars_with_subplan_refs: variable not in subplan target list
Previous Message Tom Lane 2003-02-02 19:13:12 Re: Complex cursor won't rewind to 0-th row

Browse pgsql-novice by date

  From Date Subject
Next Message Ronald Schmidt 2003-02-02 21:50:40 Can't connect to postgresql on win32 using Perl
Previous Message Tom Lane 2003-02-02 06:13:25 Re: serial field starting at specific value