Affects Postgres 9.6 - alphine
In a recent change, the default postgres user gets a home folder. Fine in theory, but it has the unfortuante side effect of defining the default shell as /sbin/nologin. This means that you can no longer login as a postgres user.
the easiest way to fix this, is by running a quick sed on /etc/passwd
su root -c "sed -i -e 's|postgresql:/sbin/nologin|postgresql:/bin/ash|g' /etc/passwd"
A more constructive solution would be to set the shell using --shell (-s)