Plain ns_db dml as I running this under OpenACS 3.2.x. At first I thought this could be a PG issue, but then it goes ok under psql. I am going to do some extra testing, but it was really annoying. You know the insertion is correct but it says it's not.
One thing here... I was inserting all rows (about 30) under a transaction. In psql I did outside a transaction.