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

Re: Alternate data locations ?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Patrick Spinler <spinler(at)means(dot)net>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: Alternate data locations ?
Date: 2000-08-19 22:17:13
Message-ID: 7097.966723433@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugs
Patrick Spinler <spinler(at)means(dot)net> writes:
> $ export ARC_P_DAT_01="/home/httpd/data/arc_p_dat_01"
> $ initlocation initlocation $ARC_P_DAT_01
> <snip>
> initlocation is complete
> $ createdb -D $ARC_P_DAT_01 test
> ERROR:  The database path '/home/httpd/data/arc_p_dat_01' is invalid.
> This may be due to a character that is not allowed or because the chosen
> path isn't permitted for databases
> createdb: database creation failed
> $ sudo -u postgres ls -l $ARC_P_DAT_01
> total 4
> drwx------    2 postgres http_adm     4096 Aug 18 23:10 base

> So, everything looks okay.  Can anyone give me a hint what might be
> happening ?  What can I do to debug this ?

You can't do it that way unless you've compiled the backend with
ALLOW_ABSOLUTE_DBPATHS defined, which is not the default setup
(mainly because some people consider it a security hole).

The standard way is (having done the initlocation script):
  1. (Re) start the postmaster with ARC_P_DAT_01 defined in its
     environment --- notice that you did not define that path variable
     in the postmaster's environment, only the client's.
  2. Do the createdb with -D ARC_P_DAT_01 (no dollar sign).

The idea is that the set of allowed database locations is controlled
by the dbadmin via putting them into the postmaster's environment or
not.  I find this quite bogus myself, because the postmaster
environment will probably contain lots of things like $HOME that should
*not* be treated as database locations.  But presently that's the setup.

			regards, tom lane

In response to

pgsql-bugs by date

Next:From: ChrisDate: 2000-08-19 22:41:34
Subject: Large Object / libPQ : problem
Previous:From: Tom LaneDate: 2000-08-19 20:14:36
Subject: Re: Fw: PortalHeapMemoryFree error in OpenACS

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group