I’m trying to insert items into my postgres table via PHP
But get the following error message ERROR: duplicate key violates unique constraint "search6_idx1"
search6_idx1 is the index table for search6. I tried the following select setval('search6',45) and somehow that only works for sequences.
When you define an index you can optionally make it UNIQUE. Such indexes serve a double purpose:
In your case, it seems that the problem is one of these:
The respective solutions would be: