postgresql support and tests