Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pg hanging when I call client.connect() #2275

Closed
gibran-shah opened this issue Jul 13, 2020 · 3 comments
Closed

pg hanging when I call client.connect() #2275

gibran-shah opened this issue Jul 13, 2020 · 3 comments

Comments

@gibran-shah
Copy link

Hello,

I recently had to upgrade my node.js version for my vue.js application (node.js on the backend) from v13.5.0 to v14.5.0. I reinstalled all my node packages, upgrading the ones I had to upgrade, and now the application hangs on all DB calls. We are using pg for our database calls. I upgraded pg to version 7.18.2.

Our initialization code looks like this:

this.pg = require('pg');
...
this.client = new this.pg.Client({
application_name: 'Back end',
ssl: {
rejectUnauthorized: false
}
});
this.initPromise = this.client.connect();

I put console logs around the call to this.client.connect() as follows:

console.log('before');
this.initPromise = this.client.connect();
console.log('after');

'after' never prints out.

Does anyone know why it hangs now that I've upgrade my node version?

@geoffsmith
Copy link

This maybe? #2170

@gibran-shah
Copy link
Author

I upgraded to pg v8.3.0 and it worked. Seems that npm install pg doesn't install the latest version after all. npm install pg@latest does.

@charmander
Copy link
Collaborator

Duplicate of #2250

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants