Thu Jul 28 19:49:48 PDT 2005
- Previous message: [Slony1-general] pgbench error : "branches" does not exist
- Next message: [Slony1-general] About SlonyI handle chinese Question
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I discovered yesterday that a couple of changes were needed to this
patch to accomodate log shipping...
1. Change to remote_worker.c
(I don't have a reasonable "diff of a diff"; this should be clear
enough, particularly as it's only a few lines of change)
@@ -2778,7 +2810,10 @@
if (archive_dir) {
slon_log(SLON_DEBUG4, "start log ship copy of %s\n",
tab_fqname);
slon_mkquery(&query1,
- "delete from %s;copy %s from stdin;", tab_fqname,
tab_fqname);
+ "select %s.disableSubscriptionIndexes('%s'); "
+ "delete from %s; "
+ "copy %s from stdin;",
+ rtcfg_namespace, tab_fqname, tab_fqname, tab_fqname);
rc = submit_query_to_archive(&query1);
if (rc < 0) {
slon_log(SLON_ERROR, "remoteWorkerThread_d: "
2. Need enable/disableSubscriptionIndexes() in the initial dump...
RCS file: /usr/local/cvsroot/slony1/slony1-engine/tools/slony1_dump.sh,v
retrieving revision 1.1
diff -c -u -r1.1 slony1_dump.sh
cvs diff: conflicting specifications of output style
--- slony1_dump.sh 17 Feb 2005 06:59:05 -0000 1.1
+++ slony1_dump.sh 28 Jul 2005 18:47:38 -0000
@@ -155,6 +155,48 @@
end;
' language plpgsql;
+create or replace function $clname.disableSubscriptionIndexes(text)
+returns bigint
+as '
+declare
+ p_fqname alias for \$1;
+begin
+ update pg_catalog.pg_class set relhasindex = ''f'' from
$clname.sl_table
+ where pg_catalog.pg_class.oid =
$clname.sl_table.tab_reloid
+ and $clname.slon_quote_input(''"'' ||
$clname.sl_table.tab_nspname || ''"."'' || $clname.sl_table.tab_relname
|| ''"'') = ''p_fqname'';
+ return 1;
+end;
+' language plpgsql;
+
+create or replace function $clname.enableSubscriptionIndexes(text)
+returns bigint
+as '
+declare
+ p_fqname alias for \$1;
+begin
+ update pg_catalog.pg_class set relhasindex = ''t'' from
$clname.sl_table
+ where pg_catalog.pg_class.oid = $clname.sl_table.tab_reloid
+ and $clname.slon_quote_input(''"'' ||
$clname.sl_table.tab_nspname || ''"."'' || $clname.sl_table.tab_relname
|| ''"'') = ''p_fqname'';
+ return 1;
+end;
+' language plpgsql;
+
+create or replace function $clname.maintenance_work_mem(text)
+returns text
+as '
+declare
+ p_maintenance_work_mem alias for \$1;
+ v_old_maintenance_work_mem text;
+begin
+ select current_setting(''vacuum_mem'') into
v_old_maintenance_work_mem;
+ if p_maintenance_work_mem > 0 then
+ perform set_config(''vacuum_mem'',p_maintenance_work_mem,''t'');
+ end if;
+ return v_old_maintenance_work_mem;
+end;
+' language plpgsql;
+
+
_EOF_
- Previous message: [Slony1-general] pgbench error : "branches" does not exist
- Next message: [Slony1-general] About SlonyI handle chinese Question
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Slony1-general mailing list