Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search archives
  Advanced Search

ERROR: Postmaster environment variable 'PGDATA2' not set


  • From: Jean-Christophe Weis <jcweis(at)melix(dot)net>
  • To: pgsql-fr-generale(at)postgresql(dot)org
  • Subject: ERROR: Postmaster environment variable 'PGDATA2' not set
  • Date: Wed, 30 Jun 2004 20:47:26 +0200
  • Message-id: <20040630184726.GA3152@max.my.domain> <text/plain>

Salut la liste,

J'ai integre depuis peu le groupe de traduction de la documentation de
PostgreSQL.

Comme je ne comprenais pas la section 18.5 (Server Administration > Managing
Databases > Alternative Locations) que je dois traduire, j'ai voulu essayer
les manips, mais sans succes.

Mon probleme est le suivant:

J'ai une debian woody, <3.0r1>. Ma version de PostgreSQL est <7.2.1-2>.

J'ai cree un repertoire pour une nouvelle aire de stockage de donnees, dans
mon repertoire d'utilisateur lambda, avec les permissions qui vont bien:

| root# ls -ld /home/jc/         
| drwxr-xr-x   29 jc       jc           4096 Jun 29 19:18 /home/jc/
| root# ls -ld /home/jc/postgres
| drwx------    3 postgres postgres     4096 Jun 29 19:59 /home/jc/postgres/

Le serveur a l'arret, je definis et j'exporte une variable nommee PGDATA2:

| root# PGDATA2=/home/jc/postgres/data
| root# export PGDATA2

Je cree la nouvelle aire de stockage sous l'identite systeme postgres:

| root# su postgres
| postgres$ /usr/lib/postgresql/bin/initlocation PGDATA2
| The location will be initialized with username "postgres".
| This user will own all the files and must also own the server process.
| 
| Creating directory /home/jc/postgres/data
| Creating directory /home/jc/postgres/data/base
| 
| initlocation is complete.
| You can now create a database using
|   CREATE DATABASE <name> WITH LOCATION = 'PGDATA2'
| in SQL, or
|   createdb <name> -D 'PGDATA2'
| from the shell.

Apparemment tout va bien, je relance le serveur:

| postgres$ exit
| root# /etc/init.d/postgresql start
| ...

Mais quand j'essaie de creer une base de donnees dans la nouvelle aire sous
l'identite systeme postgres, ca ne marche pas:

| root# su postgres 
| postgres$ createdb testdb -D 'PGDATA2'
| ERROR:  Postmaster environment variable 'PGDATA2' not set
| createdb: database creation failed

| postgres$ createdb testdb -D PGDATA2 
| ERROR:  Postmaster environment variable 'PGDATA2' not set
| createdb: database creation failed

| postgres$ createdb testdb -D $PGDATA2
| ERROR:  Absolute paths are not allowed as database locations
| createdb: database creation failed

Le probleme semble etre que je n'arrive pas a passer la variable PGDATA2 dans
l'environnement du serveur... Pourtant je l'ai bien definie et exportee dans
le shell root d'ou je lance le serveur... Une idee?


Merci, JC Weis.



Home | Main Index | Thread Index

Privacy Policy | About PostgreSQL
Copyright © 1996 – 2012 PostgreSQL Global Development Group