connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed

Viewed 35

I'm new to this so... my understanding is that postgres is listening on 5433 but the rails app is trying to connect on 5432

$ pg_lsclusters

Ver Cluster Port Status Owner    Data directory              Log file
14  main    5433 online postgres /var/lib/postgresql/14/main /var/log/postgresql/postgresql-14-main.log

$ sudo netstat -nlp | grep 5433

tcp        0      0 127.0.0.1:5433          0.0.0.0:*               LISTEN      -                   
unix  2      [ ACC ]     STREAM     LISTENING     340041   -                    /var/run/postgresql/.s.PGSQL.5433

I have read answers to similar questions but I haven't understood them well enough to fix this problem. Am I supposed to try to get postgres to listen on 5432? Or can I direct the app to try to connect on 5433 by editing config files?

-- This is on Codespace so it's running in a container.

0 Answers
Related