Implementing State Machines in PostgreSQL | Dark Hacker News