postgresql – postgres – result of the empty query when running on node / express (res.rows) but the data was returned well when manually consulted

I have a problem with a query that does not return anything in my node / express application (postgres db) when testing with the postman, but when I execute the sql query below on the psql terminal, or another program (dbvisualizer), the results They are printed perfectly.

app.get (& # 39; / orgVendor2 & # 39 ;, (request, answer, next) => {
pool.query (& # 39; SELECT o.organisation_name AS "org", STRING_AGG (v.name, & # 39 ;, & # 39;) AS "see" DE provider v JOIN organization or ON v.id_organization = o. organization_id GROUP BY 1 ORDER BY 1 & # 39 ;, (err, res) => {
if (err) returns next (err);
response.json (res.rows);
});
});

I do not know why it will not work. If I replace the SQL query with something simple like & # 39; select * from the organization & # 39 ;, then press localhost: 3000 / orgVendor2 with postman and get a complete answer as expected. I think the problem is that the node does not like the query for some reason, or that res.rows can not analyze the response, even if it's just two columns of data, with several hundred rows.

postgresql – Composite index design where only a subset will be consulted

I have a table with columns A (kinddate) B1B24 (everyone boolean).

Usually, A It will always be used in each consultation and only one of B1B24. A large subset of the second The columns (more than half) will generally be consulted more than the rest, but all will be used quite frequently.

Should I create indexes in 24 tuples of (A, B1)(A, B24)?
Or 1 large composite index that covers all the columns?

If I am creating many indexes, at what point am I adding too many indexes to the table and what is the approach to solve it? The table is used in a large number of basic functions and will be consulted very frequently.

the second the columns will only be filtered by true, and usually only one second column will be used in a single query. So the where clause of the query will generally look like this:

... WHERE A = & # 39; 2018-11-22 & # 39; And B12