PostgreSQL crashes during count row query
I run everything on my OS X Catalina laptop and use PostgreSQL 12
  EnterpriseDB.


There is a JIT-related problem on this platform and version that leads to the kind of crash you're reporting. It's explained on mailing lists:

Re: PG v12.2 - Setting jit_above_cost is causing the server to crash

At the moment, the workaround seeems to be to set jit = off until EDB releases a new version with a fix, hopefully in PostgreSQL 12.3