[pgpool-general: 1084] JDBC question about parallel query mode

张航 herro9900 at gmail.com
Fri Oct 12 12:28:05 JST 2012


Excuse me,

I'm new for pgpool-II.
Here comes a trouble for me,about the diffenences between jdbc query and
psql direct executing in parallel mode.
I built my cluster in parallel mode,following the tutorial
(
http://pgpool.projects.postgresql.org/pgpool-II/doc/tutorial-ja.html#parallel)
completely.

My 4 hosts showing as below:

pgpool-adm(pgpool-II installed ,working port 9999)
backend-0(datanode 1 on port 5432)
backend-1(datanode 2 on port 5432)
backend-2(datanode 3 on port 5432).

For a distributed table,
I can get the merged result set through the command lines in the host
"pgpool-adm" with "psql" command:

[root at pgpool-adm ~]# psql -p 9999 -c "select BID,COUNT(*),MIN(aid),MAX(AID)
from pgbench_accounts GROUP BY BID" bench_parallel -U postgres
 bid | count  |  min   |  max
-----+--------+--------+--------
   1 | 100000 |      1 | 100000
   3 | 100000 | 200001 | 300000
   2 | 100000 | 100001 | 200000
(3 rows)


But in JDBC side(via DBVisualizer or Java programming),
I can only get the result set from one node,just like psql on one of the
backend nodes:

[root at pgpool-adm ~]# psql -h backend-2 -c "select
BID,COUNT(*),MIN(aid),MAX(AID) from pgbench_accounts GROUP BY BID"
bench_parallel -U postgres
 bid | count  |  min   |  max
-----+--------+--------+--------
   2 | 100000 | 100001 | 200000
(1 row)

It seems that the JDBC would random choose one among the 3 backend
datanodes when building the db-connection,so I can only
make query on just one node.


In fact,JDBC is what I need...so can anyone help?
anyone can catact me both in english or japanese.

By the way,the pgAdmin tool can't make connection to host "pgpool-adm" on
9999,just tells that "An error has occurred"⋯⋯

That's all.


Thanks at first and best regards~

Herro
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.sraoss.jp/pipermail/pgpool-general/attachments/20121012/ac8d67a4/attachment.html>


More information about the pgpool-general mailing list