Re: [PATCHES] contrib/dbmirror

2004-09-09 Thread Neil Conway
[EMAIL PROTECTED] wrote:
Here is a patch for dbmirror to be applied for the next beta.
I'll apply this within the next 24 hours, barring any objections.
-Neil
---(end of broadcast)---
TIP 9: the planner will ignore your desire to choose an index scan if your
 joining column's datatypes do not match


Re: [PATCHES] contrib/dbmirror

2004-09-09 Thread Neil Conway
On Sun, 2004-09-05 at 01:59, [EMAIL PROTECTED] wrote:
 Here is a patch for dbmirror to be applied for the next beta.

Patch applied -- thanks!

Note that one hunk was rejected, but it was misguided anyway (trying to
change a $PostgreSQL$ tag into an $Id$, as a result of a private CVS
tree I'd guess) -- so I applied the patch without that change.

-Neil



---(end of broadcast)---
TIP 9: the planner will ignore your desire to choose an index scan if your
  joining column's datatypes do not match


Re: [PATCHES] contrib/dbmirror

2004-07-10 Thread Jan Wieck
On 7/1/2004 12:39 AM, Tom Lane wrote:
Joe Conway [EMAIL PROTECTED] writes:
[EMAIL PROTECTED] wrote:
Attached is a 1 line bug fix for dbmirror that was submitted.
It fixes a bug where some transactions could be dropped when writing 
mirrored SQL statements to files.

I know that there were discussions regarding removing the replication 
contribs (rserv and dbmirror) prior to 7.5 release, but given that that 
has not happened yet, any objections to me applying this?
There was talk of removing rserv, because it's seriously obsolete and
not maintained, but I don't think the same argument applies to
dbmirror.  Patch away.
There was never any intention to remove them. They should be relocated 
to the pgfoundry. The reason for this is that up to today, people 
looking for replication solutions find rserv in contrib and waste time 
with it. Others try dbmirror and later on apply their results with 
trigger based replication to Slony and think must be slow.

dbmirror is well maintained, and I know that it can and will do things 
that Slony is not planned to do (like keyrange based partial 
replication). It should be kept, but from the past discussions we know 
that contrib is a location that makes a lot of people assume that those 
things are recommended, preferred or some such.

Jan
regards, tom lane
---(end of broadcast)---
TIP 9: the planner will ignore your desire to choose an index scan if your
  joining column's datatypes do not match

--
#==#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.  #
#== [EMAIL PROTECTED] #
---(end of broadcast)---
TIP 6: Have you searched our list archives?
  http://archives.postgresql.org


Re: [PATCHES] contrib/dbmirror

2004-07-01 Thread Joe Conway
[EMAIL PROTECTED] wrote:
Attached is a 1 line bug fix for dbmirror that was submitted.
It fixes a bug where some transactions could be dropped when writing 
mirrored SQL statements to files.

Patch applied.
Joe
---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]


[PATCHES] contrib/dbmirror

2004-06-30 Thread ssinger

Attached is a 1 line bug fix for dbmirror that was submitted.
It fixes a bug where some transactions could be dropped when writing 
mirrored SQL statements to files.



-- 
Steven Singer   [EMAIL PROTECTED]
Dispatch SystemsPhone:  519-747-1170 ext 282
Navtech Systems Support Inc.AFTN:   CYYZXNSX SITA: YYZNSCR
Waterloo, Ontario   ARINC:  YKFNSCR
Index: DBMirror.pl
===
RCS file: /projects/cvsroot/pgsql-server/contrib/dbmirror/DBMirror.pl,v
retrieving revision 1.9
diff -u -r1.9 DBMirror.pl
--- DBMirror.pl 22 Apr 2004 03:48:38 -  1.9
+++ DBMirror.pl 1 Jul 2004 01:31:27 -
@@ -249,6 +249,8 @@
   if($::slaveInfo-{'status'} eq 'FileOpen')
   {
  close ($::slaveInfo-{'TransactionFile'});
+  $::slaveInfo-{status} = 'FileClosed';
+
   }
   elsif($::slaveInfo-{'status'} eq 'DBOpen')
   {

---(end of broadcast)---
TIP 9: the planner will ignore your desire to choose an index scan if your
  joining column's datatypes do not match


Re: [PATCHES] contrib/dbmirror

2004-06-30 Thread Joe Conway
[EMAIL PROTECTED] wrote:
Attached is a 1 line bug fix for dbmirror that was submitted.
It fixes a bug where some transactions could be dropped when writing 
mirrored SQL statements to files.
I know that there were discussions regarding removing the replication 
contribs (rserv and dbmirror) prior to 7.5 release, but given that that 
has not happened yet, any objections to me applying this?

Joe
---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?
  http://www.postgresql.org/docs/faqs/FAQ.html


Re: [PATCHES] contrib/dbmirror typo fix

2004-05-25 Thread Jan Wieck
[EMAIL PROTECTED] wrote:
Please apply this minor patch to the cvs HEAD of dbmirror
It fixes a typo in a define
Thanks
Applied.
Jan



Index: pending.c
===
RCS file: /projects/cvsroot/pgsql-server/contrib/dbmirror/pending.c,v
retrieving revision 1.17
diff -u -r1.17 pending.c
--- pending.c	22 Apr 2004 03:48:38 -	1.17
+++ pending.c	24 May 2004 16:30:38 -
@@ -76,7 +76,7 @@
 #else
 #define debug_msg2(x,y) 
 #define debug_msg(x)
-#define debug_msg(x,y,z)
+#define debug_msg3(x,y,z)
 
 #endif
 


---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster

--
#==#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.  #
#== [EMAIL PROTECTED] #
---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
 subscribe-nomail command to [EMAIL PROTECTED] so that your
 message can get through to the mailing list cleanly


Re: [PATCHES] contrib/dbmirror typo fix

2004-05-25 Thread Bruce Momjian

Patch applied.  Thanks.

---


[EMAIL PROTECTED] wrote:
 
 Please apply this minor patch to the cvs HEAD of dbmirror
 
 It fixes a typo in a define
 
 Thanks
 
 
 -- 
 Steven Singer   [EMAIL PROTECTED]
 Dispatch SystemsPhone:  519-747-1170 ext 282
 Navtech Systems Support Inc.AFTN:   CYYZXNSX SITA: YYZNSCR
 Waterloo, Ontario   ARINC:  YKFNSCR

Content-Description: 

[ Attachment, skipping... ]

 
 ---(end of broadcast)---
 TIP 4: Don't 'kill -9' the postmaster

-- 
  Bruce Momjian|  http://candle.pha.pa.us
  [EMAIL PROTECTED]   |  (610) 359-1001
  +  If your life is a hard drive, |  13 Roberts Road
  +  Christ can be your backup.|  Newtown Square, Pennsylvania 19073

---(end of broadcast)---
TIP 8: explain analyze is your friend


[PATCHES] contrib/dbmirror typo fix

2004-05-24 Thread ssinger

Please apply this minor patch to the cvs HEAD of dbmirror

It fixes a typo in a define

Thanks


-- 
Steven Singer   [EMAIL PROTECTED]
Dispatch SystemsPhone:  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.17
diff -u -r1.17 pending.c
--- pending.c   22 Apr 2004 03:48:38 -  1.17
+++ pending.c   24 May 2004 16:30:38 -
@@ -76,7 +76,7 @@
 #else
 #define debug_msg2(x,y) 
 #define debug_msg(x)
-#define debug_msg(x,y,z)
+#define debug_msg3(x,y,z)
 
 #endif
 

---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster


Re: [PATCHES] contrib/dbmirror

2004-04-22 Thread Bruce Momjian

Patch applied.  Thanks.

Should this be backpatched to 7.4.X?  The patch didn't apply cleanly to
that CVS branch.

---


[EMAIL PROTECTED] wrote:
 
 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 SystemsPhone:  519-747-1170 ext 282
 Navtech Systems Support Inc.AFTN:   CYYZXNSX SITA: YYZNSCR
 Waterloo, Ontario   ARINC:  YKFNSCR

Content-Description: 

[ Attachment, skipping... ]

 
 ---(end of broadcast)---
 TIP 5: Have you checked our extensive FAQ?
 
http://www.postgresql.org/docs/faqs/FAQ.html

-- 
  Bruce Momjian|  http://candle.pha.pa.us
  [EMAIL PROTECTED]   |  (610) 359-1001
  +  If your life is a hard drive, |  13 Roberts Road
  +  Christ can be your backup.|  Newtown Square, Pennsylvania 19073

---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faqs/FAQ.html


Re: [PATCHES] contrib/dbmirror

2004-04-22 Thread ssinger
On Wed, 21 Apr 2004, Bruce Momjian wrote:

 
 Patch applied.  Thanks.
 
 Should this be backpatched to 7.4.X?  The patch didn't apply cleanly to
 that CVS branch.

No.  support for  sequences  was only  introduced onto the 7.5 
tree/head.  Same with the support for transaction files.


 
 ---
 
 
 [EMAIL PROTECTED] wrote:
  
  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 SystemsPhone:  519-747-1170 ext 282
  Navtech Systems Support Inc.AFTN:   CYYZXNSX SITA: YYZNSCR
  Waterloo, Ontario   ARINC:  YKFNSCR
 
 Content-Description: 
 
 [ Attachment, skipping... ]
 
  
  ---(end of broadcast)---
  TIP 5: Have you checked our extensive FAQ?
  
 http://www.postgresql.org/docs/faqs/FAQ.html
 
 

-- 
Steven Singer   [EMAIL PROTECTED]
Dispatch SystemsPhone:  519-747-1170 ext 282
Navtech Systems Support Inc.AFTN:   CYYZXNSX SITA: YYZNSCR
Waterloo, Ontario   ARINC:  YKFNSCR


---(end of broadcast)---
TIP 7: don't forget to increase your free space map settings


[PATCHES] contrib/dbmirror

2004-04-18 Thread ssinger

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 SystemsPhone:  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 -  1.16
+++ pending.c   18 Apr 2004 15:31:14 -
@@ -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 -  1.8
+++ DBMirror.pl 18 Apr 2004 15:31:14 -
@@ -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


Re: [PATCHES] contrib/dbmirror conditional replication

2003-11-29 Thread Joe Conway
Steven Singer wrote:
Downsides include that the code is kind of complicated, insert,updates and
deletes are much slower and a lot of extra information needs to be stored by
the mirroring system(see the accounting table).
I second this part.

I added a compile time flag to enable or disable this feature.

I think there's demand for conditional replication(because I've had other
requests for it) I'm just wondering if this is a good starting point?
I need conditional replication, but personally I'm not fond of the 
depends-on row chaining stuff. And I think there are simpler ways to get 
the conditional replication, but unfortunately I haven't had time to 
work on proving that yet, so I could be wrong ;-)

I don't think you'll get much feedback from dbmirror users on PATCHES -- 
it might be a good idea to solicit input on GENERAL or maybe the gborg 
replication list.

Joe

---(end of broadcast)---
TIP 6: Have you searched our list archives?
  http://archives.postgresql.org


[PATCHES] contrib/dbmirror 7.4 README update

2003-10-26 Thread Steven Singer

Here is an update to the dbmirror README file. 

-References to older versions of PostgreSQL have been removed(It no longer 
compiles against older versions)
-Added a link to PgPerl at GBorg.

Thanks

-- 
Steven Singer   [EMAIL PROTECTED]
Dispatch SystemsPhone:  519-747-1170 ext 282
Navtech Systems Support Inc.AFTN:   CYYZXNSX SITA: YYZNSCR
Waterloo, Ontario   ARINC:  YKFNSCR
Index: README.dbmirror
===
RCS file: /projects/cvsroot/pgsql-server/contrib/dbmirror/README.dbmirror,v
retrieving revision 1.6
diff -c -r1.6 README.dbmirror
*** README.dbmirror 29 Sep 2003 18:16:48 -  1.6
--- README.dbmirror 26 Oct 2003 21:10:01 -
***
*** 1,8 
! DBMirror - Postgres Database Mirroring
  ===
  
  
! DBMirror is a database mirroring system developed for the Postgres
  database Written and maintained by Steven Singer([EMAIL PROTECTED])
  
  
--- 1,8 
! DBMirror - PostgreSQL Database Mirroring
  ===
  
  
! DBMirror is a database mirroring system developed for the PostgreSQL
  database Written and maintained by Steven Singer([EMAIL PROTECTED])
  
  
***
*** 54,59 
--- 54,66 
  in the MirrorHost table) then all records of it are purged from the
  Pending tables.
  
+ Requirments:
+ -
+ -PostgreSQL-7.4 (Older versions are no longer supported)
+ -Perl 5.6(Other versions might work)
+ -PgPerl (http://gborg.postgresql.org/project/pgperl/projdisplay.php)
+ 
+ 
  Installation Instructions
  
  
***
*** 66,98 
  
  To build the trigger run  make on the Makefile in the DBMirror directory.
  
! Postgres-7.3  7.4  Make Instructions:
  
If you have already run configure in the pgsql-server directory 
then run make in the dbmirror directory to compile the trigger.
  
- Postgres-7.1  Postgres-7.2 Make Instructions:
- 
-   The included Makefile is not compatible with postgres 7.1 and 7.2
-   The trigger will need to be built by hand.
- 
-   Run the following commands
- 
-   gcc -fpic -I/usr/local/pgsql/include/server -c pending.c -DNOSCHEMAS -DNODROPCOLUMN
-   ld -shared -o pending.so pending.o
- 
-   Assuming the postgres include files are in /usr/local/pgsql/include/server.  
- 
- Postgres-7.1.x installations should change this to
- /usr/local/pgsql/include  (The server part is for 7.2+)
- 
- If you have installed the postgres include files to another location then
-   modify the include path to reflect this.
- 
-   Compiling the trigger by hand requires that all postgres headers be installed
-   ,this is accomplished in postgresql(7.1 or 7.2) by running 
-   make install-all-headers in the postgres source directory.
- 
  
  You should now have a file named pending.so that contains the trigger.
  
--- 73,83 
  
  To build the trigger run  make on the Makefile in the DBMirror directory.
  
! PostgreSQL-7.4  Make Instructions:
  
If you have already run configure in the pgsql-server directory 
then run make in the dbmirror directory to compile the trigger.
  
  
  You should now have a file named pending.so that contains the trigger.
  
***
*** 109,115 
  This file contains SQL commands to setup the Mirroring environment.  
  This includes
  
! -Telling Postgres about the recordchange trigger function.
  -Creating the Pending,PendingData, MirrorHost, MirroredTransaction tables
  
  
--- 94,100 
  This file contains SQL commands to setup the Mirroring environment.  
  This includes
  
! -Telling PostgreSQL about the recordchange trigger function.
  -Creating the Pending,PendingData, MirrorHost, MirroredTransaction tables
  
  
***
*** 120,134 
  where MyDatabaseName is the name of the database you wish to install mirroring
  on(Your master).
  
- Postgres-7.1 and 7.2 Notes:
-   -The syntax for creating a trigger function changed in Postgres-7.3. 
-   Change the line in MirrorSetup.sql from 
- 
-   CREATE FUNCTION recordchange () RETURNS trigger AS
- 
-   to 
-   CREATE FUNCTION recordchange () RETURNS OPAQUE AS
- 
  
  3) Create slaveDatabase.conf files.
  
--- 105,110 
***
*** 185,192 
  
  DBMirror.pl is the perl script that handles the mirroring.  
  
! It requires the Perl library Pg(See src/interfaces/perl5 in the postgres 
! source distribution).
  
  It takes its configuration file as an argument(The one from step 3)
  One instance of DBMirror.pl runs for each slave machine that is receiving
--- 161,167 
  
  DBMirror.pl is the perl script that handles the mirroring.  
  
! It requires the Perl library Pg(See 
http://gborg.postgresql.org/project/pgperl/projdisplay.php)
  
  It takes its configuration file as an 

Re: [PATCHES] contrib/dbmirror patch

2003-09-26 Thread Bruce Momjian

Your patch has been added to the PostgreSQL unapplied patches list at:

http://momjian.postgresql.org/cgi-bin/pgpatches

I will try to apply it within the next 48 hours.

---


Steven Singer wrote:
 
 Attatched is a patch for contrib/dbmirror that should be applied against 
 the 7.4 tree
 
 A) Fixes a bug that prevented mirroring of data on a table that has had a 
 column dropped.
 B) Updated the documentation for the 7.4 release.
 
 
 Thanks
 
 -- 
 Steven Singer   [EMAIL PROTECTED]
 Dispatch SystemsPhone:  519-747-1170 ext 282
 Navtech Systems Support Inc.AFTN:   CYYZXNSX SITA: YYZNSCR
 Waterloo, Ontario   ARINC:  YKFNSCR

Content-Description: 

[ Attachment, skipping... ]

 
 ---(end of broadcast)---
 TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

-- 
  Bruce Momjian|  http://candle.pha.pa.us
  [EMAIL PROTECTED]   |  (610) 359-1001
  +  If your life is a hard drive, |  13 Roberts Road
  +  Christ can be your backup.|  Newtown Square, Pennsylvania 19073

---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster