Same pg_data for 2 Computers?

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

Same pg_data for 2 Computers?

Postby goofkiller » Fri Nov 07, 2008 8:04 pm

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
goofkiller
 
Posts: 3
Joined: Sat Jun 21, 2008 9:03 am

Re: Same pg_data for 2 Computers?

Postby Eric Poker » Fri Nov 07, 2008 9:01 pm

Am not an expert of postgres but I think you do this
But you are probably slowing down pt3 using an external usb HD
Eric Poker
 
Posts: 104
Joined: Sat Mar 15, 2008 3:47 pm

Re: Same pg_data for 2 Computers?

Postby goofkiller » Sat Nov 08, 2008 7:08 am

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??
goofkiller
 
Posts: 3
Joined: Sat Jun 21, 2008 9:03 am

Re: Same pg_data for 2 Computers?

Postby kraada » Sat Nov 08, 2008 9:59 am

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.
kraada
Moderator
 
Posts: 54431
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: Same pg_data for 2 Computers?

Postby goofkiller » Sat Nov 08, 2008 11:48 am

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..
goofkiller
 
Posts: 3
Joined: Sat Jun 21, 2008 9:03 am

Re: Same pg_data for 2 Computers?

Postby kraada » Sat Nov 08, 2008 12:21 pm

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.
kraada
Moderator
 
Posts: 54431
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: Same pg_data for 2 Computers?

Postby Eric Poker » Sat Nov 08, 2008 10:00 pm

esata is probably the same speed of regular sata
you can try the speed of the disk with www.hdtune.com free version
Eric Poker
 
Posts: 104
Joined: Sat Mar 15, 2008 3:47 pm


Return to PostgreSQL [Read Only]

Who is online

Users browsing this forum: No registered users and 28 guests

cron