PDA

View Full Version : Postgres SQL on an USB-Stick



prize-man
06-08-2009, 10:42 AM
Hi Guys!

I just want to ask if there is an option to install postgres sql on an USB-Stick, so that I just have to plug the Stick in any Computer with holdem manager and get acsess to my database without copy the HH from the laptop to my Pc,...!

If there are any ideas or options, please tell me!

Thanks!

Paul

morny
06-08-2009, 11:51 AM
It depends on the database size whether it will fit on a usb key, see this FAQ on how to setup an external hard drive (essentially the same for USB stick) http://www.holdemmanager.net/faq/afmviewfaq.aspx?faqid=154

snipthetip
06-08-2009, 03:59 PM
morny, if i simply follow part B of that FAQ (no. 154), will that allow me to have my postgreSQL folder on my external hard drive and not have any problems while running the manager? thanks for your help.

morny
06-09-2009, 01:41 PM
If you have PostgreSQL installed already then yes. Then youll need to follow step C to connect it to the 2nd PC and all should be fine then

snipthetip
06-09-2009, 03:42 PM
Then youll need to follow step C to connect it to the 2nd PC and all should be fine then

I don't quite understand this part. I just have one PC that my external hard drive is connected to, no laptop or anything like that. I simply want to move postgreSQL and all its contents to my ext. hard drive to free up some disk space on my desktop. If following step B will work for that, you can let me know. Thanks a lot for your help, I know nothing about computers.

morny
06-09-2009, 05:18 PM
Ah i thought you just wanted to share the external hard drive between 2 pcs. Sorry for the confusion

Heres what you need to do, export the hands from HM http://www.holdemmanager.net/faq/afmviewfaq.aspx?faqid=173

Backup the database http://www.holdemmanager.net/faq/afmviewfaq.aspx?faqid=12

Uninstall PostgreSQL via the control panel > Program and Features

Reinstall PostgreSQL using this FAQ http://www.holdemmanager.net/faq/?f=176

At step 5 you want to change it from installing at C:\Program Files\PostgreSQL\8.3 to the external drive most likely D:\Program Files\PostgreSQL\8.3

You can do this by clicking on the top line PostgreSQL and click the browse button and change the drive from C to whatever yours is (most likely D)

Then complete the installation

Finally restore the database and if anything goes wrong with the restore you also have the hands exported so you can manually reimport them

snipthetip
07-01-2009, 12:18 AM
Ah i thought you just wanted to share the external hard drive between 2 pcs. Sorry for the confusion

Heres what you need to do, export the hands from HM http://www.holdemmanager.net/faq/afmviewfaq.aspx?faqid=173

Backup the database http://www.holdemmanager.net/faq/afmviewfaq.aspx?faqid=12

Uninstall PostgreSQL via the control panel > Program and Features

Reinstall PostgreSQL using this FAQ http://www.holdemmanager.net/faq/?f=176

At step 5 you want to change it from installing at C:\Program Files\PostgreSQL\8.3 to the external drive most likely D:\Program Files\PostgreSQL\8.3

You can do this by clicking on the top line PostgreSQL and click the browse button and change the drive from C to whatever yours is (most likely D)

Then complete the installation

Finally restore the database and if anything goes wrong with the restore you also have the hands exported so you can manually reimport them

Morny, I don't seem to have the option of "Programs and Features" in my Control Panel. Can you tell me how to uninstall PostgreSQL otherwise.

Also, I know I mentioned this previously, but is it possible to follow step B in FAQ154 to move PostgreSQL to my hard drive without taking the steps you mention. Thanks so much for your help.

fozzy71
07-01-2009, 01:20 AM
Morny no longer works on the Forums.

Control Panel > Add/Remove Programs to uninstall SQL. Or you can use an uninstaller like Revo Uninstaller.

I don't see where Morny mentioned that you should delete the postgres user account:


You must *fully* remove PostgreSQL if you want to install it again.

- Uninstall from control panel.
- manually delete the Program Files\Postgresql folders
- run the command "net user postgres /delete"
- reboot.
- install again, as admin, with UAC off.


Not sure about your 2nd question. I haven't had a chance to read this thread in it's entirety. You could try sending a PM to Morny, and he might be able to answer you directly still. Otherwise, I will need to catch up on this thread, and probably ask the assistance of the other support guys.

snipthetip
07-01-2009, 07:47 AM
I don't see where Morny mentioned that you should delete the postgres user account.

Not sure what you mean by this. I am just going to follow the steps you recommend to do the uninstall, then reinstall as Morny suggested. I am likely not going to do any of Morny's suggested steps until later today, so if you have time to catch up on the thread before then, and can answer my question about moving PostgreSQL to my external hard drive by just following the steps in part B of FAQ#154, that would be great. Thanks for your help.

fozzy71
07-01-2009, 09:32 AM
Not sure what you mean by this.

This command line instruction is what I was referring to.


- run the command "net user postgres /delete"




........, and can answer my question about moving PostgreSQL to my external hard drive by just following the steps in part B of FAQ#154, that would be great. Thanks for your help.

I have never tried moving my SQL data folder like that or restoring my SQL DB, but after reading thru the bulk of that FAQ, I think it should work the same. I don't see much harm in you trying it first, if you are comfortable with the regedit instructions. My DB is under 300k hands so I always just import my hand history files as it doesn't take much more than an hour. I am planning to try and do a backup/restore and some other things to my DB this week, purely to educate myself about these procudures I have never had to try.



I am just going to follow the steps you recommend to do the uninstall, then reinstall as Morny suggested.

I recommend Revo Uninstaller, as it is much more effective than the Windows add/remove system at getting rid of all the associated registry entries and other misc files. Just make sure you do these steps before you do any uninstalling or editing of the registry keys, etc.



...

Heres what you need to do, export the hands from HM http://www.holdemmanager.net/faq/afmviewfaq.aspx?faqid=173

Backup the database http://www.holdemmanager.net/faq/afmviewfaq.aspx?faqid=12
.......


The steps below are how I install my PostgreSQL every time. I always install it to a separate hard-drive from my Operating system It provides better performance, and it protects your data folder if your C drive was to ever crash and force you to reformat.

[quote]
Reinstall PostgreSQL using this FAQ http://www.holdemmanager.net/faq/?f=176

At step 5 you want to change it from installing at C:\Program Files\PostgreSQL\8.3 to the external drive most likely D:\Program Files\PostgreSQL\8.3

You can do this by clicking on the top line PostgreSQL and click the browse button and change the drive from C to whatever yours is (most likely D)

Then complete the installation

Finally restore the database and if anything goes wrong with the restore you also have the hands exported so you can manually reimport them

snipthetip
07-02-2009, 07:58 AM
where do i run the command "net user postgres /delete"?

netsrak
07-02-2009, 08:15 AM
Start -> Run -> cmd

snipthetip
07-02-2009, 08:19 AM
is it actually necessary to run that command if i am not using windows vista?

netsrak
07-02-2009, 08:22 AM
yes

snipthetip
07-02-2009, 08:26 AM
haha, okay. i didn't run that command and then tried to reinstall postgreSQL on my external hard drive. and when i go to restore my database, it's giving me an error, saying that it "could not connect to server: Connection refused (0x0000274D/10061) Is the server running on host "127.0.0.1" and accepting TCP/IP connections on port 5432?"

So should I delete/uninstall postgreSQL again, run that command, reboot, and then reinstall?

fozzy71
07-02-2009, 09:41 AM
haha, okay. i didn't run that command and then tried to reinstall postgreSQL on my external hard drive. and when i go to restore my database, it's giving me an error, saying that it "could not connect to server: Connection refused (0x0000274D/10061) Is the server running on host "127.0.0.1" and accepting TCP/IP connections on port 5432?"

So should I delete/uninstall postgreSQL again, run that command, reboot, and then reinstall?



I would try uninstalling SQL again, but using the following procedure. Also make sure you download the latest beta of HM from the link in my Sig. I just used this process earlier today to uninstall SQL so I could go thru the backup/restore process for my own experience/education.


-Download Revo Uninstaller and use it to uninstall PostgreSQL. After it uninstalls it will give you options to select and delete all the associated registry entries.
- manually delete the Program Files\Postgresql folders
- run the command - start > run > cmd >

net user postgres /delete
- reboot.
- install again, with your firewall uninstalled or turned off if windows firewall
Install SQL again using this one-click installer - http://www.postgresql.org/download/windows

snipthetip
07-03-2009, 01:14 PM
when trying to restore my database using pgAdmin III, I am getting an error message. There is an extremely long lost of pg restore: "..." among other things. It says at the bottom, WARNING: errors ignored on restore: 156. Then it says, process returned exit code one. Instead of the dialog box saying done, it has an option to click okay, which if i do, asks if i want to run the restore again. i tried doing that, but I got the same error message as above.

My questions are, 1) will HM work now that I have reinstalled PostgreSQL, 2) how can I fix the restore so that I don't get this error message, and 3) is manually reimporting my hands an option which will do the same thing as restoring my database? Thanks for the help.


Edit: Also, HM is up and running when I tried to load it, but it seems that all of the numbers have been doubled. For example, my total hands number has doubled, my winnings for last month have doubled, etc. Any help with this would be greatly appreciated as well.

netsrak
07-03-2009, 01:27 PM
1.) No
2.) We need the exact error message. For the first of the 156 errors
3.) Yes, you should create a new database and import all your hands. This will take longer than the restore process but the result is nearly the same.

snipthetip
07-03-2009, 01:34 PM
netsrak, i will post the first error message that i see. here it is:

pg_restore: [archiver (db)] Error while PROCESSING TOC:
pg_restore: [archiver (db)] Error from TOC entry 423; 2612 16386 PROCEDURAL LANGUAGE plpgsql postgres
pg_restore: [archiver (db)] could not execute query: ERROR: language "plpgsql" already exists

Any comments on the fact that HM is up and running, and the double hands/winnings issue?

netsrak
07-03-2009, 03:26 PM
I think you totally scrapped your database.

Please send a mail with a link to fabio@holdemmanager.net to arrange a teamviewer session. May be he can save something.