Reflection does not identify primary keys
If you can create a reproducible test-case I would be happy to investigate. As it is, the reflection module is already tested and I can assure you that it is not as fundamentally broken as all that.

https://github.com/coleifer/peewee/blob/3b1181a7cf727cc749a5fbb76f96602a3bb3325b/tests/reflection.py#L77-L443 Figure it out. The problem is that I was using a user that doesn't own the tables being reflected. The query that retrieves the primary keys uses the view `table_constraints` which, according to Postgresql

> The view table_constraints contains all constraints belonging to tables that the current user owns or has some privilege other than SELECT on.

A possible answer is explained [here](https://stackoverflow.com/questions/39379939/how-to-access-information-schema-foreign-key-constraints-with-read-only-user-in).
It seems that `generate_models` does not identify when a field is the primary key. Instead it creates a composite primary key with all the fields in the model.