Update forInsert to work with postgresql.