By default PostgreSQL listens on a local domain socket for security reasons, however, by adding the host: localhost line you are telling the PostgreSQL driver that you want to use TCP networking, and so it switches to TCP/IP connections on port 5432.
The fact that use use localhost to connect to the local machine is irrelevant you can put any IP address there to connect to a PostgreSQL instance anywhere on the Internet -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/a7985685-3ac0-44a5-b360-234dccdfa227%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.