Re: [SQL] ERROR: duplicate key violates unique constraint

2007-03-20 Thread Richard Huxton
remco lengers wrote: Hi List, Its been a while since I worked with databases and I am running into the following which I have not been able to find the root cause for: I have the follow SQL statement: INSERT INTO reference VALUES (DEFAULT,'123','2',1); Which generates the following error: "E

Re: [SQL] ERROR: duplicate key violates unique constraint

2007-03-20 Thread Bart Degryse
Use INSERT INTO reference(reference_text, reference_type, Topic_Id) VALUES (DEFAULT,'123','2',1); instead. Since referencelist_nr is a serial PostgreSQL will provide the next free integer itself. >>> "remco lengers" <[EMAIL PROTECTED]> 2007-03-20 10:11 >>> Hi List, Its been a while since I wo

[SQL] ERROR: duplicate key violates unique constraint

2007-03-20 Thread remco lengers
Hi List, Its been a while since I worked with databases and I am running into the following which I have not been able to find the root cause for: I have the follow SQL statement: INSERT INTO reference VALUES (DEFAULT,'123','2',1); Which generates the following error: "ERROR: duplicate key v

Re: [SQL] ERROR: duplicate key violates unique constraint (SOLVED)

2004-06-06 Thread Khairul Azmi
The problem is solved. It is a silly mistake actually. The line SELECT sid FROM conf_category WHERE category_name like temp_category and category_status=1; returns duplicated values. Variable temp_category would be '%dos.rules' and there are entries 'dos.rules' and 'ddos.rules' in t

Re: [SQL] ERROR: duplicate key violates unique constraint

2004-06-04 Thread Josh Berkus
Khairul, > Need help on this problem. I've created two functions. The function > should perform a few sql processes. The problem is I got different > results when I call the function and when I manually run the sql command. > > I'm using postgresql 7.4.2. Hmmm ... that's odd. I remember getting

[SQL] ERROR: duplicate key violates unique constraint

2004-06-04 Thread Khairul Azmi
Need help on this problem. I've created two functions. The function should perform a few sql processes. The problem is I got different results when I call the function and when I manually run the sql command. I'm using postgresql 7.4.2. The two functions involved are CREATE TABLE sensor_signatur