Use correct sql types for primary keys

PostgreSQL is strict about the sql type matching that of the columns