[Plproxy-users] PL/proxy and exceptions?

Hannu Krosing hannu at 2ndquadrant.com
Sun Jan 31 20:58:51 UTC 2010


On Sun, 2010-01-31 at 14:25 +0200, Martin Pihlak wrote:
> Rafael Martinez wrote:
> > Is it possible to catch this error in any way to be able to modify the
> > data  plproxy.get_cluster_partitions() uses and not try to use the
> > database with problems? We have tried to use EXCEPTION in the proxy
> > function but it gives an error when running it.
> > 
> 
> Not directly. However you could implement a some sort of health check
> that would periodically ping all the databases in the cluster. For example
> call a pl/proxy function wrapped in an EXCEPTION block, and in case of an
> error just remove the node from cluster. Actually it would have to replaced
> by a dummy, since pl/proxy requires the number of nodes to be a power of 2.

Better not use a dummy, but rather any other live node.

Dummy would give an error the next time, RUN ON ALL will take care of
duplicate nodes automagically

> regards,
> Martin
> 
> _______________________________________________
> Plproxy-users mailing list
> Plproxy-users at pgfoundry.org
> http://pgfoundry.org/mailman/listinfo/plproxy-users


-- 
Hannu Krosing   http://www.2ndQuadrant.com
PostgreSQL Scalability and Availability 
   Services, Consulting and Training




More information about the Plproxy-users mailing list