Thread: changing the default directory

changing the default directory

From
User Map
Date:
hi,
i am new to this postgre, i m running postgre under windows server 2003. postgres stores the database/data in the directory "C:\Program Files\PostgreSQL\8.2\data" by default. i want to change this directory to some other drive. is it posible to do this without comand prompt. if it is not then how to do that step by step. and does this one time directory change applies to every database that i will create through pgadminIII.
will be thankful to any help.
map user.


Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.

Re: changing the default directory

From
Raymond O'Donnell
Date:
On 24/01/2008 13:02, User Map wrote:

> i am new to this postgre, i m running postgre under windows server 2003.
> postgres stores the database/data in the directory "C:\Program
> Files\PostgreSQL\8.2\data" by default. i want to change this directory
> to some other drive. is it posible to do this without comand prompt. if
> it is not then how to do that step by step. and does this one time
> directory change applies to every database that i will create through
> pgadminIII.

Hi,

The data directory is set by using initdb. If you installed using the
pgInstaller, then setting the data directory was one of the steps along
the way....and I don't think you can change that using pgInstaller
without un- and re-installing PostgreSQL altogether (others will correct
me if I'm wrong).

However, it's easy to run initdb from the command line, and this will
let you create a new data directory without having to uninstall first.
Have a look at the docs, here:

   http://www.postgresql.org/docs/8.2/static/creating-cluster.html

It's pretty much the same on Windows as on *nix.

HTH,

Ray.

---------------------------------------------------------------
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
rod@iol.ie
---------------------------------------------------------------

Re: changing the default directory

From
User Map
Date:
On doing the following in comand prompt
C:\program files\postgresql\8.2\bin> initdb -D C:\confc
it says
the program "postgres" is neded by initdb but was not found in the
same directory as "C:\program files\postgresql\8.2\bin/initdb". check
your installation.
if i use:
root# mkdir /usr/local/pgsql/data
root# chown postgres /usr/local/pgsql/data
then its says
'chown' is not recognized as an internal or external command.
where is the problem. i think i have installed the postgre through windows installer. well how to check that how i have installed postgre.
thanks for any help

Raymond O'Donnell <rod@iol.ie> wrote:
On 24/01/2008 13:02, User Map wrote:

> i am new to this postgre, i m running postgre under windows server 2003.
> postgres stores the database/data in the directory "C:\Program
> Files\PostgreSQL\8.2\data" by default. i want to change this directory
> to some other drive. is it posible to do this without comand prompt. if
> it is not then how to do that step by step. and does this one time
> directory change applies to every database that i will create through
> pgadminIII.

Hi,

The data directory is set by using initdb. If you installed using the
pgInstaller, then setting the data directory was one of the steps along
the way....and I don't think you can change that using pgInstaller
without un- and re-installing PostgreSQL altogether (others will correct
me if I'm wrong).

However, it's easy to run initdb from the command line, and this will
let you create a new data directory without having to uninstall first.
Have a look at the docs, here:

http://www.postgresql.org/docs/8.2/static/creating-cluster.html

It's pretty much the same on Windows as on *nix.

HTH,

Ray.

---------------------------------------------------------------
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
rod@iol.ie
---------------------------------------------------------------


Looking for last minute shopping deals? Find them fast with Yahoo! Search.

Re: changing the default directory

From
"Martin Gainty"
Date:
i agree and if your postgres data folder will be constant I would set PGDATA
environment variable to the folder location

M-
----- Original Message -----
From: "Raymond O'Donnell" <rod@iol.ie>
To: "User Map" <map.user@yahoo.com>
Cc: "pgsql" <pgsql-general@postgresql.org>
Sent: Thursday, January 24, 2008 8:18 AM
Subject: Re: [GENERAL] changing the default directory


> On 24/01/2008 13:02, User Map wrote:
>
> > i am new to this postgre, i m running postgre under windows server 2003.
> > postgres stores the database/data in the directory "C:\Program
> > Files\PostgreSQL\8.2\data" by default. i want to change this directory
> > to some other drive. is it posible to do this without comand prompt. if
> > it is not then how to do that step by step. and does this one time
> > directory change applies to every database that i will create through
> > pgadminIII.
>
> Hi,
>
> The data directory is set by using initdb. If you installed using the
> pgInstaller, then setting the data directory was one of the steps along
> the way....and I don't think you can change that using pgInstaller
> without un- and re-installing PostgreSQL altogether (others will correct
> me if I'm wrong).
>
> However, it's easy to run initdb from the command line, and this will
> let you create a new data directory without having to uninstall first.
> Have a look at the docs, here:
>
>    http://www.postgresql.org/docs/8.2/static/creating-cluster.html
>
> It's pretty much the same on Windows as on *nix.
>
> HTH,
>
> Ray.
>
> ---------------------------------------------------------------
> Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
> rod@iol.ie
> ---------------------------------------------------------------
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: Have you checked our extensive FAQ?
>
>                http://www.postgresql.org/docs/faq
>