Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 180929FB41B for ; Tue, 22 May 2007 00:45:26 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 70754-07 for ; Tue, 22 May 2007 00:45:18 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from nz-out-0506.google.com (nz-out-0506.google.com [64.233.162.238]) by postgresql.org (Postfix) with ESMTP id D845F9FB3E6 for ; Tue, 22 May 2007 00:45:18 -0300 (ADT) Received: by nz-out-0506.google.com with SMTP id s1so2467096nze for ; Mon, 21 May 2007 20:45:18 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=eNDT8Y2ojdmgAAYmrL0MjUZpRHLb8kyt4sjLQrsYtCOe0oHooEc9ujDdijI/sOJbiJ02d2vJKc4ScTiiKKASKb9khUak/Z3VC6V63cdEaB9iGvm/pw+63ln8Q0Cx/rOggHOFccHkza+/jKtrby1D+nVTG9Qcwxwgt5Le1SSfNDU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=h1SulnayKTcTQNeUy0P4XTA2fNB1GWFV98qY3ExuOh1otBSUZaedXN+6H3RRhsf2UefidIU9GMYeETLHBZQLjaBuOmYfyxtJKivoZjisPF5rozeD7CxRVpn9d6q2r0UTiq3or52pDjhp1Mz6w4YClLEZQhZQBMqIlZ//Hm7/AGg= Received: by 10.114.67.2 with SMTP id p2mr3106841waa.1179805517892; Mon, 21 May 2007 20:45:17 -0700 (PDT) Received: by 10.114.178.7 with HTTP; Mon, 21 May 2007 20:45:17 -0700 (PDT) Message-ID: Date: Tue, 22 May 2007 10:45:17 +0700 From: "Linux Geeks" To: "Ray Stell" Subject: Re: Moving data directory Cc: pgsql-admin@postgresql.org In-Reply-To: <20070514000259.GA28681@cns.vt.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20070514000259.GA28681@cns.vt.edu> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200705/216 X-Sequence-Number: 25536 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 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