0

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.

coinfoot
  • 1
  • 1
  • 1
    Set a `port` in the database config file(s). https://guides.rubyonrails.org/configuring.html#configuring-a-database. See https://stackoverflow.com/q/5872264/438992 for an example w/ a `port` setting. – Dave Newton Sep 06 '22 at 18:31
  • You could do either one. If there is no good reason for the database to be running on 5433, then I would change that to 5432, as 5432 is the default. – jjanes Sep 06 '22 at 19:25

0 Answers0