I Always Use PostgreSQL Functions for Everything
medium.com