Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 31 Dec 2008 09:15:28 -0600
From:      "Andrew Gould" <andrewlylegould@gmail.com>
To:        "Free BSD Questions list" <freebsd-questions@freebsd.org>
Subject:   Re: PostgreSQL setup
Message-ID:  <d356c5630812310715n8fde2f3qdb2ab27827475b9d@mail.gmail.com>
In-Reply-To: <20081231150648.GA18063@teddy.fas.com>
References:  <20081231150648.GA18063@teddy.fas.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Dec 31, 2008 at 9:06 AM, stan <stanb@panix.com> wrote:

> I have installed PostgreSQL via the ports on a new 7.1 machine. I am trying
> to set it up.
>
> I found:
>
> http://www.freebsddiary.org/postgresql.php
>
> Whic says to run:
>
>  su -l pgsql -c initdb
>
> But that gives me the following error message:
>
> initdb: no data directory specified
> You must identify the directory where the data for this database system
> will reside.  Do this with either the invocation option -D or the
> environment variable PGDATA.
>
> But when I try:
>
> #  su -l pgsql -c initdb -D /usr/local/postgres
>
> I get:
>
> Illegal option -D
>
> What am I doing wrong?
>
>
I think the command has to be enclosed in quotation marks since it consists
of multiple words.  su thinks the '-D' is an argument for su rather than
initdb.

su -l pgsql -c 'initdb -D /usr/local/postgres'

Best of luck,

Andrew



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?d356c5630812310715n8fde2f3qdb2ab27827475b9d>