Problem "initdb -d"

Questions and answers regarding general SQL and backend databases

Problem "initdb -d"

Postby cuoredisardegna » Fri Jan 04, 2013 8:45 pm

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.
cuoredisardegna
 
Posts: 68
Joined: Mon May 07, 2012 5:34 am

Re: Problem "initdb -d"

Postby Adelo Herrero » Sat Jan 05, 2013 8:02 am

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.
Adelo Herrero
Adelo Herrero
 
Posts: 103
Joined: Sat Jul 25, 2009 9:24 pm
Location: Requena (Valencia) España

Re: Problem "initdb -d"

Postby cuoredisardegna » Sat Jan 05, 2013 4:33 pm

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.
cuoredisardegna
 
Posts: 68
Joined: Mon May 07, 2012 5:34 am

Re: Problem "initdb -d"

Postby ROCLASI » Wed Jan 09, 2013 11:33 am

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.
Robert Ivens
SAN Developer / Servoy Valued Professional / Servoy Certified Developer

ROCLASI Software Solutions / JBS Group, Partner
Mastodon: @roclasi
--
ServoyForge - Building Open Source Software.
PostgreSQL - The world's most advanced open source database.
User avatar
ROCLASI
Servoy Expert
 
Posts: 5438
Joined: Thu Oct 02, 2003 9:49 am
Location: Netherlands/Belgium


Return to SQL Databases

Who is online

Users browsing this forum: No registered users and 9 guests