Not entirely automatic, but a step in the right direction. On my system, I did the following:
$ pg_ctl start -D $HOME/.linuxbrew/var/postgres -l logfile
You can simply create an alias in .bash_profileor .bashrc, for example:
alias poston="pg_ctl start -D $HOME/.linuxbrew/var/postgres -l logfile"
alias postoff="pg_ctl stop -D $HOME/.linuxbrew/var/postgres"
To test all this (if you do not already have a database on your computer), you can also create a database for your current user:
$ poston
$ createdb `whoami`
$ psql