Tue Sep 14 03:49:40 PDT 2004
- Previous message: [Slony1-commit] By cbbrowne: Add a note about need to keep pg_listener vacuumed; this is
- Next message: [Slony1-commit] By wieck: Added functions to determine the current loaded slony schema.
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Log Message:
-----------
Added functions to determine the current loaded
slony schema.
Jan
Tags:
----
REL_1_0_STABLE
Modified Files:
--------------
slony1-engine/src/backend:
slony1_funcs.sql (r1.15 -> r1.15.2.1)
-------------- next part --------------
Index: slony1_funcs.sql
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/src/backend/slony1_funcs.sql,v
retrieving revision 1.15
retrieving revision 1.15.2.1
diff -Lsrc/backend/slony1_funcs.sql -Lsrc/backend/slony1_funcs.sql -u -w -r1.15 -r1.15.2.1
--- src/backend/slony1_funcs.sql
+++ src/backend/slony1_funcs.sql
@@ -165,6 +165,56 @@
-- ----------------------------------------------------------------------
+-- FUNCTION slonyVersionMajor()
+-- ----------------------------------------------------------------------
+create or replace function @NAMESPACE at .slonyVersionMajor()
+returns int4
+as '
+begin
+ return 1;
+end;
+' language plpgsql;
+
+
+-- ----------------------------------------------------------------------
+-- FUNCTION slonyVersionMinor()
+-- ----------------------------------------------------------------------
+create or replace function @NAMESPACE at .slonyVersionMinor()
+returns int4
+as '
+begin
+ return 0;
+end;
+' language plpgsql;
+
+
+-- ----------------------------------------------------------------------
+-- FUNCTION slonyVersionPatchlevel()
+-- ----------------------------------------------------------------------
+create or replace function @NAMESPACE at .slonyVersionPatchlevel()
+returns int4
+as '
+begin
+ return 3;
+end;
+' language plpgsql;
+
+
+-- ----------------------------------------------------------------------
+-- FUNCTION slonyVersion()
+-- ----------------------------------------------------------------------
+create or replace function @NAMESPACE at .slonyVersion()
+returns text
+as '
+begin
+ return '''' || @NAMESPACE at .slonyVersionMajor() || ''.''
+ || @NAMESPACE at .slonyVersionMinor() || ''.''
+ || @NAMESPACE at .slonyVersionPatchlevel();
+end;
+' language plpgsql;
+
+
+-- ----------------------------------------------------------------------
-- FUNCTION initializeLocalNode (no_id, no_comment)
--
-- Initializes a new node.
@@ -3551,3 +3601,43 @@
' language plpgsql;
+-- **********************************************************************
+-- * Views
+-- **********************************************************************
+
+
+-- ----------------------------------------------------------------------
+-- 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
+ );
+
+
- Previous message: [Slony1-commit] By cbbrowne: Add a note about need to keep pg_listener vacuumed; this is
- Next message: [Slony1-commit] By wieck: Added functions to determine the current loaded slony schema.
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Slony1-commit mailing list