finished draft postgres reader implementation