You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let gisSelect = {
text: `SELECT
<COLUMN1>,
<COLUMN2>,
<COLUMN3>,
<COLUMN4>
FROM <TABLE>
WHERE <COLUMN5>= '${req.body.<VARIABLE>}'`
};
// console.log(gisSelect.text);
// cb();
postGisConn.query(gisSelect, cb);
the documentation found at https://node-postgres.com/api/pool seems to suggest this is perfectly acceptable, however, we are constantly getting this error, all over when running our code.
Error: timeout exceeded when trying to connect
at Timeout.setTimeout [as _onTimeout] (/home/admin/nodeCode/ParticleRoutes/node_modules/pg-pool/index.js:188:27)
at ontimeout (timers.js:436:11)
at tryOnTimeout (timers.js:300:5)
at listOnTimeout (timers.js:263:5)
at Timer.processTimers (timers.js:223:10)
I can't figure out why especially since the documentation specifically says pool.query doesn't need a releaseCallback
Notice in the example above no releaseCallback was necessary. The pool is doing the acquiring and releasing internally. I find pool.query to be a handy shortcut in a lot of situations.
All my research seems to suggest though that this error was because I was exhausting the available idle connections and new ones are not being acquired, if so what are we doing wrong?
The text was updated successfully, but these errors were encountered:
We are running a VERY recent version of pg
I have the following db connection file for both MySQL connection and Postgres connections.
We use the exported pool connection from this file for queries to the db throughout the rest of the project.
const postGisConn = require('./dbConn').postGis;
...
the documentation found at https://node-postgres.com/api/pool seems to suggest this is perfectly acceptable, however, we are constantly getting this error, all over when running our code.
I can't figure out why especially since the documentation specifically says pool.query doesn't need a releaseCallback
All my research seems to suggest though that this error was because I was exhausting the available idle connections and new ones are not being acquired, if so what are we doing wrong?
The text was updated successfully, but these errors were encountered: