Re: Moving data directory

From: "Vishal Arora" <aroravishal22(at)hotmail(dot)com>
To: Mahmood(dot)Khan(at)in(dot)unisys(dot)com, indolinux(dot)geeks(at)gmail(dot)com, stellr(at)cns(dot)vt(dot)edu
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Moving data directory
Date: 2007-05-22 06:26:16
Message-ID: BAY123-F1296B5615B94F77A252CAA9360@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

This is also an alternative that can be used. I am not sure about windows,
but it is PGDATA variable in Linux. it can be set using export command.
- vishal

>From: "Khan, Mahmood Ahram" <Mahmood(dot)Khan(at)in(dot)unisys(dot)com>
>To: "Vishal Arora"
><aroravishal22(at)hotmail(dot)com>,<indolinux(dot)geeks(at)gmail(dot)com>,<stellr(at)cns(dot)vt(dot)edu>
>CC: <pgsql-admin(at)postgresql(dot)org>
>Subject: Re: [ADMIN] Moving data directory
>Date: Tue, 22 May 2007 11:11:00 +0530
>
>No needs to specify in pg_ctl start/stop clause instead add a variable
>in PATH. PG_DATA = d:\postgresdata\data. It is start by just typing
>pg_ctl start/stop.
>Thanks & Best Regards
>
>M.AHRAM KHAN
>
>-----Original Message-----
>From: pgsql-admin-owner(at)postgresql(dot)org
>[mailto:pgsql-admin-owner(at)postgresql(dot)org] On Behalf Of Vishal Arora
>Sent: Tuesday, May 22, 2007 10:09 AM
>To: indolinux(dot)geeks(at)gmail(dot)com; stellr(at)cns(dot)vt(dot)edu
>Cc: pgsql-admin(at)postgresql(dot)org
>Subject: Re: [ADMIN] Moving data directory
>
>Each time you start postgres server using pg_ctl you have to mention the
>
>data directory location using -D option. Alternatively you can specify
>in
>the data_directory parameter of postgresql.conf file.
>
>- vishal
>
>
> >From: "Linux Geeks" <indolinux(dot)geeks(at)gmail(dot)com>
> >To: "Ray Stell" <stellr(at)cns(dot)vt(dot)edu>
> >CC: pgsql-admin(at)postgresql(dot)org
> >Subject: Re: [ADMIN] Moving data directory
> >Date: Tue, 22 May 2007 10:45:17 +0700
> >
> >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(at)cns(dot)vt(dot)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
> >
> >---------------------------(end of
>broadcast)---------------------------
> >TIP 5: don't forget to increase your free space map settings
>
>_________________________________________________________________
>More photos, more messages, more storage-get 2GB with Windows Live
>Hotmail.
>http://imagine-windowslive.com/hotmail/?locale=en-us&ocid=TXT_TAGHM_migr
>ation_HM_mini_2G_0507
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 9: In versions below 8.0, the planner will ignore your desire to
> choose an index scan if your joining column's datatypes do not
> match
>
>---------------------------(end of broadcast)---------------------------
>TIP 3: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faq

_________________________________________________________________
Catch suspicious messages before you open themwith Windows Live Hotmail.
http://imagine-windowslive.com/hotmail/?locale=en-us&ocid=TXT_TAGHM_migration_HM_mini_protection_0507

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message flickchick_one 2007-05-22 17:15:51 preload libraries
Previous Message Khan, Mahmood Ahram 2007-05-22 05:41:00 Re: Moving data directory