External postgres

This addresses #1306.