make search-replace work with tables that have a composite primary key

fixes #1049