bruzen/modex — pull request #7 by kousu (2014-07-18 00:12:14+00:00)
Title: Databased

These refactorings should help you follow along easier.

----

Also, I don't know if this will work on your system, but to demo, in one window:
```
$ ./server.sh
```

Then, set wal_level = hot_standby in data/postgresql.conf,
Then, run
```
$ python replicant.py
```

It should print out some handshaking messages and then drop you into a shell, while still processing messages in the background. If it gives you no errors and ./server.sh doesn't complain about anything (it might need more .conf babying than I remember at the moment) you can wait a minute or two and start seeing keepalives pinging back and forth.

Then, if in a third window you do
```
$ ./client.sh
psql (9.3.4)
Type "help" for help.

postgres=# create table t1(i int, j float);
CREATE TABLE
postgres=#
```

and this will trigger a big dump of opaque binary which I [believe is a chain of these](http://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/include/access/xlog.h).