title: Difficulty connecting to PostgreSQL@localhost using node-postgress (Error:28000)
body: <p>I'm currently running openSuse on an rPi3B+ (aarch64) and have hit a wall running a NodeJS connection script.</p>
  
  <p>I went through the standard install of PostgreSQL (v10 is what is offered on this version of openSuse) then created a new role with</p>
  
  <pre><code>CREATE ROLE new_role LOGIN PASSWORD 'passwd';
  </code></pre>
  
  <p>and then a db with</p>
  
  <pre><code>CREATE DATABASE new_db OWNER new_role;
  </code></pre>
  
  <p>Both the <code>\l</code> &amp; <code>\du</code> return the expected outputs show that both the role and db have been created successfully with the correct owner.</p>
  
  <p>So I then quickly created a node project directory and copied the test script from the docs: <a href="https://node-postgres.com/features/connecting" rel="nofollow noreferrer">https://node-postgres.com/features/connecting</a></p>
  
  <pre><code>const { Pool, Client } = require('pg')
  const connectionString = 'postgresql://new_role:passwd@localhost:5432/new_db'
  
  const pool = new Pool({
    connectionString: connectionString,
  })
  
  pool.query('SELECT NOW()', (err, res) =&gt; {
    console.log(err, res)
    pool.end()
  })
  
  const client = new Client({
    connectionString: connectionString,
  })
  client.connect()
  
  client.query('SELECT NOW()', (err, res) =&gt; {
    console.log(err, res)
    client.end()
  })
  </code></pre>
  
  <p>This returns a few broken promise errors that I haven't caught(<code>.cath()</code>) correctly yet, and an error code of 28000 that looks like this:</p>
  
  <pre><code>{ error: Ident authentication failed for user "new_role"
  at Connection.parseE (/home/eru/postgresDB/node_modules/pg/lib/connection.js:554:11)
  at Connection.parseMessage (/home/eru/postgresDB/node_modules/pg/lib/connection.js:379:19)
  at Socket.&lt;anonymous&gt; (/home/eru/postgresDB/node_modules/pg/lib/connection.js:119:22)
  at Socket.emit (events.js:182:13)
  at addChunk (_stream_readable.js:283:12)
  at readableAddChunk (_stream_readable.js:264:11)
  at Socket.Readable.push (_stream_readable.js:219:10)
  at TCP.onStreamRead [as onread] (internal/stream_base_commons.js:94:17)
    name: 'error',
    length: 99,
    severity: 'FATAL',
    code: '28000',
    detail: undefined,
    hint: undefined,
    position: undefined,
    internalPosition: undefined,
    internalQuery: undefined,
    where: undefined,
    schema: undefined,
    table: undefined,
    column: undefined,
    dataType: undefined,
    constraint: undefined,
    file: 'auth.c',
    line: '328',
    routine: 'auth_failed' } undefined
  </code></pre>
  
  <p>So I'm pretty sure the attempt made it to the intended port otherwise I wouldn't have received the detailed error in terminal. The error code = <code>invalid_authorization_specification</code></p>
  
  <p>Is the there something I need to do on the server ,<code>psql</code> interface, that will fulfill the authorization specification?</p>
  
  <p>When I've looked into that specific one I can't seem to find useful search results relevant to my situation.</p>
  
  <p>Fairly new to postgres here so I'm sure this is a pretty noob mistake that I'm missing but any help or input is very appreciated!</p>