I have been looking at code, and the original code talks about it's OK that the keys are not unique for the sort of items, then in the PgSQL part - it complains about the keys not being unique..
If that's the error, would it be difficult to correct the flag in PgSQL so the keys can be non-unique?