Postgres master

**NOT INTENDED FOR MERGE, JUST DISCUSSION**

@jennyd and I are going to sit down and talk this through face-to-face, but other comments (particularly from @issyl0 and @fatbusinessman) should go here. We're aiming for merge tomorrow prior to postgres transition on Tuesday 28th.