Can't add records - Mailing list pgsql-novice

From Setyo Nugroho
Subject Can't add records
Date
Msg-id 1037213093.494.56.camel@see03
Whole thread Raw
Responses Re: Can't add records
Re: Can't add records
List pgsql-novice
Hi all,

Wrote a small program using Qt. After some tests with another database,
usingthe very same program, I found something erroneous in my program.
- editing & deleting records: OK
- adding records: NO
I got this eror message:

"QPSQL:unable to create query.
Error: cannot insert a duplicate key into unique index route_pkey."

I am (almost) quite sure, this problem lies in the database. A double
check using a hand-coded program and a gui-based prog (Qt designer) has
been made, those produce same error.
This is my database:

cstowdb=# \d route;
            Table "route"
  Column  |     Type      | Modifiers
----------+---------------+-----------
 route_id | integer       | not null
 port1    | integer       |
 port2    | integer       |
 port3    | integer       |
 port4    | integer       |
 port5    | integer       |
 voynr    | character(10) |
Indexes: route_routeid_idx
Primary key: route_pkey

What does the above-mentioned error message mean?
How to fix the problem?

Regards,
Setyo Nugroho



pgsql-novice by date:

Previous
From: Lachlan Deck
Date:
Subject: Help with JDBC connection...
Next
From: Josh Berkus
Date:
Subject: Re: Can't add records