Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Blog | Linux Links | Bling | About BLU

BLU Discuss list archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

convincing Debian PostgreSQL 7.4 to use alternative locations



According to the PostgreSQL documentation 
(http://www.postgresql.org/docs/7.4/interactive/app-initlocation.html), 
you can use an "initlocation" command to prepare an alternative location 
for PostgreSQL data files, and then use the -D option on createdb to 
establish a database in that location.  (Meanwhile, all the other 
databases are still accessible from /var/lib/postgres/data or whatever 
the default location is.)

If the location you give with these commands doesn't have any slashes, 
then the postmaster looks for an environment variable of the same 
name--i.e., "initlocation PGDATA2" will create an alternative location 
at the path referred to by $PGDATA2 in the postmaster process's environment.

I'm trying to use this feature to put a database on a RAM disk, but I 
keep getting an "environment variable PGDATA2 not set" error.

When I Google for this error message, I get some mail archives of 
messages suggesting that I set the variable in the postgres user's 
.profile, or export it in the startup script, or set it in the 
postgresql.env configuration file.  I've done each of these things, and 
I still get the error.  And this configuration of PostgreSQL is not 
letting me pass explicit path names to the -D option, so I'm stuck.

This is on Debian sarge, postgresql package version 7.4.7-6sarge1, on a 
Dell i686 server running Linux kernel 2.6.15 SMP.




BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org