Page 1 of 1

Problem "initdb -d"

PostPosted: Fri Jan 04, 2013 8:45 pm
by cuoredisardegna
Hi to All,
Could Someone resolve this problem?

In order to made a new cluster, in pgsql , as superuser postgres, it was typed this command:

Code: Select all
initdb -d "c:\users\gianni\desktop\dir_cluster"


But this command did not produce any effect.
No effect if before the command the directory dir_cluster was created; no effect if it was not created.

Tanks in advance

Gianni Pinna.

Re: Problem "initdb -d"

PostPosted: Sat Jan 05, 2013 8:02 am
by Adelo Herrero
Hello:

If you are assign a new data directory for Postgres, I think the correct syntax is:

Code: Select all
initdb -D "c:/users/gianni/desktop/dir_cluster"


The option "-d" active the output log in backend.

For more information, read you:

http://www.postgresql.org/docs/8.1/static/app-initdb.html

Best regards.

Re: Problem "initdb -d"

PostPosted: Sat Jan 05, 2013 4:33 pm
by cuoredisardegna
Hi Adelo,
I have tryed for all the morning with "D" option, but without any result.
I see that You have wanted to be very kind, Adelo.
Hav You god.
Tank, tank You very much.
Gianni Pinna.

Re: Problem "initdb -d"

PostPosted: Wed Jan 09, 2013 11:33 am
by ROCLASI
Hi Gianni,

Initdb will try to create the directory for you but when it doesn't have the permissions (running as the postgresql user) to write in that location then it will fail.
The work around for this is to create the directory yourself and give the postgresql user the proper permissions on this directory. Then run initdb again and it should create all the (sub)directories and files inside this folder.

Also -d or -D are different things. -d (lowercase) means debug. -D (uppercase) means the pgdata directory.

Hope this helps.