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?
Open the postgresql configuration file in any text edit. The default file location is C:\Program Files\PostgreSQL\<version>\data. Change the port number in the Connections and Authentication section of the configuration file. Choose File > Save to save the new port number.
As an alternative you can go to Control Panel -> Systems and Security -> Windows Firewall -> Allow a program or feature through Windows Firewall -> Advanced Settings -> New Rule: Rule Type: Port. TCP or UDP: TCP. Specific local ports: 5432.
By default, the Postgresql database listens on port 5432.
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 = '*'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With