[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

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