On Fri, Dec 22, 2017 at 11:56 AM, rihad <rihad@xxxxxxx> wrote: > I forgot to mention the real problem: the mentioned unique constraint didn't > work and allowed duplicate rows to get inserted into the table until the > duplicates were manually removed the the index was rebuilt. You should run amcheck functions on both environments, against all indexes, to see where the inconsistency arose, and to isolate any other inconsistencies that may have been missed. While amcheck is available from contrib in Postgres 10, you can get a version that will work on other versions through OS packages for most major Linux distributions. See: https://github.com/petergeoghegan/amcheck Note also that only this external version has the "heapallindexed" check. -- Peter Geoghegan