Skip site navigation (1) Skip section navigation (2)

Can't add records

From: Setyo Nugroho <snugroho(at)gmx(dot)net>
To: pgsql-novice <pgsql-novice(at)postgresql(dot)org>
Subject: Can't add records
Date: 2002-11-13 18:44:50
Message-ID: 1037213093.494.56.camel@see03 (view raw or flat)
Thread:
Lists: 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



Responses

pgsql-novice by date

Next:From: Josh BerkusDate: 2002-11-13 18:49:44
Subject: Re: Can't add records
Previous:From: von Schwerdtner, Thomas (GXS, FPI)Date: 2002-11-13 18:42:50
Subject: Re: Can't add records

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group