Re: Changing the data directory Ubuntu

From: John Purser <jmpurser(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Changing the data directory Ubuntu
Date: 2006-08-15 21:16:58
Message-ID: 20060815141658.3b401aa5.jmpurser@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 15 Aug 2006 11:19:39 -0700
shaun(dot)ricci(at)gmail(dot)com wrote:

> Hello,
>
> I have done a good deal of investigation and cannot seem to find a
> straight answer. Is there way to change the default data directory?
> I am using Ubuntu Dapper LTS. I have a seperate hard drive (and
> partition) that I want to keep my data on in case of a problem with
> the OS.
>
> Any help would be appreciated.
>
> Shaun

Shaun,

Normally the "default data directory" is set when starting PostgreSQL
with the -D switch. Sometimes it is controled by the PGDATA
environmental variable.

On my Ubuntu Dapper system PostgreSQL (which was build from source, not
the .deb) this is set from SysV startup script located
at /etc/init.d/postgresql. To "change" the default directory run
initdb -D "New Directory" then change the data directory in the SysV
init script. Stop and restart PostgreSQL.

John Purser

In response to

Browse pgsql-general by date

  From Date Subject
Next Message gustavo halperin 2006-08-15 22:15:04 CONSTRAINT REFERENCE betwen array to single
Previous Message Thomas F. O'Connell 2006-08-15 21:11:12 Re: Changing the data directory Ubuntu