DRY up postgresql adapters.