database-proxy icon indicating copy to clipboard operation
database-proxy copied to clipboard

Hang while querying more than 100 rows from pgpool2

Open gary02 opened this issue 2 years ago • 0 comments

Thx for your time!

I have a pgpool2 instance in front of a postgresql@12 database.

The problem is that database-proxy get stuck when querying more than 100 rows ('select id from book limit 100' for example) from the pgpool2 , but it work well when querying the postgresql directly.

I've dig the code a bit and found that pg client actually can querying more than 100 rows from pgpool2 successfully .

import pg from "pg"
const {Pool} = pg;
const pool = new Pool({connectionString: 'postgresql://user:passwd@pgpool2address:9999/database'});
const client = await pool.connect();
client.query('select id from book limit 1000', (err, res) => {
  if (err) {
    console.log(err.stack)
  } else {
    console.log(res.rows.length)    //  output `1000`
  }
})

env

Node.js v16.18.1 @observablehq/database-proxy 3.0.0 pg 8.8.0

gary02 avatar Nov 30 '22 15:11 gary02