Subject: Re: First try of pgsql start complains "initdb: unknown option -- m"
To: None <netbsd-help@netbsd.org>
From: Stefan 'Kaishakunin' Schumacher <stefan@net-tex.de>
List: netbsd-help
Date: 10/03/2005 02:08:12
--6c2NcOVqGQ03X4Wi
Content-Type: text/plain; charset=iso-8859-15
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
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...
>=20
> 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.
>=20
> [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...
>=20
> 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.=20
--=20
PGP FPR: CF74 D5F2 4871 3E5C FFFE 0130 11F4 C41E B3FB AE33
--=20
Der Geist des Kriegers sollte mit Beginn des Neujahrstages bis zum Ende=20
des Jahres vom Gedanken an seinen Tod beherrscht werden.
Daijouji Shigesuke in "Budo Shoshin Shuu"
--6c2NcOVqGQ03X4Wi
Content-Type: application/pgp-signature
Content-Disposition: inline
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (NetBSD)
iD8DBQFDQHZsEfTEHrP7rjMRAiTsAKCMxrC63fkuucyx4PK3gKV3ApW8AQCff2z8
mWLjtouWQ6ZDdiOZASx3+VU=
=GztT
-----END PGP SIGNATURE-----
--6c2NcOVqGQ03X4Wi--