

This is an alternate fork of the eRServer 1.2 code base, provided to the community for testing purposes. If
everything works out fine, and the Powers That Be approve, we can work on moving some of it to the main distribution.

It provides the following features:

Schema support for Postgresql 7.3+
Corrects the transaction rollover problem by emulating the backend transaction ID handling (thanks to Jan Wieck and Tom Lane)
New java-based setup scripts
	- org.postgresql.ers.ERSSetup
			replaces ers_setup
	- org.postgresql.ers.ERSAddTable
			replaces ers_addtable
			allows for multiple tables on the command line, or input from a file
			allows for custom naming of the _ers_uniq column
			creates indexes and PKs on slave target
			creates a table of FK constraints to be run on failover
	- org.postgresql.ers.ERSAddSlave
			replaces ers_addslave
	- org.postgresql.ers.ERSRemove
			replaces ers_remove
			removes eRServer from ALL slaves
			optionally strips the control column from tables on master and slave
	- org.postgresql.ers.ERSUpdate
			adds support for this fork to existing systems (NOT TESTED)
	- org.postgresql.ers.ERSCtl
			sends a signal to the running server
	- org.postgresql.ers.ERSExecSQL
			executes aribitrary sql on slaves and master

Embryonic support for built-in failover scripts
Fixes the ResultSet/Statement close() problem recently discussed on the list, allowing eRServer to be used
	with the newer JDBC drivers.

Running the java programs with no arguments will list options.

This has been MILDLY tested under the following conditions:
v7.3.4, with schema support
v7.3.4, without schema support
v7.2.4
v7.3.4, without schema support replicating to 7.2.4

MILDLY means I haven't really banged it around much. My current focus is on 7.4 only. I would consider this
code beta quality. It has not received extensive testing in all situations (this is what I'm hoping you will help with...).
So the usual warnings are in effect vis-a-vis production systems.

The update procedure doesn't do anything particularly invasive to an existing setup, so if you update an existing setup
and you decide to go back for whatever reason, it should be fine. It just creates a view, a procedure, and a table that can be
ignored/removed. If you are thinking of rolling back, you probably shouldn't enable schema support when you run ERSUpdate.


All the new code is released under the BSD license. Do with as you will, and it isn't my fault.

Prerequisites:

  JDK 1.2.2+ (Built with 1.4.1)
  Apache Commons CLI library (included with distribution)
  LOG4J (included, also comes with original distribution)
  GNU make

Build instructions

This is now a full installation package for erserver, and needs to be built.

After un-archiving, run configure with the needed options, make, and make install. At this point, everything should be ready to 
set up.

I've done most of the testing in OS X.

Installation instructions

Run the sql/xxid.sql script on the database that is to be replicated, i.e. 'psql <db> < xxid.sql'. This isn't done with the setup yet.
Run bin/ers_conf ERSSetup to set up erserver. 

Note for existing users: If you want/need to use this revision with an existing setup, you may either need to a) stop replication, and 
reinstall erserver (no, I didn't expect that to go over well), or stop replication and manually add the datatypes and recreate the
_rserv_log_?_ and _rserv_sync_ tables. Sorry, no other easy way. If you are a daring soul and want to do this get in touch and we
can walk through it. Or if many people want to do this, I'll write some sort of how-to.

Questions, comments, flames, etc. email to ronz@ravensfield.com, or post to the erserver-general list.


REVISIONS:

0.9.3	Added Jan Wieck's xxid data type from Slony-1 for use in _rserv_log_?_ and _rserv_sync_. Combined with some modifications
		to the backend, this eliminates the problem of erserver stopping when the transaction ID rolls past 2 billion (which it will
		do with the default datatype of int4), or when it rolls past the 4 billion mark (an unsigned int, which is what PG uses for 
		transaction ids) if you have changed the log ids to bigints.
		More code cleaning
		Started adding support for alternate schema for erserver to use (i.e. put all the support tables in schema ers or replic or 
		something instead of dumping everything in public). Not quite there yet, however. It is done in all the java code, but
		the triggers need some work to allow this.
		Added a small script (bin/ers_conf) to run the java setup scripts for java-phobes. You can run bin/ers_conf with the 'action'
		(the last part of the class name, e.g. ERSSetup or ERSAddTable) with arguments and it will deal with classpaths, etc.
		Updated the default postgresql.jar to 7.4. A 7.3 driver is also included for this wishing to use that.

0.9.2	Added scop's Log4J patches
		Can signal a reset to the running threads. ERSAddTable and ERSExecSQL do this when done, which allows the system
		to reset table and column caches on the next cycle.

0.9.1	Fixed existing column as unique problem
		Added RMI signaling structure
		Added ERSExecSQL
		Added ERSCtl
		modified ers_ctl script to use RMI shutdown signal

0.9		Initial release

