RE: initlocation and createdb

From: "Barnes" <aardvark(at)ibm(dot)net>
To: "'Ed Loehr'" <eloehr(at)austin(dot)rr(dot)com>, <pgsql-general(at)postgresql(dot)org>
Subject: RE: initlocation and createdb
Date: 2000-06-13 21:31:20
Message-ID: 004101bfd57e$b9a495b0$0a64a8c0@fries
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi, Ed. When I try it with the $, I get:

[postgres(at)whopper /home]$ createdb optodb -D $PGDATA2
ERROR: The database path '/home/pgdata' 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

which looks like a variation on the same problem??

Thanks again.

-----Original Message-----
From: ed [mailto:ed]On Behalf Of Ed Loehr
Sent: Tuesday, June 13, 2000 5:27 PM
To: Barnes; pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] initlocation and createdb

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(at)whopper pgdata]$ export PGDATA2=/home/pgdata
> > > [postgres(at)whopper pgdata]$ initlocation PGDATA2
> > > [postgres(at)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(at)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Richard J Kuhns 2000-06-13 21:39:38 initlocation and createdb
Previous Message Ed Loehr 2000-06-13 21:26:30 Re: initlocation and createdb