How can I calculate monthly retention cohorts in PostgreSQL? | SovranCode