Re: Multiple databases on seperate drives/file systems? - Mailing list pgsql-general

From Scot L. Harris
Subject Re: Multiple databases on seperate drives/file systems?
Date
Msg-id 1086788709.20203.8.camel@lathe
Whole thread Raw
In response to Re: Multiple databases on seperate drives/file systems?  (jseymour@linxnet.com (Jim Seymour))
Responses Re: Multiple databases on seperate drives/file systems?  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Multiple databases on seperate drives/file systems?  (jseymour@linxnet.com (Jim Seymour))
List pgsql-general
On Tue, 2004-06-08 at 17:01, Jim Seymour wrote:
> Perhaps the man pages are screwed-up?
>
> $ man createdb
> [snip]
>      -D location
>
>      --location location
>           Specifies the alternative location  for  the  database.
>           See also initlocation(1).
>
> $ man initlocation
> [snip]
> EXAMPLES
>      To create a database in  an  alternate  location,  using  an
>      environment variable:
>
>      $ export PGDATA2=/opt/postgres/data
>
>      Stop and start postmaster so it sees the PGDATA2 environment
>      variable.  The  system  must be configured so the postmaster
>      sees PGDATA2 every time it starts. Finally:
>
>      $ initlocation PGDATA2
>      $ createdb -D PGDATA2 testdb
>
>
>      Alternatively, if you allow absolute paths you could write:
>
>      $ initlocation /opt/postgres/data
>      $ createdb -D /opt/postgres/data/testdb testdb
>
> >From this I gather that what they *mean*, for the initlocation and
> createdb commands, is $PGDATA2.  (Note the "$".)
>
> Jim

I started trying this using the man pages instructions.  With the $
included I get the following results:

-bash-2.05b$ createdb -D $PGDATA2 testdb3
ERROR:  Absolute paths are not allowed as database locations
createdb: database creation failed

Without the $ I get the following:

-bash-2.05b$ createdb -D PGDATA2 testdb3
ERROR:  Postmaster environment variable 'PGDATA2' not set
createdb: database creation failed
-bash-2.05b$ echo $PGDATA2
/vhost/database/data

Which indicates to me that the PGDATA2 environment variable that is
defined in the postgres users .bash_profile is not being picked up by
the postmaster process.  Which I have restarted numerous times in an
effort to get it to pick that variable up.

I am beginning to suspect that I would have to find a way to add the
PGDATA2 variable to the startup script for postgresql.  Which the docs I
have read so far do not indicate as being required.

Any more ideas before I have to go hacking on the startup script?

--
Scot L. Harris
webid@cfl.rr.com

Real computer scientists don't comment their code.  The identifiers are
so long they can't afford the disk space.


pgsql-general by date:

Previous
From: Doug McNaught
Date:
Subject: Re: GRANTing privileges to a plpgsql function doesn't
Next
From:
Date:
Subject: Re: Prevent users from creating tables