Chris Browne cbbrowne at lists.slony.info
Thu Jun 11 12:03:47 PDT 2009
Update of /home/cvsd/slony1/slony1-engine/tests/testschemanames
In directory main.slony.info:/tmp/cvs-serv5001/tests/testschemanames

Modified Files:
	README gen_weak_user.sh generate_dml.sh init_add_tables.ik 
	init_data.sql init_schema.sql schema.diff 
Log Message:
Draw a whole pile of changes into HEAD from the 2.0 branch


Index: init_add_tables.ik
===================================================================
RCS file: /home/cvsd/slony1/slony1-engine/tests/testschemanames/init_add_tables.ik,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** init_add_tables.ik	18 Apr 2007 19:26:54 -0000	1.2
--- init_add_tables.ik	11 Jun 2009 19:03:45 -0000	1.3
***************
*** 1,5 ****
! set add table (id=1, set id=1, origin=1, fully qualified name = 'public.table1', comment='accounts table');
! set add table (id=2, set id=1, origin=1, fully qualified name = 'public.table2', key='table2_id_key');
! set add table (id=3, set id=1, origin=1, fully qualified name = 'public.table3');
  
  set add table (set id = 1, origin = 1, id = 6, fully qualified name =
--- 1,5 ----
! set add table (id=1, set id=1, origin=1, fully qualified name = 'foo.table1', comment='accounts table');
! set add table (id=2, set id=1, origin=1, fully qualified name = 'foo.table2', key='table2_id_key');
! set add table (id=3, set id=1, origin=1, fully qualified name = 'foo.table3');
  
  set add table (set id = 1, origin = 1, id = 6, fully qualified name =

Index: gen_weak_user.sh
===================================================================
RCS file: /home/cvsd/slony1/slony1-engine/tests/testschemanames/gen_weak_user.sh,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** gen_weak_user.sh	1 Mar 2007 21:02:32 -0000	1.1
--- gen_weak_user.sh	11 Jun 2009 19:03:45 -0000	1.2
***************
*** 1,7 ****
  weakuser=$1;
  
  for i in 1 2 3; do
!    echo "grant select on table public.table${i} to ${weakuser};"
!    echo "grant select on table public.table${i}_id_seq to ${weakuser};"
  done
  
--- 1,8 ----
  weakuser=$1;
+ echo "grant usage on schema \"foo\" to ${weakuser};"
  
  for i in 1 2 3; do
!    echo "grant select on table foo.table${i} to ${weakuser};"
!    echo "grant select on table foo.table${i}_id_seq to ${weakuser};"
  done
  

Index: generate_dml.sh
===================================================================
RCS file: /home/cvsd/slony1/slony1-engine/tests/testschemanames/generate_dml.sh,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** generate_dml.sh	2 Apr 2007 18:52:19 -0000	1.5
--- generate_dml.sh	11 Jun 2009 19:03:45 -0000	1.6
***************
*** 40,46 ****
      txtb=$(random_string ${txtblen})
      txtb=`echo ${txtb} | sed -e "s/\\\\\\\/\\\\\\\\\\\\\\/g" -e "s/'/''/g"`
!     echo "INSERT INTO table1(data) VALUES ('${txta}');" >> $GENDATA
!     echo "INSERT INTO table2(table1_id,data) SELECT id, '${txtb}' FROM table1 WHERE data='${txta}';" >> $GENDATA
!     echo "INSERT INTO table3(table2_id) SELECT id FROM table2 WHERE data ='${txtb}';" >> $GENDATA
      echo "INSERT INTO \"Schema.name\".\"Capital Idea\" (\"user\", description) values ('${txta}', '${txtb}');" >> $GENDATA
      echo "INSERT INTO \"Schema.name\".\"user\" (\"user\", id) values ('${txtb}', $txtblen);" >> $GENDATA
--- 40,46 ----
      txtb=$(random_string ${txtblen})
      txtb=`echo ${txtb} | sed -e "s/\\\\\\\/\\\\\\\\\\\\\\/g" -e "s/'/''/g"`
!     echo "INSERT INTO foo.table1(data) VALUES ('${txta}');" >> $GENDATA
!     echo "INSERT INTO foo.table2(table1_id,data) SELECT id, '${txtb}' FROM table1 WHERE data='${txta}';" >> $GENDATA
!     echo "INSERT INTO foo.table3(table2_id) SELECT id FROM table2 WHERE data ='${txtb}';" >> $GENDATA
      echo "INSERT INTO \"Schema.name\".\"Capital Idea\" (\"user\", description) values ('${txta}', '${txtb}');" >> $GENDATA
      echo "INSERT INTO \"Schema.name\".\"user\" (\"user\", id) values ('${txtb}', $txtblen);" >> $GENDATA

Index: init_data.sql
===================================================================
RCS file: /home/cvsd/slony1/slony1-engine/tests/testschemanames/init_data.sql,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** init_data.sql	15 Nov 2005 21:25:34 -0000	1.1
--- init_data.sql	11 Jun 2009 19:03:45 -0000	1.2
***************
*** 1,3 ****
! INSERT INTO table1(data) VALUES ('placeholder 1');
! INSERT INTO table2(table1_id,data) VALUES (1,'placeholder 1');
! INSERT INTO table3(table2_id) VALUES (1);
--- 1,4 ----
! set search_path to foo;
! INSERT INTO foo.table1(data) VALUES ('placeholder 1');
! INSERT INTO foo.table2(table1_id,data) VALUES (1,'placeholder 1');
! INSERT INTO foo.table3(table2_id) VALUES (1);

Index: init_schema.sql
===================================================================
RCS file: /home/cvsd/slony1/slony1-engine/tests/testschemanames/init_schema.sql,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** init_schema.sql	18 Apr 2007 19:26:54 -0000	1.2
--- init_schema.sql	11 Jun 2009 19:03:45 -0000	1.3
***************
*** 1,8 ****
! CREATE TABLE table1(
    id		SERIAL		PRIMARY KEY, 
    data		TEXT
  );
  
! CREATE TABLE table2(
    id		SERIAL		UNIQUE NOT NULL, 
    table1_id	INT4		REFERENCES table1(id) 
--- 1,11 ----
! create schema foo;
! set search_path to foo;
! drop schema public;
! CREATE TABLE foo.table1(
    id		SERIAL		PRIMARY KEY, 
    data		TEXT
  );
  
! CREATE TABLE foo.table2(
    id		SERIAL		UNIQUE NOT NULL, 
    table1_id	INT4		REFERENCES table1(id) 
***************
*** 11,15 ****
  );
  
! CREATE TABLE table3(
    id		SERIAL,
    table2_id	INT4		REFERENCES table2(id)
--- 14,18 ----
  );
  
! CREATE TABLE foo.table3(
    id		SERIAL,
    table2_id	INT4		REFERENCES table2(id)

Index: schema.diff
===================================================================
RCS file: /home/cvsd/slony1/slony1-engine/tests/testschemanames/schema.diff,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** schema.diff	15 Nov 2005 21:25:34 -0000	1.1
--- schema.diff	11 Jun 2009 19:03:45 -0000	1.2
***************
*** 1,7 ****
! 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
  SELECT id, "user" from "Schema.name"."user" order by id
  SELECT "user", description from "Schema.name"."Capital Idea" order by "user"
  select last_value from "Studly Spacey Schema"."user"
! select last_value from "Schema.name"."a.periodic.sequence"
\ No newline at end of file
--- 1,7 ----
! SELECT id,data FROM foo.table1 ORDER BY id
! SELECT id,table1_id,data FROM foo.table2 ORDER BY id
! SELECT id,table2_id,mod_date, data FROM foo.table3 ORDER BY id
  SELECT id, "user" from "Schema.name"."user" order by id
  SELECT "user", description from "Schema.name"."Capital Idea" order by "user"
  select last_value from "Studly Spacey Schema"."user"
! select last_value from "Schema.name"."a.periodic.sequence"

Index: README
===================================================================
RCS file: /home/cvsd/slony1/slony1-engine/tests/testschemanames/README,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** README	15 Nov 2005 21:25:34 -0000	1.1
--- README	11 Jun 2009 19:03:45 -0000	1.2
***************
*** 3,4 ****
--- 3,8 ----
  This test involves creating tables and sequences in namespaces with
  some wacky names, with StudlyCaps, spaces, and ".".
+ 
+ It drops the "public" schema, using schema "foo" instead.  This
+ validates that we can operate without there being a "public"
+ schema.



More information about the Slony1-commit mailing list