views:

145

answers:

1

hi guys,

How do i change the default listening port 5432 of postgresql to another number?

Another question,

What steps do i have do to allow remote r/w access to the database using python pyscopg2?

+2  A: 

Just change the setting in the file postgresql.conf (can be found in the data directory):

port = 5433             # (change requires restart)

Remote access can be given by changing pg_hba.conf, just add the ip-address. You also have to edit postgresql.conf:

listen_addresses = '*'
Frank Heikens
if i give need to give access to the clients in my subnet, i need to do something like this right --> my ip is 172.17.163.108 and my subnet mask is 255.255.128.0, so i should add in line likehost<tab>all<tab>all<tab>172.17.128.0/17<tab> trust right?
goh
That's correct, and you also have to change the listen_addresses in postgresql.conf. I wouldn't use "trust", only md5. Passwords don't hurt.
Frank Heikens
that's strange, because i try accessing with another laptop, it says the server is not listening at the port. I should use the ip address as stated in the ipconfig correct? does the port number matters? i've set the port to 1683, but i open the port for tcp.. btw im using windows
goh
hmm i got it. the school doesnt allow client to client wireless connections
goh