Chris Browne cbbrowne at lists.slony.info
Wed Apr 18 08:03:53 PDT 2007
Update of /home/cvsd/slony1/slony1-engine/tests/test1
In directory main.slony.info:/tmp/cvs-serv3274/tests/test1

Modified Files:
	README init_add_tables.ik init_data.sql init_schema.sql 
	schema.diff 
Log Message:
Patch that removes TABLE ADD KEY from CVS HEAD.  This supercedes the
previous patch:

http://lists.slony.info/pipermail/slony1-patches/2007-April/000008.html

Per Bill Moran's comments, this also drops out usage of sl_rowid_seq.
http://lists.slony.info/pipermail/slony1-general/2007-April/005883.html

It passes test1, as revised in the patch (e.g. - to remove usage of
TABLE ADD KEY)...

----------------------------------------------------
creating origin DB: cbbrowne -h localhost -U cbbrowne -p 5882 slonyregress1
add plpgsql to Origin
loading origin DB with test1/init_schema.sql
setting up user cbbrowne to have weak access to data
done
creating subscriber 2 DB: cbbrowne -h localhost -U cbbrowne -p 5882
slonyregress2
add plpgsql to subscriber
loading subscriber 2 DB from slonyregress1
done
creating cluster
done
storing nodes
done
Granting weak access on Slony-I schema
done
storing paths
done
launching originnode : /opt/OXRS/dbs/pgsql82/bin/slon -s500 -g10 -d2
slony_regress1 "dbname=slonyregress1 host=localhost user=cbbrowne port=5882"
launching: /opt/OXRS/dbs/pgsql82/bin/slon -s500 -g10 -d2 slony_regress1
"dbname=slonyregress2 host=localhost user=cbbrowne port=5882"
subscribing
done
generating 468 transactions of random data
0 %
5 %
10 %
15 %
20 %
25 %
30 %
35 %
40 %
45 %
50 %
55 %
60 %
65 %
70 %
75 %
80 %
85 %
90 %
95 %
100 %
done
launching polling script
loading data
data load complete
completed generate_sync_event() test
completed make_function_strict() test
done
slony is caught up
getting data from origin DB for diffing
done
getting data from node 2 for diffing against origin
comparing
subscriber node 2 is the same as origin node 1
done
**** killing slon node 1
**** killing slon node 2
waiting for slons to die
done
dropping database
slonyregress1
slonyregress2
done
***************************
test test1 completed successfully
***************************


Index: README
===================================================================
RCS file: /home/cvsd/slony1/slony1-engine/tests/test1/README,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** README	22 Mar 2007 20:44:13 -0000	1.8
--- README	18 Apr 2007 15:03:51 -0000	1.9
***************
*** 12,25 ****
  2.  table2 lacks a formal primary key, but has a candidate primary key
  
! 3.  table3 has no candidate primary key; Slony-I is expected to
!     generate one on its own.
! 
! It actually tries replicating a fourth table, which has an invalid
! candidate primary key (columns not defined NOT NULL), which should
! cause it to be rejected.  That is done in a slonik TRY {} block.
  
  It also creates...
  
! 5.  table5 which has columns of all sorts of vaguely esoteric types to
  exercise that points, paths, bitmaps, mac addresses, and inet types
  replicate properly.
--- 12,22 ----
  2.  table2 lacks a formal primary key, but has a candidate primary key
  
! It tries replicating a third table, which has an invalid candidate
! primary key (columns not defined NOT NULL), which should cause it to
! be rejected.  That is done in a slonik TRY {} block.
  
  It also creates...
  
! 5.  table4 which has columns of all sorts of vaguely esoteric types to
  exercise that points, paths, bitmaps, mac addresses, and inet types
  replicate properly.

Index: init_data.sql
===================================================================
RCS file: /home/cvsd/slony1/slony1-engine/tests/test1/init_data.sql,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** init_data.sql	4 Aug 2006 20:06:24 -0000	1.2
--- init_data.sql	18 Apr 2007 15:03:51 -0000	1.3
***************
*** 3,10 ****
  INSERT INTO table2(table1_id,data) VALUES (1,'placeholder 1');
  INSERT INTO table2(table1_id,data) VALUES (2,'placeholder 2');
- INSERT INTO table3(table2_id) VALUES (1);
- INSERT INTO table3(table2_id) VALUES (2);
  
! INSERT INTO table5(numcol,realcol,ptcol,pathcol,polycol,circcol,ipcol,maccol,bitcol) values ('74.0','7.40','(7,4)','((7,7),(4,4),(0,0),(7,0))','((7,4),(0,7),(4,0),(0,4))','<(7,4),0>','192.168.7.40','08:00:2d:07:04:00',X'740');
  
! INSERT INTO table5(numcol,realcol,ptcol,pathcol,polycol,circcol,ipcol,maccol,bitcol) values ('93.1','9.31','(9,3)','((9,9),(3,3),(1,1),(9,1))','((9,3),(1,9),(3,1),(1,3))','<(9,3),1>','192.168.9.31','08:00:2d:09:03:01',X'931');
\ No newline at end of file
--- 3,8 ----
  INSERT INTO table2(table1_id,data) VALUES (1,'placeholder 1');
  INSERT INTO table2(table1_id,data) VALUES (2,'placeholder 2');
  
! INSERT INTO table4(numcol,realcol,ptcol,pathcol,polycol,circcol,ipcol,maccol,bitcol) values ('74.0','7.40','(7,4)','((7,7),(4,4),(0,0),(7,0))','((7,4),(0,7),(4,0),(0,4))','<(7,4),0>','192.168.7.40','08:00:2d:07:04:00',X'740');
  
! INSERT INTO table4(numcol,realcol,ptcol,pathcol,polycol,circcol,ipcol,maccol,bitcol) values ('93.1','9.31','(9,3)','((9,9),(3,3),(1,1),(9,1))','((9,3),(1,9),(3,1),(1,3))','<(9,3),1>','192.168.9.31','08:00:2d:09:03:01',X'931');
\ No newline at end of file

Index: init_add_tables.ik
===================================================================
RCS file: /home/cvsd/slony1/slony1-engine/tests/test1/init_add_tables.ik,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** init_add_tables.ik	4 Aug 2006 20:06:24 -0000	1.8
--- init_add_tables.ik	18 Apr 2007 15:03:51 -0000	1.9
***************
*** 2,16 ****
  set add table (id=2, set id=1, origin=1, fully qualified name = 'public.table2', key='table2_id_key');
  
- table add key (node id = 1, fully qualified name = 'public.table3');
- set add table (id=3, set id=1, origin=1, fully qualified name = 'public.table3', key = SERIAL);
- 
  try {
!    set add table (id=4, set id=1, origin=1, fully qualified name = 'public.table4', key = 'no_good_candidate_pk', comment='bad table - table 4');
  } on error {
!    echo 'Tried to replicate table4 with no good candidate PK - rejected';
  } on success {
!    echo 'Tried to replicate table4 with no good candidate PK - accepted';
     exit 1;
  }
  
! set add table (id=4, set id=1, origin=1, fully qualified name = 'public.table5', comment='a table of many types');
\ No newline at end of file
--- 2,13 ----
  set add table (id=2, set id=1, origin=1, fully qualified name = 'public.table2', key='table2_id_key');
  
  try {
!    set add table (id=3, set id=1, origin=1, fully qualified name = 'public.table3', key = 'no_good_candidate_pk', comment='bad table - table 3');
  } on error {
!    echo 'Tried to replicate table3 with no good candidate PK - rejected';
  } on success {
!    echo 'Tried to replicate table3 with no good candidate PK - accepted';
     exit 1;
  }
  
! set add table (id=4, set id=1, origin=1, fully qualified name = 'public.table4', comment='a table of many types');
\ No newline at end of file

Index: init_schema.sql
===================================================================
RCS file: /home/cvsd/slony1/slony1-engine/tests/test1/init_schema.sql,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** init_schema.sql	4 Aug 2006 20:06:24 -0000	1.5
--- init_schema.sql	18 Apr 2007 15:03:51 -0000	1.6
***************
*** 11,31 ****
  );
  
! CREATE TABLE table3(
!   id		SERIAL,
!   table2_id	INT4		REFERENCES table2(id)
! 					ON UPDATE SET NULL ON DELETE SET NULL,
!   mod_date	TIMESTAMPTZ	NOT NULL DEFAULT now(),
!   data		FLOAT		NOT NULL DEFAULT random()
!   CONSTRAINT table3_date_check	CHECK (mod_date <= now())
! ); 
! 
! create table table4 (
    id serial NOT NULL,
    id2 integer
  );
  
! create unique index no_good_candidate_pk on table4 (id, id2);
  
! create table table5 (
    id serial primary key,
    numcol numeric(12,4), -- 1.23
--- 11,22 ----
  );
  
! create table table3 (
    id serial NOT NULL,
    id2 integer
  );
  
! create unique index no_good_candidate_pk on table3 (id, id2);
  
! create table table4 (
    id serial primary key,
    numcol numeric(12,4), -- 1.23

Index: schema.diff
===================================================================
RCS file: /home/cvsd/slony1/slony1-engine/tests/test1/schema.diff,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** schema.diff	15 Nov 2005 21:25:33 -0000	1.3
--- schema.diff	18 Apr 2007 15:03:51 -0000	1.4
***************
*** 1,3 ****
  SELECT id,data FROM table1 ORDER BY id
  SELECT id,table1_id,data FROM table2 ORDER BY id
! SELECT id,table2_id,mod_date, data FROM table3 ORDER BY id
--- 1,3 ----
  SELECT id,data FROM table1 ORDER BY id
  SELECT id,table1_id,data FROM table2 ORDER BY id
! SELECT id,numcol,realcol,ptcol,pathcol,polycol,circcol,ipcol,maccol, bitcol from table4 order by id;



More information about the Slony1-commit mailing list