I want to use (or hack) the following library for unit testing PostgreSQL-based code: https://github.com/Microsoft/pgtester – this basicly starts a new server with data in temporary directory and runs all queries against it.
However, in my Linux system (Fedora 26 but quite probably other distributions as well), it cannot be used because it is difficult (or impossible) to run the server without root privileges. Namely, I am stuck at the point of creating Unix socket /var/run/postgresql/.s.PGSQL.6433
. The directory is, by default, writable only for postgres user. On my own machine, I can of course change the writing rights but for a general-use client-side tool, it would be nice to have solution that would run out of the box.
So, is it possible to start the postgresql server with pgctl
specifying the directory where to write the server unix socket? Or any other workaround?
Thanks.