title: Connecting to postgres works with python bot not in node
body: <p>I am trying to connect to my <code>postgres docker-container</code> using the following code:</p>
  <pre><code>const { Pool, Client } = require(&quot;pg&quot;);
  var conString = &quot;postgres://postgres:rootuser@127.0.0.1:5432/postgres&quot;;
  const pool = new Pool({
    conString,
  });
  console.log(&quot;--------------- first ---------------&quot;)
  pool.query(&quot;SELECT NOW()&quot;, (err, res) =&gt; {
    console.log(&quot;--------------- second ---------------&quot;)
    console.log(err, res);
    pool.end();
  });
  console.log(&quot;--------------- third ---------------&quot;)
  
  const client = new Client({
    conString,
  });
  client.connect().then((client) =&gt; {
    client.query(&quot;SELECT NOW()&quot;, (err, res) =&gt; {
      console.log(&quot;--------------- fourth ---------------&quot;)
      console.log(err, res);
      client.end();
    });
  });
  
  
  </code></pre>
  <p>This does not work at all. The output i get:</p>
  <p><code>--------------- first ---------------</code>
  <code>--------------- third ---------------</code></p>
  <p>While executing this <code>python</code> script works:</p>
  <pre><code>try:
      connection = psycopg2.connect(user=&quot;postgres&quot;,
                                    password=&quot;rootuser&quot;,
                                    host=&quot;localhost&quot;,
                                    port=&quot;5432&quot;,
                                    database=&quot;postgres&quot;)
  
  
      cursor = connection.cursor()
  
      print(connection.get_dsn_parameters(), &quot;\n&quot;)
  
      cursor.execute(&quot;SELECT NOW()&quot;)
  
      # Fetch result
      record = cursor.fetchone()
      cursor.close()
  
      print(&quot;now: &quot;, record, &quot;\n&quot;)
  
  except (Exception, Error) as error:
      print(&quot;Error while connecting to PostgreSQL&quot;, error)
  finally:
      if (connection):
          cursor.close()
          connection.close()
          print(&quot;PostgreSQL connection is closed&quot;)
  
  </code></pre>
  <p>I am so confused. Maybe something with <code>docker</code> and <code>node</code>?</p>
  <ul>
  <li><p>Host: Mac M1</p>
  </li>
  <li><p>pg version: 8.0.3</p>
  </li>
  <li><p>node version: v18.7.0</p>
  </li>
  </ul>
  <p>Thanks in advance</p>