diff --git a/config/database.yml b/config/database.yml index 94b772eb511..2fab24e56cd 100644 --- a/config/database.yml +++ b/config/database.yml @@ -43,7 +43,7 @@ production: uri: <%= uri = URI.parse(ENV['POSTGRES_URL'] ? ENV['POSTGRES_URL'] : "pg://localhost") %> socket: <%= ENV['POSTGRES_SOCKET'] %> host: <%= uri.host %> - port: <%= uri.port || 5432 %> + port: <%= uri.port || (ENV['POSTGRES_SOCKET'] ? nil : 5432) %> database: <%= ENV['POSTGRES_DB'] || "discourse" %> username: <%= uri.user %> password: <%= uri.password %>