Fixes postgresql basing primary index on index name instead of index flag