How to enforce that a company has a ceo?

I’ve a requirement to ensure that every company has an owner. Example database model with requirements @db<>fiddle.

I’ve tried following ideas:

  1. use before update or delete trigger: look at the graph and try to guess what happens after execution. It doesn’t work, because it’s executed immediately.
  2. use after update or delete constraint DEFERRABLE INITIALLY DEFERRED trigger: how check count of ceos’ if staff is deleted too? Or how to allow, if company is deleted with staff and role? And it isn’t easy to test with pgtap.

Any further ideas? Thanks!