Attached is are a few small fixes for dbmirror.
1. Fixed bug where sequences were being mirrored incorrectly if they
exceeded 127
2. Fixed a bug in the perl script with mirroring sequences(John
Burtenshaw sent an email to patches describing the bug in March but I
htink he forgot to attach his patch)
3. The dates/times in the transaction files will always use 2 digits.
--
Steven Singer [EMAIL PROTECTED]
Dispatch Systems Phone: 519-747-1170 ext 282
Navtech Systems Support Inc. AFTN: CYYZXNSX SITA: YYZNSCR
Waterloo, Ontario ARINC: YKFNSCR
Index: pending.c
===================================================================
RCS file: /projects/cvsroot/pgsql-server/contrib/dbmirror/pending.c,v
retrieving revision 1.16
diff -u -w -r1.16 pending.c
--- pending.c 17 Feb 2004 03:34:35 -0000 1.16
+++ pending.c 18 Apr 2004 15:31:14 -0000
@@ -701,7 +701,7 @@
debug_msg("dbmirror:nextval Set resTuple");
- nextSequenceValue =*(DatumGetPointer(SPI_getbinval(resTuple,
+ nextSequenceValue =* (unsigned int *)(DatumGetPointer(SPI_getbinval(resTuple,
SPI_tuptable->tupdesc,
1,&isNull)));
Index: DBMirror.pl
===================================================================
RCS file: /projects/cvsroot/pgsql-server/contrib/dbmirror/DBMirror.pl,v
retrieving revision 1.8
diff -u -w -r1.8 DBMirror.pl
--- DBMirror.pl 17 Feb 2004 03:34:35 -0000 1.8
+++ DBMirror.pl 18 Apr 2004 15:31:14 -0000
@@ -660,7 +660,7 @@
my $query;
my $sequenceValue = $pendingResult->getvalue($currentTuple,4);
- $query = sprintf("select setval(%s,%s)",$sequenceName,$sequenceValue);
+ $query = sprintf("select setval('%s',%s)",$sequenceName,$sequenceValue);
sendQueryToSlaves($transId,$query);
return $currentTuple;
@@ -960,7 +960,7 @@
my $nowisdst;
($nowsec,$nowmin,$nowhour,$nowmday,$nowmon,$nowyear,$nowwday,$nowyday,$nowisdst) =
localtime;
- my $fileName=sprintf(">%s/%s_%d-%d-%d_%d:%d:%dXID%d.sql",
$::slaveInfo->{'TransactionFileDirectory'},
+ my $fileName=sprintf(">%s/%s_%02d-%02d-%02d_%02d:%02d:%dXID%d.sql",
$::slaveInfo->{'TransactionFileDirectory'},
$::slaveInfo->{"MirrorHostId"},($nowyear+1900),($nowmon+1),$nowmday,$nowhour,$nowmin,
$nowsec,$XID);
---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?
http://www.postgresql.org/docs/faqs/FAQ.html