Re: initlocation and createdb - Mailing list pgsql-general

From Ed Loehr
Subject Re: initlocation and createdb
Date
Msg-id 3946A706.D8512D94@austin.rr.com
Whole thread Raw
In response to initlocation and createdb  ("Barnes" <aardvark@ibm.net>)
Responses RE: initlocation and createdb  ("Barnes" <aardvark@ibm.net>)
List pgsql-general
Ed Loehr wrote:
>
> Ed Loehr wrote:
> >
> > Barnes wrote:
> > >
> > > I'm having trouble setting up databases in a new location.  In particular, I
> > > do the following:
> > >
> > > [postgres@whopper pgdata]$ export PGDATA2=/home/pgdata
> > > [postgres@whopper pgdata]$ initlocation PGDATA2
> > > [postgres@whopper pgdata]$ createdb optodb -D 'PGDATA2'
> > > ERROR:  The database path 'PGDATA2' 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
> > > [postgres@whopper pgdata]$
> > >
> > > What am I doing wrong?  Is /home not permitted for databases?  If so, why
> > > not, and what is permitted?
>
> Looking at the documentation, David is apparently following this one,
> which seems wrong...
>
>         http://www.postgresql.org/docs/postgres/app-initlocation.htm
>
> Seems like it should be updated to the following:
>
> $ export PGDATA2=/opt/postgres/data
> $ initlocation $PGDATA2
> $ createdb testdb -D $PGDATA2

From the same page:  "If the argument does not contain a slash and is not
valid as a path, it is assumed to be an environment variable, which is
referenced."  Ya know, sometimes I just can't help but embarrass myself.

I think the problem is that, while initlocation does accept the name of
an environment variable, createdb may not, and needs the $.  I'll sit
down now.

Regards,
Ed Loehr

pgsql-general by date:

Previous
From: Ed Loehr
Date:
Subject: Re: initlocation and createdb
Next
From: "Barnes"
Date:
Subject: RE: initlocation and createdb