pg/writer: fix formatting
support adding extra conditions on merge

Comes in handy in a few hairy situations. For example when you've had to
prune some records from one source table and another source table has a
foreign key to it. It's often easier to just look at what was pruned by
using an EXISTS clause (or similar) on the destination than trying to
replicate the pruning on the source side.
respect the order of the only_tables list

Provides an ad-hoc mechanism to specify table dependencies. Eventually this
should be done automatically by checking foreign keys (at either the source
or destination, preferably destination). This wil have to do for now.