Questions tagged [node.js-pg]

Pg is free (MIT license) non-blocking PostgreSQL client for node.js

Pg is free (MIT license) non-blocking PostgreSQL client for node.js created by Brian Carlson.

It exists in two versions - one is pure JavaScript and second hasnative libpq bindings.

Documentation is available here: there: https://github.com/brianc/node-postgres

6 questions
10
votes
3 answers

Node's Postgres module pg returns wrong date

I have declared a date column in Postgres as date. When I write the value with node's pg module, the Postgres Tool pgAdmin displays it correctly. When I read the value back using pg, Instead of plain date, a date-time string comes with wrong…
Valentin H
  • 7,240
  • 12
  • 61
  • 111
1
vote
1 answer

Type error in Nodejs and Postgres

I'm generating a dynamic update query based on a list of provided objects for postgres. This is what my query looks like: update loan_item_assignment as t set id = c.id, dateselectionid = c.dateselectionid, loanitemid = c.loanitemid, active =…
Evan
  • 121
  • 4
0
votes
2 answers

how to display different div when i returned from servlet?

i have a jsp file with different div. First i display a div with login page after logged in it goes to servlet page and return back to same jsp page. My question how to display the different div after returning from the servlet?
0
votes
2 answers

How come when using pg if i return the result of my query from a function, it returns undefined, but if i console log it, it prints?

This is my code: const queryFirstNames = function (qString) { let firstNameMatches; client.query('SELECT * FROM famous_people WHERE first_name = $1', [qString], (err, result) => { if (err) { return console.error('error…
0
votes
0 answers

How can I access file system from an external javascript file?

I have a file named server.js which reads an HTML file named "game.html". That HTML file is linked with an external javascript file named "game.js". In server.js file if(request.url.indexOf('.html') != -1) { fs.readFile("game" + request.url,…
0
votes
2 answers

node.js, pg module and done() method

Using the pg module and clients pool I need to call done() method in order to return the client into clients pool. Once I connect to the server, I add SQL query client’s query queue and I start handling the result asynchronously row by row in row…
STeN
  • 6,262
  • 22
  • 80
  • 125