[Pgpool-general] Parallel Query mode, trying to make inserts

Christopher Siwy topple at gmail.com
Sun Jan 6 21:22:19 UTC 2008


Has anyone got this error?

ERROR:  pgpool2 sql restriction
DETAIL:  cannot use SelectStmt in InsertStmt

I have pgpool setup and running connecting to 3 backend servers.  I have no
problem running DDL queries such as creating tables and functions.  I also
have inserted the appropriate records in pgpool_catalog.dist_def and
pgpool_catalog.replicate_def tables on the system db.

But when I run the command:
INSERT INTO test(test_id,test_val) VALUES (1,'be1');
I get the aforementioned error.

My test table is setup as such:
CREATE TABLE test (test_id int, test_val character(10));

My records in the system_db tables:
INSERT INTO pgpool_catalog.dist_def VALUES
('test','public','test','test_id',ARRAY['test_id','test_val'],ARRAY['integer','character(10)'],'dist_def_test');
INSERT INTO pgpool_catalog.replicate_def VALUES
('test','public','test',ARRAY['test_id','test_val'],ARRAY['integer','character(10)']);

My distribution function is as follows:
CREATE OR REPLACE FUNCTION pgpool_catalog.dist_def_test(val ANYELEMENT)
RETURNS INTEGER AS '
SELECT CASE WHEN $1 >= 0 and $1 < 10 THEN 0
WHEN $1 >= 10 and $1 < 20 THEN 1
WHEN $1 >= 20 and $1 < 30 THEN 2
END' LANGUAGE SQL;

I also only have parallel_query_mode set in my pgpool.conf file

Please help, I really would be interested in using pgpool-II for my parallel
query processing in PostgreSQL, but this is severely limiting my change of
using it.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://pgfoundry.org/pipermail/pgpool-general/attachments/20080106/7fc6f96c/attachment.html 


More information about the Pgpool-general mailing list