Postgres Setup for Yesod

I’m working on deploying a Yesod app and had to google the same commands I always do, so I thought I’d write them down:

sudo su - postgres
creatuser cgag -P
exit
createuser <appname>
createdb <appname>
createdb <appname>_production