While attempting to use PostgreSQL in our Node (Hapi) application, we were experiencing an issue when multiple connections were made.
This issue is described in: brianc/node-postgres#725 and a potential solution was suggested: brianc/node-postgres#725 (comment)
The code in server.js
is copied from:
https://github.com/brianc/node-postgres/wiki/Example
(with a few minor heroku-specific modifications made)
Each HTTP request is inserting two records into the visit
table,
where we expect only one to be inserted ...
We pushed the example up to Heroku: https://node-postgres-example.herokuapp.com/
When you refresh the page you see that the visit count goes up by two each time...!
This is obviously not the desired behaviour ...