Subject: Re: First try of pgsql start complains "initdb: unknown option --
To: Stefan 'Kaishakunin' Schumacher <stefan@net-tex.de>
From: Gan Uesli Starling <alias@starling.us>
List: netbsd-help
Date: 10/02/2005 21:20:49
Stefan 'Kaishakunin' Schumacher wrote:
> Also sprach Gan Uesli Starling (alias@starling.us)
> 
>>Trying out PostgreSQL for the very first time. I
>>get an error when I try this for an initial
>>experimental run...
>>
>>baal: {16} sudo /etc/rc.d/pgsql start &
>>[1] 1245
>>baal: {17} Initializing PostgreSQL databases.
>>initdb: unknown option -- m
>>Try "initdb --help" for more information.
>>
>>[1]    Exit 1                 sudo /etc/rc.d/pgsql start
>>baal: {17}
> 
> 
> What is the content of  /etc/rc.d/pgsql?
> 
> 
>>...so I next enquire thus...
>>
>>baal: {17} initdb --help
> 
> [...]
> 
> 
>>...and sure enough, there is no option 'm'. Anybody know what gives?
> 
> 
> To setup PostgreSQL, you have to create a database cluster
>  # mkdir /usr/pgdata
>  # chown -R pgsql.pgsql  /usr/pgdata
>  # su pgsql
>  $ initdb -D /usr/pgdata    (see man page for further options)
> 
> And create a new PostgreSQL user (pgsql is the PostgreSQL admin)
>  $ createuser foobar		(can be different from your NetBSD login)
> 
> You can go back to your normal NetBSD login and create the first DB:
>  $ createdb -Ufoobar MyDatabase
>  $ psql MyDatabase
> 
> To start PostgreSQL, you can use (as pgsql NOT as root)
>  /usr/pkg/bin/pg_ctl  -D /usr/pgdata/ start&
> 
> 
> I guess your /etc/rc.d/pgsql is old, PG changed it's syntax. 
> 


Yes! That works, hurrah, hurrah! Thanks Stephan.