postgres: use connection pool

Previously this was always using only a single connection to postgres, now it will use a connection pool (which is built into the `pg` library)