From owner-freebsd-questions@FreeBSD.ORG Wed Dec 31 15:15:30 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E1080106566B for ; Wed, 31 Dec 2008 15:15:30 +0000 (UTC) (envelope-from andrewlylegould@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.158]) by mx1.freebsd.org (Postfix) with ESMTP id 6988E8FC23 for ; Wed, 31 Dec 2008 15:15:30 +0000 (UTC) (envelope-from andrewlylegould@gmail.com) Received: by fg-out-1718.google.com with SMTP id l26so1873469fgb.35 for ; Wed, 31 Dec 2008 07:15:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type:references; bh=sQn5L0/6SMnI50b4t+s9zoUVkDO0cptsZI/x/GWDVUI=; b=dQ7LC9H6cN5SjjmYvA6nbkcnXtr7tPD+1T5+cHl48DwKu3i7GnULeNKvQrGNnig00e Lvn/getKv0WTFrdtEfIYeX2LsrslWWGPRN9BV+5npE9vPuZw75cEtIQCHVlcjDIeJUB4 jm+9d/Pnfjd5uAoyNS7FtwsQ1vKHx9KbN06Js= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:references; b=Kj7RSCi47ssni4fbybtMyAIig9D1bWo/Aac23lMOp7SVKRcYM3S4Jk0+7l0qXsQ8Fb KlIdQWqQxTFs3XSgE1WBVTHxYILuy+6+cbsRBFusz55TCouyr4HJrdEA05Eg8/Dystlh vEjti/UQ1RsjPWnr2gNnwResAm741jwFDThIM= Received: by 10.103.241.5 with SMTP id t5mr5736802mur.127.1230736528534; Wed, 31 Dec 2008 07:15:28 -0800 (PST) Received: by 10.103.229.16 with HTTP; Wed, 31 Dec 2008 07:15:28 -0800 (PST) Message-ID: Date: Wed, 31 Dec 2008 09:15:28 -0600 From: "Andrew Gould" To: "Free BSD Questions list" In-Reply-To: <20081231150648.GA18063@teddy.fas.com> MIME-Version: 1.0 References: <20081231150648.GA18063@teddy.fas.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Re: PostgreSQL setup X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Dec 2008 15:15:31 -0000 On Wed, Dec 31, 2008 at 9:06 AM, stan 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