Add error message when a table has no primary key.

If we don't have a primary key we cannot safely insert/update records.

Refs #3950
Merge pull request #3956 from markstory/issue-3950

Add error message when a table has no primary key.