CVS User Account cvsuser
Wed Apr 13 21:10:07 PDT 2005
Log Message:
-----------
Cleaned up the quoting-name example, adding in some similarly
"evilly quoted" sequences

Modified Files:
--------------
    slony1-engine/src/ducttape:
        test_A_namequoting (r1.1 -> r1.2)

-------------- next part --------------
Index: test_A_namequoting
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/src/ducttape/test_A_namequoting,v
retrieving revision 1.1
retrieving revision 1.2
diff -Lsrc/ducttape/test_A_namequoting -Lsrc/ducttape/test_A_namequoting -u -w -r1.1 -r1.2
--- src/ducttape/test_A_namequoting
+++ src/ducttape/test_A_namequoting
@@ -21,6 +21,7 @@
 TMPOUT=/tmp/output.$$
 SLONCONF1=/tmp/slon_config_node1.$$
 SLONCONF2=/tmp/slon_config_node2.$$
+SCHEMADUMP=/tmp/schema_dump.sql.$$
 DB1=slony_test1
 DB2=slony_test2
 DEBUG_LEVEL=2
@@ -90,6 +91,7 @@
 createdb $DB1 || exit 1
 psql $DB1 <<_EOF_
 create schema "Schema.name";
+create schema "Studly Spacey Schema";
 create table "Schema.name"."user" (
   id integer,
   "user" text not null unique,
@@ -108,9 +110,12 @@
   "eViL StudlyCaps.column" text
 );
 create unique index "user" on public.evil_index_table(id);
+create sequence public."Evil Spacey Sequence Name";
+create sequence "Studly Spacey Schema"."user";
+create sequence "Schema.name"."a.periodic.sequence";
 _EOF_
 
-pg_dump -s $DB1 >pgbench_schema.sql
+pg_dump -s $DB1 >$SCHEMADUMP
 
 echo ""
 echo "**********************************************************************"
@@ -120,7 +125,7 @@
 
 ######################################################################
 # Setup DB1 as the primary cluster T1 node, start the node daemon,
-# and create a replication set containing the pgbench tables.
+# and create a replication set containing the tables and sequences
 ######################################################################
 
 echo "**** initializing $DB1 as Primary Node for Slony-I cluster T1"
@@ -129,10 +134,6 @@
 	init cluster (id = @origin, comment = 'Node @origin');
 	echo 'Database $DB1 initialized as Node 11';
 _EOF_
-if [ $? -ne 0 ] ; then
-	kill $pgbench_pid;
-	exit 1
-fi
 
 echo "log_level=$DEBUG_LEVEL" > $SLONCONF1
 echo "sync_group_maxsize=10" >> $SLONCONF1
@@ -146,7 +147,7 @@
 slon1_pid=$!
 echo "slon[$slon1_pid] on dbname=$DB1"
 
-echo "**** creating a replication set containing the 4 pgbench tables ... "
+echo "**** creating a replication set containing the various dangerously named tables ... "
 slonik <<_EOF_
 	include <$PREAMBLE_FILE>;
 	try {
@@ -161,6 +162,12 @@
 		set add table (set id = 1, origin = @origin,
 			id = 3, fully qualified name = '"Schema.name"."Capital Idea"',
 			comment = 'Table with spaces in its name, caps, and a user field as PK');
+		set add sequence (set id = 1, origin = @origin,
+			id = 1, fully qualified name = 'public."Evil Spacey Sequence Name"');
+		set add sequence (set id = 1, origin = @origin,
+			id = 2, fully qualified name = '"Studly Spacey Schema"."user"');
+		set add sequence (set id = 1, origin = @origin,
+			id = 3, fully qualified name = '"Schema.name"."a.periodic.sequence"');
 	}
 	on error {
 		exit 1;
@@ -184,7 +191,7 @@
 
 ######################################################################
 # Setup DB2 as a subscriber node and let it subscribe the replication
-# set of the running pgbench
+# set
 ######################################################################
 echo "**** creating database for node 22"
 if ! createdb $DB2 ; then
@@ -213,7 +220,6 @@
 	echo 'Database $DB2 added as node @sub1';
 _EOF_
 if [ $? -ne 0 ] ; then
-	kill $pgbench_pid 2>/dev/null
 	kill $slon1_pid 2>/dev/null
 	exit 1
 fi
@@ -235,9 +241,9 @@
 # And now comes the moment where the big elephant starts to pee
 # and the attendants in the first row climb on their chairs ...
 ######################################################################
-echo "**** creating pgbench tables and subscribing node 22 to set 1"
+echo "**** creating dangerously-named tables and subscribing node 22 to set 1"
 (
-	cat pgbench_schema.sql
+	cat $SCHEMADUMP
 ) | psql -q $DB2
 slonik <<_EOF_
 	include <$PREAMBLE_FILE>;
@@ -300,4 +306,4 @@
 else
 	echo "FAILED - see test_1.diff for database differences"
 fi
-rm $PREAMBLE_FILE $SLONCONF1 $SLONCONF2
+rm $PREAMBLE_FILE $SLONCONF1 $SLONCONF2 $SCHEMADUMP


More information about the Slony1-commit mailing list