Option to install PostgreSQL on another drive?

PostgreSQL is the database server used to store information. Do you have a question or are you having problem with PostgreSQL? If so, post them here.

Moderator: Moderators

Option to install PostgreSQL on another drive?

Postby LaidBackAl » Sun Apr 20, 2008 11:13 pm

I just noticed that when I installed PT3 w/ PostgreSQL I changed the option to install it to another drive on my machine. However, and maybe I missed it, but when it installed PostgreSQL it installed it to my C: drive. This is no good at all!! Did I miss something or you guys just defaulted it that way??? I specifically have another whole drive for my databases.
LaidBackAl
 
Posts: 67
Joined: Sun Mar 16, 2008 2:47 pm

Re: Option to install PostgreSQL on another drive?

Postby APerfect10 » Mon Apr 21, 2008 12:12 am

PT3 by default installs PostgreSQL on the same drive that you are installing PT3. If you need to install on a separate drive, you will need to manually download and install PostgreSQL.

Best regards,

Derek
APerfect10
Site Admin
 
Posts: 4489
Joined: Sat Dec 08, 2007 6:03 pm

Re: Option to install PostgreSQL on another drive?

Postby LaidBackAl » Mon Apr 21, 2008 12:20 am

APerfect10 wrote:PT3 by default installs PostgreSQL on the same drive that you are installing PT3. If you need to install on a separate drive, you will need to manually download and install PostgreSQL.

Best regards,

Derek


No it doesn't cause I have PT3 on my F: drive and PostgresSQL is on c:

Which makes no sense from your explanation. I want them both on the F: drive.
LaidBackAl
 
Posts: 67
Joined: Sun Mar 16, 2008 2:47 pm

Re: Option to install PostgreSQL on another drive?

Postby APerfect10 » Mon Apr 21, 2008 12:22 am

Maybe it is installing by default to C then. I will mark this post for Josh's attention for him to confirm. I think it should default to the same drive as PokerTracker is installed on.

Regardless, you will need to manually install PostgreSQL if you want the drive changed.

Best regards,

Derek
APerfect10
Site Admin
 
Posts: 4489
Joined: Sat Dec 08, 2007 6:03 pm

Re: Option to install PostgreSQL on another drive?

Postby LaidBackAl » Mon Apr 21, 2008 12:25 am

I agree...please do mark it.

Actually since Josh is going to read this....

Josh,

You should give people an option to put them on two different drives if they wanted. In my case, I set up 3 different drives with RAID 10 just for your application and so I can datamine. It isn't so much of a big deal with me because my programs applications and the DB run from the same drive but it isn't the C: drive. I guess if I really had to I could install PostgreSGL manually if I was to host it on separate drives, but PostgreSQL is not an easy one for the amateur. It would be really great if your app did it for folks. Sounds like I am in for another backup, uninstall, reinstall, restore, cross my fingers again situation if I want this fixed asap.

Michael
LaidBackAl
 
Posts: 67
Joined: Sun Mar 16, 2008 2:47 pm

Re: Option to install PostgreSQL on another drive?

Postby Josh » Mon Apr 21, 2008 7:53 am

PT3's PostgreSQL install is meant to be as seamless and painless as possible. The way I accomplish this is by eliminating as much of the configuration as possible. Therefore, it installs to your Program Files directory. If you need it installed elsewhere, then you are experienced enough to be able to run the PostgreSQL installation yourself. I don't think I'll be changing this functionality, as the more options I add, the more problems users will have. The PostgreSQL install is extremely complicated for someone who knows next to nothing about computers. There's no need to make it more so.
Josh
Site Admin
 
Posts: 6222
Joined: Sat Dec 08, 2007 6:03 pm

Re: Option to install PostgreSQL on another drive?

Postby bugsbunny » Mon Apr 21, 2008 8:50 am

You can fix it easier than that.

The database cluster itself is located in a subdirectory called PGDATA (it might be DATA, I don't have a current Windows install to check on). Within that sub-directory you'll find the following:

PG_VERSION - this file contains the Postgres version number associated with this cluster
postmaster.opts - this file contains the most recent command line options used to start the Postgres server
postmaster.pid - a lock file which should only be found while the server is running
postgresql.conf - the postgres configuration file
pg_hba.conf - client authentication file
pg_ident.conf - ident map file (used in conjunction with pg_hba.conf for some types of authentication)

You then have a number of sub-directories which contain the actual data files for the cluster.


Uninstall Postgres. It will leave your PGDATA sub-directory intact, but you can just copy that folder to a safe location before uninstalling if you want to be sure (better safe than sorry).

Now install postgres to the new location. Make sure that it's correctly installed and working, then shutdown the server.

Replace all the sub-directories within the new PGDATA directory with the sub-directories from the old one. Do NOT replace any of the configuration files (although if you do it actually shouldn't hurt anything assuming that they're still at the default levels).
Restart postgres.
Done.

Alternately you can leave your current postgres install alone and simply move the actual cluster to the new drive.
Shutdown Postgres.
Copy (don't move for the moment) the entire PGDATA directory to the new drive (I'll assume that it's D: and you copied to D:\PGDATA)
Set correct permissions on the new directory ensuring that the user that the postgres service will be running as has read/write access to the directory and all subdirectories and files.

From D:\PGDATA delete the 3 configuration files (postgresql.conf , pg_hba.conf , pg_ident.conf) along with postmaster.opts and, if it exists, postmaster.pid. Do NOT delete the PG_VERSION file.

Now, in the original PGDATA directory open up postgresql.conf in a text editor. In there, right towards the top, you should find a section:
#------------------------------------------------------------------------------
# FILE LOCATIONS
#------------------------------------------------------------------------------

Find the line that starts:
#data_directory =

Uncomment it by removing the # and enter your new location:
data_directory = 'D:\PGDATA'

Save the modified file.
Delete all the subdirectories and all the files other than the 3 .conf files.
Restart postgres. It should now be accessing the data in the new location.
If for some strange reason it doesn't work you can always copy the data back and undo the change to the postgresql.conf file.
bugsbunny
 
Posts: 65
Joined: Sun Feb 10, 2008 9:29 am

Re: Option to install PostgreSQL on another drive?

Postby LaidBackAl » Tue Apr 22, 2008 9:28 pm

I think the easiest thing to do is unistall and reinstall. What version of PostgreSQL do I install? Can you point to the proper place to download?
LaidBackAl
 
Posts: 67
Joined: Sun Mar 16, 2008 2:47 pm

Re: Option to install PostgreSQL on another drive?

Postby APerfect10 » Wed Apr 23, 2008 1:47 am

APerfect10
Site Admin
 
Posts: 4489
Joined: Sat Dec 08, 2007 6:03 pm

Re: Option to install PostgreSQL on another drive?

Postby LaidBackAl » Wed Apr 23, 2008 2:31 pm

Just so I am clear...the easiest way to back up the database before I uninstall is to:
* pgadmin and select database
* right click and select "Backup"
* create a filename and location to backup to
* leave default settings?
* select ok

Once it is done, I can then unistall Postgres, reinstall to the desired location, setup PT3 to connect to PostgreSQL, Restore DB?

Correct? I can't believe how many of these I have been through in the last week. Is there any plans to fix it so PostgreSQL can be installed on drive of your choice during PT3 setup?
LaidBackAl
 
Posts: 67
Joined: Sun Mar 16, 2008 2:47 pm

Next

Return to PostgreSQL [Read Only]

Who is online

Users browsing this forum: No registered users and 1 guest