<div dir="ltr">Hello<div><br></div><div>Did you created the distribution rule and yet the tuples were not getting properly routed? Distribution rule is used by the pgpool-II to route the new row to the appropriate node. And the rule can be created by inserting a row into &quot;pgpool_catalog.dist_def&#39; table.</div>
<div><br></div><div>Distribution rule for the province table can be created like</div><div><font face="courier new, monospace">insert into pgpool_catalog.dist_def values (&#39;postgres&#39;,&#39;public&#39;,&#39;province&#39;,&#39;province_code&#39;,ARRAY[&#39;province_code&#39;,&#39;eco_zone_code&#39;,&#39;name&#39;],ARRAY[&#39;integer&#39;,&#39;integer&#39;,&#39;text&#39;], &#39;pgpool_catalog.dis_def_province&#39;);</font><br>
</div><div><br></div><div>please refer to the following tutorial for more details on configuring the replication </div><div><a href="http://www.pgpool.net/docs/pgpool-II-2.3/tutorial-en.html#replication-config">http://www.pgpool.net/docs/pgpool-II-2.3/tutorial-en.html#replication-config</a><br>
</div><div><br></div><div>Thanks and Regards</div><div>Usama</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jul 14, 2014 at 1:30 PM, Thao Nguyen Duy <span dir="ltr">&lt;<a href="mailto:ndt1983@gmail.com" target="_blank">ndt1983@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word;color:rgb(0,0,0);font-size:14px;font-family:Calibri,sans-serif"><div>Hi all,</div><div>
Could you help me on this error. </div><div>I have setup pgpool-II with 3 servers (<a href="http://192.168.1.131" target="_blank">192.168.1.131</a>: database node0, <a href="http://192.168.1.132" target="_blank">192.168.1.132</a>: pgpool, 192.168.1.133:database node 1) with parallel mode. In the partition rules I defined rule to partition a table into (province table) 2 database node (node0 and node1). The structure of province is </div>
<ul><li>province_code: integer</li><li>eco_<span style="font-style:italic">zone_</span>code :integer</li><li>name: character</li><li><a href="mailto:geom%3Apgpool-general@pgpool.net" target="_blank">geom:pgpool-general@pgpool.net</a>.</li>
</ul><div>The definition of partition is : </div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><div>CREATE OR REPLACE FUNCTION pgpool_catalog.dis_def_province(anyelement)</div><div>  RETURNS integer AS</div>
<div>$BODY$</div><div>    SELECT CASE WHEN $1 &gt; 0 AND $1 &lt;= 35 THEN 0</div><div>        </div><div>        ELSE 1</div><div>    END;</div><div>$BODY$</div><div>  LANGUAGE sql VOLATILE</div><div>  COST 100;</div><div>
ALTER FUNCTION pgpool_catalog.dis_def_province(anyelement)</div><div>  OWNER TO postgres;</div></div></blockquote><div>As I expected all provinces have province_code &gt; 35 will be stored on the node1.</div><div>But the rule does not affected.</div>
<div>Thank you so much!</div></div>
<br>_______________________________________________<br>
pgpool-general mailing list<br>
<a href="mailto:pgpool-general@pgpool.net">pgpool-general@pgpool.net</a><br>
<a href="http://www.pgpool.net/mailman/listinfo/pgpool-general" target="_blank">http://www.pgpool.net/mailman/listinfo/pgpool-general</a><br>
<br></blockquote></div><br></div>