Wed Jul 23 10:54:16 PDT 2008
- Previous message: [Slony1-general] Best way to check if a table is in replication?
- Next message: [Slony1-general] Best way to check if a table is in replication?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Glyn Astill wrote: > Hi Chaps, > > What's the best way to check if a table is in slony-i replication without knowing anything specific about the replication cluster/set? There is no need to tell if it's an origin or subscriber, just that slony is in operation on the table? > > The best I could come up with was (where the table name is "credit"): > > select count(*) from (pg_trigger join pg_class on tgrelid=pg_class.oid) > join pg_proc on (tgfoid=pg_proc.oid) where (proname = 'denyaccess' or proname = 'logtrigger') and relname = 'credit'; > > If the result > 0 then it's replicated. > > Is there any case I'd be missing something here, or is there a better way? > I'd sorta like to point at something involving looking up the table in sl_table, but that requires determining the replication schema, which mandates either: a) Doing a lookup to find any "sl_table" instances (there could be more than one, in principle!), and iterating over them, looking to see if the table is listed. That makes the logic more complex in the application. b) One could build a stored procedure that uses "EXECUTE" to do the logic in a); that eliminates extra round trips. I'm not sure that's fundamentally any better than the approach you suggest; it's certainly more complex. -- (format nil "~S@~S" "cbbrowne" "ca.afilias.info") <http://dba2.int.libertyrms.com/> Christopher Browne (416) 673-4124 (land)
- Previous message: [Slony1-general] Best way to check if a table is in replication?
- Next message: [Slony1-general] Best way to check if a table is in replication?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Slony1-general mailing list