=head1 NAME pg_virtualenv - Create a throw-away PostgreSQL environment for running regression tests =head1 SYNOPSIS B [I] [B<-v> 'I'] [I] =head1 DESCRIPTION B creates a virtual PostgreSQL server environment, and sets environment variables such that I can access the PostgreSQL database server(s). The servers are destroyed when I exits. The environment variables B, B, B, and B will be set. Per default, a single new cluster is created, using the newest PostgreSQL server version installed. The cluster will use the first available port number starting from B<5432>, and B will be set. When clusters for more than one versions are created, they will differ in the port number used, and B is not set. The clusters are named I/regress. To access a cluster, set BIB. For ease of access, the clusters are also registered in F, with the version number as cluster name. Clusters can be accessed by passing the connection string "BI", e.g. B. When invoked as root, the clusters are created in F as usual; for other users, B and B are set to a temporary directory where all files belonging to the clusters are created. =head1 OPTIONS =over 4 =item B<-a> Use all PostgreSQL server versions installed. =item B<-v> I Use these versions (space-separated list). =item B<-c> I Extra options to pass to B. =item B<-i> I Extra initdb options to pass to B. =item B<-o> IB<=>I Configuration option to set in the C file, passed to B. =item B<-s> Launch a shell inside the virtual environment when I fails. =item B<-t> Install clusters in a temporary directory, even when running as root. =item B<-h> Show program help. =back =head1 EXAMPLE # pg_virtualenv make check =head1 NOTES When run with fakeroot(1), B will fall back to the non-root mode of operation. Running "fakeroot pg_virtualenv" as root will fail, though. =head1 ENVIRONMENT =over 4 =item B=yes When non-empty, B will re-exec itself using newpid(1). =item B=I When non-empty, B will re-exec itself using unshare(1) using these flags. =item B=I When set, the value is used for the (single) cluster created. =back =head1 SEE ALSO initdb(1), pg_createcluster(1). =head1 AUTHOR Christoph Berg Lmyon@debian.orgE>