Bill Moran wmoran at collaborativefusion.com
Thu Jun 7 12:17:09 PDT 2007
In response to Andrew Sullivan <ajs at crankycanuck.ca>:

> On Thu, Jun 07, 2007 at 02:46:02PM -0400, Bill Moran wrote:
> > 
> > I have a need to connect to a database, and quickly and easily determine
> > whether it is the slony master or a slony slave.  Currently, I do a 
> 
> There's no way to check that, because it's not a meaningful question. 
> If you want to know whether a given _table_ is a replica or not, you
> can find that out by looking in the _slony schema.  Look for the
> tab_set in _slony.sl_table for your table, then look in the sl_set
> table for that set number, and look at the set_origin.  Finally,
> select last_value from sl_local_node_id.  Note that this is a
> sequence, so be careful with it!

Thanks.  In our case, all the tables have the same origin, so that's
a safe assumption to make.

-- 
Bill Moran
Collaborative Fusion Inc.
http://people.collaborativefusion.com/~wmoran/

wmoran at collaborativefusion.com
Phone: 412-422-3463x4023


More information about the Slony1-general mailing list