[postgis-devel] run_test and PostgreSQL user

Mark Cave-Ayland mark.cave-ayland at siriusit.co.uk
Thu Mar 19 06:17:11 PDT 2009


Courtin Olivier wrote:

> Hi,
> 
> When i play with make check (or only run_test on a single unit test), i 
> must
> launch the process as a postgres system user, something like:
> 
> $ sudo su postgres -c "./run_test  a_test"
> 
> 
> As i configure pg_hba.conf with postgres user with trust
> authentification mode, i don't feel this so practical.
> 
> Below a patch to add the ability to specify a PG_USER
> in run_test.
> 
> Thoughts, reactions ?


Hi Olivier,

Specifying the default user for any libpq application can be done using 
the environment variable PGUSER like this:

PGUSER=postgres ./run_test a_test

Then again, I don't recommend running PostgreSQL as the postgres user 
for development purposes, since it's a pain to keep switching users. 
It's far better to install everything into a single home directory and 
then configure .bash_profile to set any default ports/users if required.


HTH,

Mark.

-- 
Mark Cave-Ayland - Senior Technical Architect
PostgreSQL - PostGIS
Sirius Corporation plc - control through freedom
http://www.siriusit.co.uk
t: +44 870 608 0063



More information about the postgis-devel mailing list