CVS User Account cvsuser
Tue Oct 19 02:16:10 PDT 2004
Log Message:
-----------
Moved view sl_status back to slony1_funcs.sql.

Jan

Modified Files:
--------------
    slony1-engine/src/backend:
        slony1_base.sql (r1.19 -> r1.20)
        slony1_funcs.sql (r1.34 -> r1.35)

-------------- next part --------------
Index: slony1_base.sql
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/src/backend/slony1_base.sql,v
retrieving revision 1.19
retrieving revision 1.20
diff -Lsrc/backend/slony1_base.sql -Lsrc/backend/slony1_base.sql -u -w -r1.19 -r1.20
--- src/backend/slony1_base.sql
+++ src/backend/slony1_base.sql
@@ -413,42 +413,6 @@
 		where S.set_id = SQ.seq_set
 			and PGC.oid = SQ.seq_reloid and PGN.oid = PGC.relnamespace;
 		
--- ----------------------------------------------------------------------
--- VIEW sl_status
---
---	This view shows the local nodes last event sequence number
---	and how far all remote nodes have processed events.
--- ----------------------------------------------------------------------
-create or replace view @NAMESPACE at .sl_status as select
-	E.ev_origin as st_origin,
-	C.con_received as st_received,
-	E.ev_seqno as st_last_event,
-	E.ev_timestamp as st_last_event_ts,
-	C.con_seqno as st_last_received,
-	C.con_timestamp as st_last_received_ts,
-	CE.ev_timestamp as st_last_received_event_ts,
-	E.ev_seqno - C.con_seqno as st_lag_num_events,
-	current_timestamp - CE.ev_timestamp as st_lag_time
-	from @NAMESPACE at .sl_event E, @NAMESPACE at .sl_confirm C,
-		@NAMESPACE at .sl_event CE
-	where E.ev_origin = C.con_origin
-	and CE.ev_origin = E.ev_origin
-	and CE.ev_seqno = C.con_seqno
-	and (E.ev_origin, E.ev_seqno) in 
-		(select ev_origin, max(ev_seqno)
-			from @NAMESPACE at .sl_event
-			where ev_origin = @NAMESPACE at .getLocalNodeId('_ at CLUSTERNAME@')
-			group by 1
-		)
-	and (C.con_origin, C.con_received, C.con_seqno) in
-		(select con_origin, con_received, max(con_seqno)
-			from @NAMESPACE at .sl_confirm
-			where con_origin = @NAMESPACE at .getLocalNodeId('_ at CLUSTERNAME@')
-			group by 1, 2
-		);
-comment on view @NAMESPACE at .sl_status is 'View showing how far behind remote nodes are.
-';
-
 -- **********************************************************************
 -- * Sequences
 -- **********************************************************************
Index: slony1_funcs.sql
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/src/backend/slony1_funcs.sql,v
retrieving revision 1.34
retrieving revision 1.35
diff -Lsrc/backend/slony1_funcs.sql -Lsrc/backend/slony1_funcs.sql -u -w -r1.34 -r1.35
--- src/backend/slony1_funcs.sql
+++ src/backend/slony1_funcs.sql
@@ -4469,3 +4469,44 @@
 Checks if a table has our special serial key column that is used if
 the table has no natural unique constraint.';
 
+
+-- ----------------------------------------------------------------------
+-- VIEW sl_status
+--
+--	This view shows the local nodes last event sequence number
+--	and how far all remote nodes have processed events.
+--
+--	This view can NOT be loaded in slony1_base.sql (where it
+--	naturally would belong) because of using a C function that
+--	is defined in this file.
+-- ----------------------------------------------------------------------
+create or replace view @NAMESPACE at .sl_status as select
+	E.ev_origin as st_origin,
+	C.con_received as st_received,
+	E.ev_seqno as st_last_event,
+	E.ev_timestamp as st_last_event_ts,
+	C.con_seqno as st_last_received,
+	C.con_timestamp as st_last_received_ts,
+	CE.ev_timestamp as st_last_received_event_ts,
+	E.ev_seqno - C.con_seqno as st_lag_num_events,
+	current_timestamp - CE.ev_timestamp as st_lag_time
+	from @NAMESPACE at .sl_event E, @NAMESPACE at .sl_confirm C,
+		@NAMESPACE at .sl_event CE
+	where E.ev_origin = C.con_origin
+	and CE.ev_origin = E.ev_origin
+	and CE.ev_seqno = C.con_seqno
+	and (E.ev_origin, E.ev_seqno) in 
+		(select ev_origin, max(ev_seqno)
+			from @NAMESPACE at .sl_event
+			where ev_origin = @NAMESPACE at .getLocalNodeId('_ at CLUSTERNAME@')
+			group by 1
+		)
+	and (C.con_origin, C.con_received, C.con_seqno) in
+		(select con_origin, con_received, max(con_seqno)
+			from @NAMESPACE at .sl_confirm
+			where con_origin = @NAMESPACE at .getLocalNodeId('_ at CLUSTERNAME@')
+			group by 1, 2
+		);
+comment on view @NAMESPACE at .sl_status is 'View showing how far behind remote nodes are.
+';
+


More information about the Slony1-commit mailing list