Thu Oct 14 23:05:34 PDT 2004
- Previous message: [Slony1-commit] By cbbrowne: A couple extra notes
- Next message: [Slony1-commit] By cbbrowne: Added docs on two new event types for 1.0.3
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Log Message:
-----------
1. Added documentation of the new events SET_DROP_TABLE and SET_DROP_SEQUENCE
to README.events and to one of the comments on sl_event
2. Moved all VIEWs together to one place in slony1_base.sql
Modified Files:
--------------
slony1-engine/src/backend:
README.events (r1.2 -> r1.3)
slony1_base.sql (r1.17 -> r1.18)
slony1_funcs.sql (r1.32 -> r1.33)
-------------- next part --------------
Index: slony1_base.sql
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/src/backend/slony1_base.sql,v
retrieving revision 1.17
retrieving revision 1.18
diff -Lsrc/backend/slony1_base.sql -Lsrc/backend/slony1_base.sql -u -w -r1.17 -r1.18
--- src/backend/slony1_base.sql
+++ src/backend/slony1_base.sql
@@ -273,6 +273,8 @@
STORE_TRIGGER =
DROP_TRIGGER =
MOVE_SET =
+ SET_DROP_TABLE =
+ SET_DROP_SEQUENCE =
FAILOVER_SET =
SUBSCRIBE_SET =
ENABLE_SUBSCRIPTION =
@@ -350,22 +352,6 @@
end;
' language plpgsql;
-
--- ----------------------------------------------------------------------
--- VIEW sl_seqlastvalue
--- ----------------------------------------------------------------------
-create view @NAMESPACE at .sl_seqlastvalue as
- select SQ.seq_id, SQ.seq_set, SQ.seq_reloid,
- S.set_origin as seq_origin,
- @NAMESPACE at .sequenceLastValue(
- "pg_catalog".quote_ident(PGN.nspname) || '.' ||
- "pg_catalog".quote_ident(PGC.relname)) as seq_last_value
- from @NAMESPACE at .sl_sequence SQ, @NAMESPACE at .sl_set S,
- "pg_catalog".pg_class PGC, "pg_catalog".pg_namespace PGN
- where S.set_id = SQ.seq_set
- and PGC.oid = SQ.seq_reloid and PGN.oid = PGC.relnamespace;
-
-
-- ----------------------------------------------------------------------
-- TABLE sl_log_1
-- ----------------------------------------------------------------------
@@ -409,6 +395,59 @@
-- **********************************************************************
+-- * Views
+-- **********************************************************************
+-- ----------------------------------------------------------------------
+-- VIEW sl_seqlastvalue
+-- ----------------------------------------------------------------------
+create view @NAMESPACE at .sl_seqlastvalue as
+ select SQ.seq_id, SQ.seq_set, SQ.seq_reloid,
+ S.set_origin as seq_origin,
+ @NAMESPACE at .sequenceLastValue(
+ "pg_catalog".quote_ident(PGN.nspname) || '.' ||
+ "pg_catalog".quote_ident(PGC.relname)) as seq_last_value
+ from @NAMESPACE at .sl_sequence SQ, @NAMESPACE at .sl_set S,
+ "pg_catalog".pg_class PGC, "pg_catalog".pg_namespace PGN
+ 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: README.events
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/src/backend/README.events,v
retrieving revision 1.2
retrieving revision 1.3
diff -Lsrc/backend/README.events -Lsrc/backend/README.events -u -w -r1.2 -r1.3
--- src/backend/README.events
+++ src/backend/README.events
@@ -123,6 +123,26 @@
table to their configuration data. The call also adds the
replication log trigger to the table.
+SET_DROP_TABLE
+ ev_data1 tab_id
+
+ setDropTable(tab_id)
+ setDropTable_int(tab_id)
+
+ Only nodes that are currently subscribed to the table will drop the
+ table from their configuration data. The call also drops the
+ replication log trigger from the table, and restores the "normal"
+ rules/triggers.
+
+SET_DROP_SEQUENCE
+ ev_data1 seq_id
+
+
+ setDropSequence(seq_id)
+ setDropSequence_int(seq_id)
+
+ Only nodes that are currently subscribed to the sequence will drop the
+ table from their configuration data.
SUBSCRIBE_SET
ev_data1 sub_set
Index: slony1_funcs.sql
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/src/backend/slony1_funcs.sql,v
retrieving revision 1.32
retrieving revision 1.33
diff -Lsrc/backend/slony1_funcs.sql -Lsrc/backend/slony1_funcs.sql -u -w -r1.32 -r1.33
--- src/backend/slony1_funcs.sql
+++ src/backend/slony1_funcs.sql
@@ -4462,46 +4462,3 @@
Checks if a table has our special serial key column that is used if
the table has no natural unique constraint.';
-
--- **********************************************************************
--- * 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
- );
-comment on view @NAMESPACE at .sl_status is 'View showing how far behind remote nodes are.
-';
-
-
- Previous message: [Slony1-commit] By cbbrowne: A couple extra notes
- Next message: [Slony1-commit] By cbbrowne: Added docs on two new event types for 1.0.3
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Slony1-commit mailing list