Ошибка подключения к Postgresql

Пишу бэк на node js. БД на PSQL. На одной машине все подключил и все было норм, но при переносе проекта на другую машину, ничего не получается, хотя повторил все точь в точь.

const {Pool} = require('pg');

const userPool = new Pool({
    host: 'localhost',
    user: 'bookAdmin',
    database: 'Books',
    table: 'Users',
    password: '666',
    port: 5432
});
async function A (){
    const data = await userPool.query(`SELECT * FROM "Users"`);
    console.log(data);
}
A();

выдает такую ошибку:

(node:45604) UnhandledPromiseRejectionWarning: error: ������������ "bookAdmin" �� ������ �������� ����������� (�� ������)
    at Parser.parseErrorMessage (C:\Users\PaS\ReactBookApp\server\node_modules\pg-protocol\dist\parser.js:241:15)
    at Parser.handlePacket (C:\Users\PaS\ReactBookApp\server\node_modules\pg-protocol\dist\parser.js:89:29)
    at Parser.parse (C:\Users\PaS\ReactBookApp\server\node_modules\pg-protocol\dist\parser.js:41:38)
    at Socket.<anonymous> (C:\Users\PaS\ReactBookApp\server\node_modules\pg-protocol\dist\index.js:8:42)
    at Socket.emit (events.js:315:20)
    at addChunk (_stream_readable.js:295:12)
    at readableAddChunk (_stream_readable.js:271:9)
    at Socket.Readable.push (_stream_readable.js:212:10)
    at TCP.onStreamRead (internal/stream_base_commons.js:186:23)
(node:45604) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:45604) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Совсем ничего не понимаю.


Ответы (0 шт):