Thread: initdb problem

initdb problem

From
Andy Callan
Date:
My installation of PostgreSQL was created when i installed a GIS application but it does
not appear to have a data cluster specified so I did the following:

[Computer:local/pgsql/bin] andrewcallan% ./initdb -D /usr/local/pgsql/data
         The files belonging to this database system will be owned by user "andrewcallan".
         This user must also own the server process.

          Fixing permissions on existing directory /usr/local/pgsql/data... chmod: /usr/local/
          pgsql/data: Operation not permitted

          initdb failed.

Also just for kicks I tried to startup to server since i don't know exactly what the auto-
install did and did not do and this is what happened:

[Computer:local/pgsql/bin] andrewcallan% ./postmaster -D /usr/local/pgsql/data
           FATAL 1:  data directory /usr/local/pgsql/data has group or world access;
           permissions should be u=rwx (0700)

  --I created the /data directory just with a mkdir as the root b/c at the time i did not
know if initdb would create it if it didn't exist, its my understanding initdb will change the
permissions as needed so this problem should go away....

I am completely new to PostgreSQL and have spent the last couple weeks playing with
installing both it and mySQL to try to link some data to the GIS application so I really do
not know what am I doing and this could be a really stupid mistake, please be gentle....
Many thanks for your assistance.

--
Andy Callan
St. Thomas More College
Rm M112
Mounts Bay Rd.
Crawley, WA 6009
IM: CALid05
www.nd.edu/~acallan1



Re: initdb problem

From
"Jaskier"
Date:
Hi,

No it will not work, You have to be owner, or have full access to this
directory. Also you should, I think this is necessary to run Initdb as a
Postgres user.

This is what you have to do:

As root change rights to this /usr/local/pgsql and change the owner (it
would be better) to Postgres
Then do exactly the same what you have already tried to do, but as a
Postgres User

Should Work

Regards

Andrzej Schulz
Galileo Selidor

-----Original Message-----
From: pgsql-admin-owner@postgresql.org
[mailto:pgsql-admin-owner@postgresql.org] On Behalf Of Andy Callan
Sent: Thursday, September 18, 2003 11:02 AM
To: pgsql-admin@postgresql.org
Subject: [ADMIN] initdb problem

My installation of PostgreSQL was created when i installed a GIS
application but it does
not appear to have a data cluster specified so I did the following:

[Computer:local/pgsql/bin] andrewcallan% ./initdb -D
/usr/local/pgsql/data
         The files belonging to this database system will be owned by
user "andrewcallan".
         This user must also own the server process.

          Fixing permissions on existing directory
/usr/local/pgsql/data... chmod: /usr/local/
          pgsql/data: Operation not permitted

          initdb failed.

Also just for kicks I tried to startup to server since i don't know
exactly what the auto-
install did and did not do and this is what happened:

[Computer:local/pgsql/bin] andrewcallan% ./postmaster -D
/usr/local/pgsql/data
           FATAL 1:  data directory /usr/local/pgsql/data has group or
world access;
           permissions should be u=rwx (0700)

  --I created the /data directory just with a mkdir as the root b/c at
the time i did not
know if initdb would create it if it didn't exist, its my understanding
initdb will change the
permissions as needed so this problem should go away....

I am completely new to PostgreSQL and have spent the last couple weeks
playing with
installing both it and mySQL to try to link some data to the GIS
application so I really do
not know what am I doing and this could be a really stupid mistake,
please be gentle....
Many thanks for your assistance.

--
Andy Callan
St. Thomas More College
Rm M112
Mounts Bay Rd.
Crawley, WA 6009
IM: CALid05
www.nd.edu/~acallan1



---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

               http://archives.postgresql.org


Re: initdb problem

From
Robert Treat
Date:
On Thu, 2003-09-18 at 09:25, Jaskier wrote:
> Hi,
>
> No it will not work, You have to be owner, or have full access to this
> directory. Also you should, I think this is necessary to run Initdb as a
> Postgres user.

It can't be run as root, but it can be run as any other user. The key is
that whichever user runs initdb will be the "master user" of the
database and must own your $PGDATA directory.

>
> This is what you have to do:
>
> As root change rights to this /usr/local/pgsql and change the owner (it
> would be better) to Postgres
> Then do exactly the same what you have already tried to do, but as a
> Postgres User
>
> Should Work
>
> Regards
>
> Andrzej Schulz
> Galileo Selidor
>
> -----Original Message-----
> From: pgsql-admin-owner@postgresql.org
> [mailto:pgsql-admin-owner@postgresql.org] On Behalf Of Andy Callan
> Sent: Thursday, September 18, 2003 11:02 AM
> To: pgsql-admin@postgresql.org
> Subject: [ADMIN] initdb problem
>
> My installation of PostgreSQL was created when i installed a GIS
> application but it does
> not appear to have a data cluster specified so I did the following:
>
> [Computer:local/pgsql/bin] andrewcallan% ./initdb -D
> /usr/local/pgsql/data
>          The files belonging to this database system will be owned by
> user "andrewcallan".
>          This user must also own the server process.
>
>           Fixing permissions on existing directory
> /usr/local/pgsql/data... chmod: /usr/local/
>           pgsql/data: Operation not permitted
>
>           initdb failed.
>
> Also just for kicks I tried to startup to server since i don't know
> exactly what the auto-
> install did and did not do and this is what happened:
>
> [Computer:local/pgsql/bin] andrewcallan% ./postmaster -D
> /usr/local/pgsql/data
>            FATAL 1:  data directory /usr/local/pgsql/data has group or
> world access;
>            permissions should be u=rwx (0700)
>
>   --I created the /data directory just with a mkdir as the root b/c at
> the time i did not
> know if initdb would create it if it didn't exist,

it will try but often fail if /usr/local/pgsql is owned by root. usually
you have to create the /data directory and then chown it to whomever you
want to run initdb.

> its my understanding
> initdb will change the
> permissions as needed so this problem should go away....
>
> I am completely new to PostgreSQL and have spent the last couple weeks
> playing with
> installing both it and mySQL to try to link some data to the GIS
> application so I really do
> not know what am I doing and this could be a really stupid mistake,
> please be gentle....
> Many thanks for your assistance.
>

http://www.postgresql.org/docs/7.3/interactive/creating-cluster.html

Robert Treat
--
Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL


Re: initdb problem

From
"Andrzej Schulz"
Date:
Yeah, and that is that i hda in mind. Problem is that almost always it is
postgres user, cause it is recommended. Due to protection reasons, some kind
:-).

Andrzej Schulz
Galileo Selidor
----- Original Message -----
From: "Robert Treat" <xzilla@users.sourceforge.net>
To: "Jaskier" <jaskierbard@poczta.onet.pl>
Cc: <pgsql-admin@postgresql.org>; "Andy Callan" <acallan1@nd.edu>
Sent: Friday, September 19, 2003 3:58 PM
Subject: Re: [ADMIN] initdb problem


> On Thu, 2003-09-18 at 09:25, Jaskier wrote:
> > Hi,
> >
> > No it will not work, You have to be owner, or have full access to this
> > directory. Also you should, I think this is necessary to run Initdb as a
> > Postgres user.
>
> It can't be run as root, but it can be run as any other user. The key is
> that whichever user runs initdb will be the "master user" of the
> database and must own your $PGDATA directory.
>
> >
> > This is what you have to do:
> >
> > As root change rights to this /usr/local/pgsql and change the owner (it
> > would be better) to Postgres
> > Then do exactly the same what you have already tried to do, but as a
> > Postgres User
> >
> > Should Work
> >
> > Regards
> >
> > Andrzej Schulz
> > Galileo Selidor
> >
> > -----Original Message-----
> > From: pgsql-admin-owner@postgresql.org
> > [mailto:pgsql-admin-owner@postgresql.org] On Behalf Of Andy Callan
> > Sent: Thursday, September 18, 2003 11:02 AM
> > To: pgsql-admin@postgresql.org
> > Subject: [ADMIN] initdb problem
> >
> > My installation of PostgreSQL was created when i installed a GIS
> > application but it does
> > not appear to have a data cluster specified so I did the following:
> >
> > [Computer:local/pgsql/bin] andrewcallan% ./initdb -D
> > /usr/local/pgsql/data
> >          The files belonging to this database system will be owned by
> > user "andrewcallan".
> >          This user must also own the server process.
> >
> >           Fixing permissions on existing directory
> > /usr/local/pgsql/data... chmod: /usr/local/
> >           pgsql/data: Operation not permitted
> >
> >           initdb failed.
> >
> > Also just for kicks I tried to startup to server since i don't know
> > exactly what the auto-
> > install did and did not do and this is what happened:
> >
> > [Computer:local/pgsql/bin] andrewcallan% ./postmaster -D
> > /usr/local/pgsql/data
> >            FATAL 1:  data directory /usr/local/pgsql/data has group or
> > world access;
> >            permissions should be u=rwx (0700)
> >
> >   --I created the /data directory just with a mkdir as the root b/c at
> > the time i did not
> > know if initdb would create it if it didn't exist,
>
> it will try but often fail if /usr/local/pgsql is owned by root. usually
> you have to create the /data directory and then chown it to whomever you
> want to run initdb.
>
> > its my understanding
> > initdb will change the
> > permissions as needed so this problem should go away....
> >
> > I am completely new to PostgreSQL and have spent the last couple weeks
> > playing with
> > installing both it and mySQL to try to link some data to the GIS
> > application so I really do
> > not know what am I doing and this could be a really stupid mistake,
> > please be gentle....
> > Many thanks for your assistance.
> >
>
> http://www.postgresql.org/docs/7.3/interactive/creating-cluster.html
>
> Robert Treat
> --
> Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 7: don't forget to increase your free space map settings