Vm terminal issue with PSQL

have you tried the ‘if all else fails’ troubleshooting steps here Running the Relational Database Curriculum in your Browser

(where you delete the container entirely which would mean re-starting?)
The other option is to try to get postgresql restarted but without knowing what other services may be stopped, we may be just making more trouble down the road.