pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Linux Geeks <indolinux.geeks@gmail.com>
To: Ray Stell <stellr@cns.vt.edu>
Cc: pgsql-admin@postgresql.org
Subject: Re: Moving data directory
Date: Tue, 22 May 2007 10:45:17 +0700
Message-ID: <e0247eb60705212045rff67bc6pffc4e72760483a73@mail.gmail.com> (raw)
In-Reply-To: <20070514000259.GA28681@cns.vt.edu>
References: <e0247eb60705120947q495da44ar629cd1b8191879f@mail.gmail.com>
	<20070514000259.GA28681@cns.vt.edu>

Hi Ray,

Sorry for late reply. Yes, I have tested your instructions and working
well. The think is now I need to configure so that it will always
automically start with the new location.

Thank you very much for the detailed instructions, really appreciated it.

Regards,

Dino

On 5/14/07, Ray Stell <stellr@cns.vt.edu> wrote:
> On Sat, May 12, 2007 at 11:47:46PM +0700, Linux Geeks wrote:
> > I'm very new to postgresql and would like to move my data directory to
> > another partition in Ubuntu.
>
>
> I don't think there is anything internal to pg that locks the data
> location.  Just tell postmaster where you move it to.  Shut down the
> postmaster and move it and start it with the -D flag pointing to the
> new location:
>
> $  pg_ctl start -D /var/pgsql/data
> server starting
>
> $ psql -p 5437 testdb jira
> Password for user jira:
> Welcome to psql 8.2.3, the PostgreSQL interactive terminal.
>
> Type:  \copyright for distribution terms
>        \h for help with SQL commands
>        \? for help with psql commands
>        \g or terminate with semicolon to execute query
>        \q to quit
>
> testdb=> \q
>
> pg_ctl stop -D /var/pgsql/data
> waiting for server to shut down....,7222,,2007-05-13 19:52:06.675 EDT,,1,,, LOG:  logger shutting down
>  done
> server stopped
>
> $ mv /var/pgsql/data-move-test /var/pgsql/data
>
> $  pg_ctl start -D /var/pgsql/data-move-test
> server starting
>
> $ psql -p 5437 testdb jira
> Password for user jira:
> Welcome to psql 8.2.3, the PostgreSQL interactive terminal.
>
> Type:  \copyright for distribution terms
>        \h for help with SQL commands
>        \? for help with psql commands
>        \g or terminate with semicolon to execute query
>        \q to quit
>
> testdb=> \q
>
> pg_ctl stop -D /var/pgsql/data-move-test
> waiting for server to shut down....,7245,,2007-05-13 19:55:00.944 EDT,,1,,, LOG:  logger shutting down
>  done
> server stopped
>
> $ mv /var/pgsql/data-move-test /var/pgsql/data
>
> $  pg_ctl start -D /var/pgsql/data
> server starting
>
> $ psql -p 5437 testdb jira
> Password for user jira:
> Welcome to psql 8.2.3, the PostgreSQL interactive terminal.
>
> Type:  \copyright for distribution terms
>        \h for help with SQL commands
>        \? for help with psql commands
>        \g or terminate with semicolon to execute query
>        \q to quit
>
> testdb=> \q
>
> --
>   Lost time is when we learn nothing from the experiences of life. Time
>  gained is when we grow to have a wisdom that is tested in the reality of life.
>


-- 
To Analyze Is To Know Batte Field, Differ from Battle Itself



view thread (10+ messages)  latest in thread

Message-ID: <e0247eb60705212045rff67bc6pffc4e72760483a73@mail.gmail.com>
Permalink:  ../e0247eb60705212045rff67bc6pffc4e72760483a73@mail.gmail.com/
Also on:    postgresql.org/message-id/e0247eb60705212045rff67bc6pffc4e72760483a73@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: indolinux.geeks@gmail.com, stellr@cns.vt.edu
  Subject: Re: Moving data directory
  In-Reply-To: <e0247eb60705212045rff67bc6pffc4e72760483a73@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox