X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id ED40B8B9CFC for ; Fri, 11 Feb 2005 18:59:30 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 19047-01 for ; Fri, 11 Feb 2005 18:59:13 +0000 (GMT) Received: from out010.verizon.net (out010pub.verizon.net [206.46.170.133]) by svr1.postgresql.org (Postfix) with ESMTP id 125148BA157 for ; Fri, 11 Feb 2005 18:59:12 +0000 (GMT) Received: from jfradkin ([66.15.127.235]) by out010.verizon.net (InterMail vM.5.01.06.06 201-253-122-130-106-20030910) with ESMTP id <20050211185911.SIOH25879.out010.verizon.net@jfradkin>; Fri, 11 Feb 2005 12:59:11 -0600 From: "Joel Fradkin" To: "'Richard Huxton'" Cc: Subject: Re: postgres 8 data directory other then default? Date: Fri, 11 Feb 2005 14:02:47 -0500 Message-ID: <000901c5106c$47be3f90$797ba8c0@jfradkin> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable In-Reply-To: <420C7940.1090005@archonet.com> X-Authentication-Info: Submitted using SMTP AUTH at out010.verizon.net from [66.15.127.235] at Fri, 11 Feb 2005 12:59:11 -0600 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=3.183 tagged_above=0 required=5 tests=AWL, MSGID_DOLLARS X-Spam-Level: *** X-Archive-Number: 200502/135 X-Sequence-Number: 20246 Thank you for all the help. I was able to get system up (8.0 RPMS, not a build of 8.0.1) I installed to the normal /var/lib/pgsql/data directory. I did an initdb on the pgdata drive initdb /pgdata/data This created a data folder on that drive set. I used the instructions below for linking my wal to /wal drive. I edited the postgres.conf in /var/lib/pgsl/data to use the data_directory=3D'pgdata/data' I am hoping this means the log files and such are on /var/lib/pgsql/data = and that the actual data is on the pgdata/data and the wal is on the /wal. I could confirm the /pgdata and /wal sytems were growing in size as I = added data to the database. Everyone on this list has been so super helpful; I could never have = figured it out without all the guidance. I just wanted to thank everyone who = jumped in with help. Stuff is so hard when you're ignorant. I know my way = around the MSSQL world, and with the help here I feel I am getting started with Postgres. Silly stupid stuff like environment variables etc when your = new take so long to figure out the right commands and where to put them, = that's why I really appreciated the step by step help. I was thinking of documenting the whole process from install to finished working project. You all think this be a good idea, just post it here? Joel Fradkin =20 Wazagua, Inc. 2520 Trailmate Dr Sarasota, Florida 34243 Tel. 941-753-7111 ext 305 =20 jfradkin@wazagua.com www.wazagua.com Powered by Wazagua Providing you with the latest Web-based technology & advanced tools. C 2004. WAZAGUA, Inc. All rights reserved. WAZAGUA, Inc This email message is for the use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized = review, use, disclosure or distribution is prohibited. If you are not the = intended recipient, please contact the sender by reply email and delete and = destroy all copies of the original message, including attachments. =20 =20 -----Original Message----- From: Richard Huxton [mailto:dev@archonet.com]=20 Sent: Friday, February 11, 2005 4:22 AM To: Joel Fradkin Cc: pgsql-sql@postgresql.org Subject: Re: [SQL] postgres 8 data directory other then default? Joel Fradkin wrote: > I am trying to use a different drive for the data. >=20 > I have edited postgres.conf to point to the new location, but I get = the > error /pgdata/PG_VERSION is missing. >=20 > Do I have to do a initdb? >=20 > When I try an initdb it says it is not empty. (has lost and found = folder in > it). Create a sub-directory. Separate filesystems will have a lost+found=20 folder at the top-level, so you'll need to create a directory called=20 pgsql (or whatever). > Fedora Core 3 linux. >=20 > I was able to do an init db if I create a folder called data in the pgdata, > but I was not sure if it then would use that folder for all the files = (I > just want my data to be there). Ah - there you go then. All files live there unless you use=20 tablespaces/symbolic links. > I also want to move my wal files to the /wal drives once I get it to = start > using pgdata drive for data. >=20 > I got some info on this >=20 > 0) backup your data > 1) stop postmaster and verify. > 2) cd $PGDATA; mv pg_xlog original_pg_xlog; ln -s /wal pg_xlog; cp=20 > original_pg_xlog/* pg_xlog > 3) start postmaster and confirm correct startup in log files. >=20 > Will this work? I am guessing this info would be in the var/lib folder = not > the /pgdata folder? Well, what you might want to do is: 1. Setup your .../pgsql/data folder on the WAL drive. 2. initb that location 3. Set up a tablespace for your data on the other drive(s) You can then have a default location for your database, and even move a=20 single table over to its own drive(s) if that's what you need. Details=20 in the manuals (start at chapter 18, then check the details in the SQL=20 reference). I'd test it with a sample database first, make sure you're practiced=20 with it. Oh - if you do filesystem backups when the database is stopped, = make sure you remember to back up the alternate tablespace. > Thanks in advance and sorry for asking so many dumb newb questions. >=20 > Least this time the install of 8 went super smooth, just went to the > postgres site and got the rpm's (Since I did not install 7 with the OS = it > asked for the fedora cd's a few times but all rpm's went ok). Excellent. > On the 8.1 files which are in tar files do I need to get those as well = to > get to 8.1 if so what is the procedure other then copying the files to = my > system (I have the .tar.bz) It'll be 8.0.1 rather then 8.1 and they'll be source files. You unpack=20 them run configure and make and out pops a new version of PG. I'd=20 recommend sticking with the RPMs for the moment. -- Richard Huxton Archonet Ltd