PDA

View Full Version : Attempting to share postgresql database over my network



realtalk11
09-17-2012, 01:56 PM
Hi guys i bought a new labtop and i want to use hem on both computers and i obv want my postgresql database to be available for both so im trying this tuto

http://faq.holdemmanager.com/questions/90/Run+PostgreSQL+Over+a+Network+

I'm stuck there:


Change the pg_hba.conf file likewise. Go to C:\Program Files\PostgreSQL\8.x\data, move the pg_hba.conf file to your Desktop and open it with notepad.

Add a line like host/all/postgres/0.0.0.0/md5 if you want to access your database from the internet (See also additional steps for Internet access)
Or add a line like host/all/postgres/192.168.2.3 (= Ip-adres laptop)/md5 if you only want to access your database from inside your local network with your laptop/ second computer.
Or add a line like host/all/postgres/192.168.2.0 (= address of your local network)/md5 if your laptop is getting an IP Adres from a DHCP server within your network.
Or add a line like host/all/192.168.2.3/trust if you do not want have anything to do with passwords.
Save it and move the file back to the data folder.
Restart the PostgreSQL service: Control Panel -> Administrative Tools -> Services

I try to do that but then postgresql service wont start again and i can't access my database anymore until i remove the line in the pg_hba file.

Am i doing something wrong ?

I assigned a static ip adress to my 1st pc (desktop) should i do the same for my labtop )

thanks a lot trying to get this figured out

Patvs
09-17-2012, 08:42 PM
I've forwarded (via email) your question to the tech team to respond to.

netsrak
09-18-2012, 04:55 AM
you probably made a typo in the new line in the pg_hba.conf file, the new line needs to look like this:

host all all 10.0.2.2/32 md5

where 10.0.2.2 should be replaced by the ip of your laptop.
Save this file, copy it back and start the service.