<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: PostgreSQL cluster: partitioning with plproxy (part II)</title>
	<atom:link href="http://kaiv.wordpress.com/2007/09/02/postgresql-cluster-partitioning-with-plproxy-part-ii/feed/" rel="self" type="application/rss+xml" />
	<link>http://kaiv.wordpress.com/2007/09/02/postgresql-cluster-partitioning-with-plproxy-part-ii/</link>
	<description>don't rely on luck, count on it</description>
	<lastBuildDate>Fri, 23 Oct 2009 10:27:49 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Kristo</title>
		<link>http://kaiv.wordpress.com/2007/09/02/postgresql-cluster-partitioning-with-plproxy-part-ii/#comment-609</link>
		<dc:creator>Kristo</dc:creator>
		<pubDate>Fri, 23 Oct 2009 10:27:49 +0000</pubDate>
		<guid isPermaLink="false">http://kaiv.wordpress.com/2007/09/02/postgresql-cluster-partitioning-with-plproxy-part-ii/#comment-609</guid>
		<description>yes it&#039;s ok as far as you link it</description>
		<content:encoded><![CDATA[<p>yes it&#8217;s ok as far as you link it</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: realqi.cn</title>
		<link>http://kaiv.wordpress.com/2007/09/02/postgresql-cluster-partitioning-with-plproxy-part-ii/#comment-608</link>
		<dc:creator>realqi.cn</dc:creator>
		<pubDate>Thu, 22 Oct 2009 08:01:30 +0000</pubDate>
		<guid isPermaLink="false">http://kaiv.wordpress.com/2007/09/02/postgresql-cluster-partitioning-with-plproxy-part-ii/#comment-608</guid>
		<description>hi , i have  quote it to my blog.  is it ok?</description>
		<content:encoded><![CDATA[<p>hi , i have  quote it to my blog.  is it ok?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kaiv</title>
		<link>http://kaiv.wordpress.com/2007/09/02/postgresql-cluster-partitioning-with-plproxy-part-ii/#comment-508</link>
		<dc:creator>kaiv</dc:creator>
		<pubDate>Tue, 15 Jul 2008 11:42:14 +0000</pubDate>
		<guid isPermaLink="false">http://kaiv.wordpress.com/2007/09/02/postgresql-cluster-partitioning-with-plproxy-part-ii/#comment-508</guid>
		<description>Dynamic sql in big databases is something i would never do. Its perfectly ok for small backoffice like applications but not at our data amounts.</description>
		<content:encoded><![CDATA[<p>Dynamic sql in big databases is something i would never do. Its perfectly ok for small backoffice like applications but not at our data amounts.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: darkanthey</title>
		<link>http://kaiv.wordpress.com/2007/09/02/postgresql-cluster-partitioning-with-plproxy-part-ii/#comment-507</link>
		<dc:creator>darkanthey</dc:creator>
		<pubDate>Thu, 10 Jul 2008 16:37:27 +0000</pubDate>
		<guid isPermaLink="false">http://kaiv.wordpress.com/2007/09/02/postgresql-cluster-partitioning-with-plproxy-part-ii/#comment-507</guid>
		<description>For example. But this not beautiful method. Needed analog *args.

&lt;code&gt;
CREATE OR REPLACE FUNCTION &quot;Account&quot;.updater_user(_name character varying, _email character varying, _id bigint)
  RETURNS void AS
$BODY$
DECLARE
    sql_argument varchar;
BEGIN
    sql_argument := &#039;&#039;;
    if _name notnull then sql_argument := &#039;name = &#039;&#039;&#039; &#124;&#124; _name &#124;&#124; &#039;&#039;&#039;&#039;; end if;
    if _email notnull then if sql_argument != &#039;&#039; then sql_argument := sql_argument &#124;&#124; &#039;,&#039;; end if; sql_argument := sql_argument &#124;&#124; &#039;email = &#039;&#039;&#039; &#124;&#124; _email &#124;&#124; &#039;&#039;&#039;&#039;; end if;
    sql_argument := sql_argument &#124;&#124; &#039; where id = &#039; &#124;&#124; _id;
    execute &#039;update &quot;Account&quot;.&quot;Account&quot; set &#039; &#124;&#124; sql_argument;
END;
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>For example. But this not beautiful method. Needed analog *args.</p>
<p><code><br />
CREATE OR REPLACE FUNCTION "Account".updater_user(_name character varying, _email character varying, _id bigint)<br />
  RETURNS void AS<br />
$BODY$<br />
DECLARE<br />
    sql_argument varchar;<br />
BEGIN<br />
    sql_argument := '';<br />
    if _name notnull then sql_argument := 'name = ''' || _name || ''''; end if;<br />
    if _email notnull then if sql_argument != '' then sql_argument := sql_argument || ','; end if; sql_argument := sql_argument || 'email = ''' || _email || ''''; end if;<br />
    sql_argument := sql_argument || ' where id = ' || _id;<br />
    execute 'update "Account"."Account" set ' || sql_argument;<br />
END;<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anonymous</title>
		<link>http://kaiv.wordpress.com/2007/09/02/postgresql-cluster-partitioning-with-plproxy-part-ii/#comment-506</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Thu, 10 Jul 2008 13:12:54 +0000</pubDate>
		<guid isPermaLink="false">http://kaiv.wordpress.com/2007/09/02/postgresql-cluster-partitioning-with-plproxy-part-ii/#comment-506</guid>
		<description>you can write normal plpgsql funcs on the proxy layer so you could do that inside the plpgsql func. Maybe i misunderstood you though. What exactly are you trying to accomplish?</description>
		<content:encoded><![CDATA[<p>you can write normal plpgsql funcs on the proxy layer so you could do that inside the plpgsql func. Maybe i misunderstood you though. What exactly are you trying to accomplish?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: darkanthey</title>
		<link>http://kaiv.wordpress.com/2007/09/02/postgresql-cluster-partitioning-with-plproxy-part-ii/#comment-505</link>
		<dc:creator>darkanthey</dc:creator>
		<pubDate>Thu, 10 Jul 2008 12:18:38 +0000</pubDate>
		<guid isPermaLink="false">http://kaiv.wordpress.com/2007/09/02/postgresql-cluster-partitioning-with-plproxy-part-ii/#comment-505</guid>
		<description>Can we create the variable arguments-list function with help of plproxy? For example, I need to ask the function for update but only when ask this function I will knew what column will be changed.</description>
		<content:encoded><![CDATA[<p>Can we create the variable arguments-list function with help of plproxy? For example, I need to ask the function for update but only when ask this function I will knew what column will be changed.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: joaocosme</title>
		<link>http://kaiv.wordpress.com/2007/09/02/postgresql-cluster-partitioning-with-plproxy-part-ii/#comment-503</link>
		<dc:creator>joaocosme</dc:creator>
		<pubDate>Wed, 02 Jul 2008 13:01:39 +0000</pubDate>
		<guid isPermaLink="false">http://kaiv.wordpress.com/2007/09/02/postgresql-cluster-partitioning-with-plproxy-part-ii/#comment-503</guid>
		<description>would you mind if i translate yout how to to PT_BR(Brazilian Portuguese)? im from brazilian postgresql community</description>
		<content:encoded><![CDATA[<p>would you mind if i translate yout how to to PT_BR(Brazilian Portuguese)? im from brazilian postgresql community</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anonymous</title>
		<link>http://kaiv.wordpress.com/2007/09/02/postgresql-cluster-partitioning-with-plproxy-part-ii/#comment-494</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Thu, 26 Jun 2008 22:24:24 +0000</pubDate>
		<guid isPermaLink="false">http://kaiv.wordpress.com/2007/09/02/postgresql-cluster-partitioning-with-plproxy-part-ii/#comment-494</guid>
		<description>you would not belive how complicated it is to make the decision about on what conditions to do so :) but to leave that aside i think you can do it with an external script that changes the run on connection aliases.</description>
		<content:encoded><![CDATA[<p>you would not belive how complicated it is to make the decision about on what conditions to do so <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  but to leave that aside i think you can do it with an external script that changes the run on connection aliases.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew Grytsenko</title>
		<link>http://kaiv.wordpress.com/2007/09/02/postgresql-cluster-partitioning-with-plproxy-part-ii/#comment-493</link>
		<dc:creator>Andrew Grytsenko</dc:creator>
		<pubDate>Thu, 26 Jun 2008 18:24:22 +0000</pubDate>
		<guid isPermaLink="false">http://kaiv.wordpress.com/2007/09/02/postgresql-cluster-partitioning-with-plproxy-part-ii/#comment-493</guid>
		<description>Is it posible to setup pgBounser that  when we had failure on one database than data would be transfered in to backup database.
If not Is there any &quot;ready to use&quot; solutions to solve that problem?</description>
		<content:encoded><![CDATA[<p>Is it posible to setup pgBounser that  when we had failure on one database than data would be transfered in to backup database.<br />
If not Is there any &#8220;ready to use&#8221; solutions to solve that problem?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kaiv</title>
		<link>http://kaiv.wordpress.com/2007/09/02/postgresql-cluster-partitioning-with-plproxy-part-ii/#comment-484</link>
		<dc:creator>kaiv</dc:creator>
		<pubDate>Fri, 11 Apr 2008 13:25:36 +0000</pubDate>
		<guid isPermaLink="false">http://kaiv.wordpress.com/2007/09/02/postgresql-cluster-partitioning-with-plproxy-part-ii/#comment-484</guid>
		<description>i understand that powerusers are already existing users so you should not have issues with id collisions there anyway. But when talking about numeric primary keys on partitions then incrementing PK-s by number of partitions like this:
part 0, start=0 increment by 4
part 1, start=1 increment by 4
part 2, start=2 increment by 4
part 3, start=3 increment by 4
is probably not the best idea(tm), it can get a bit complicated to mange it when you need to split your cluster to more partitions. It&#039;s better to keep a large enough PK (bigint) that consists of 2 parts. First of all a partition id that is systemwise unique and then the local incrementor.
part 1, start=1&lt;&lt;32 increment by 1
part 2, start=2&lt;&lt;32 increment by 1
part 3, start=3&lt;&lt;32 increment by 1
part 4, start=4&lt;&lt;32 increment by 1
I really doubt that you will hit the int limit on any of the partitions, by that time you most likely will have split the partitions already anyway.
The downside of this is of course that the PK id-s are not sequential.</description>
		<content:encoded><![CDATA[<p>i understand that powerusers are already existing users so you should not have issues with id collisions there anyway. But when talking about numeric primary keys on partitions then incrementing PK-s by number of partitions like this:<br />
part 0, start=0 increment by 4<br />
part 1, start=1 increment by 4<br />
part 2, start=2 increment by 4<br />
part 3, start=3 increment by 4<br />
is probably not the best idea(tm), it can get a bit complicated to mange it when you need to split your cluster to more partitions. It&#8217;s better to keep a large enough PK (bigint) that consists of 2 parts. First of all a partition id that is systemwise unique and then the local incrementor.<br />
part 1, start=1&lt;&lt;32 increment by 1<br />
part 2, start=2&lt;&lt;32 increment by 1<br />
part 3, start=3&lt;&lt;32 increment by 1<br />
part 4, start=4&lt;&lt;32 increment by 1<br />
I really doubt that you will hit the int limit on any of the partitions, by that time you most likely will have split the partitions already anyway.<br />
The downside of this is of course that the PK id-s are not sequential.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
