Page 1 of 1

Same pg_data for 2 Computers?

PostPosted: Fri Nov 07, 2008 8:04 pm
by goofkiller
Hello!
First I have to say, that I'm quite a beginner at postgres and databases.
I mainly play on my notebook at the place where I study. I configured Postgres that It stores the databases on an external hard drive according to this thread: viewtopic.php?f=15&t=12136&p=56628&hilit=performance+tuning#p56628
So my data is all in this pg_data directory on the external drive. Postgres is normally installed under C:/ProgramFiles...
It works all fine. Now i wondered if it is possible to use this same database also when I am at home at my normal computer? I would like to configure Postgres that way that I can also connect the external drive to my home computer, but I don't know how to set it up that postgres "sees" this databases created with "another postgres" (from my notebook). Is this possible or do I have to use another db on my home computer?
greetings goofkiller

Re: Same pg_data for 2 Computers?

PostPosted: Fri Nov 07, 2008 9:01 pm
by Eric Poker
Am not an expert of postgres but I think you do this
But you are probably slowing down pt3 using an external usb HD

Re: Same pg_data for 2 Computers?

PostPosted: Sat Nov 08, 2008 7:08 am
by goofkiller
I dont think it slows pt3 down, because it's a quite new external drive connected to the notebook with e-sata. On the home computer I dont know yet how fast it will be because theres no e-sata-port. Any ideas??

Re: Same pg_data for 2 Computers?

PostPosted: Sat Nov 08, 2008 9:59 am
by kraada
You'd have to edit the postgresql.conf and tell it to look for the data in the right place (set the data_directory entry equal to wherever your pg_data directory is on the spare hard drive and take out the # at the front of the line) and then when you restart PostgreSQL (with the drive attached) it should locate the drive properly.

PLEASE NOTE you must turn off PostgreSQL before ejecting and removing the drive because if you don't it could lead to database corruption and an unusable database. Always shut down PostgreSQL before ejecting the disk.

I don't know the speeds of e-sata so I can't really comment on how efficient this is going to be, but good luck and let me know how it works.

Re: Same pg_data for 2 Computers?

PostPosted: Sat Nov 08, 2008 11:48 am
by goofkiller
Thanks for the help. I tried to edit the postgres.conf, but I didnt work and pt3 could not connect anymore...
Is this written correctly : data_directory = P:/Dirname/Dirname/pg_data
I also tried it with the ' ': data_directory = 'P:/Poker/Database/pg_data'
but both versions didnt work. What could be the problem?

Thanks for the advice with turning off PostgresSQL, but I am now using the database on the external drive since a month or something on my notebook and there I never turned off postgres first and I worked fine all the time. The performance is very good in my opinion, with my e-sata drive I dont experience a difference to the normal hdd..

Re: Same pg_data for 2 Computers?

PostPosted: Sat Nov 08, 2008 12:21 pm
by kraada
For windows paths you need to use \s not /s
So you'd want:
data_directoy = "P:\Poker\Database\pg_data\"

and that should do it.

Re: Same pg_data for 2 Computers?

PostPosted: Sat Nov 08, 2008 10:00 pm
by Eric Poker
esata is probably the same speed of regular sata
you can try the speed of the disk with www.hdtune.com free version