How to configure PostgreSQL to accept all incoming connections

后端 未结 5 1025
情话喂你
情话喂你 2020-11-28 01:45

I\'ve got a PostgreSQL data base that I\'d like to configure to accept all incoming connections regardless of the source IP address. How can this be configured in the pg_hba

5条回答
  •  孤城傲影
    2020-11-28 02:08

    Just use 0.0.0.0/0.

    host    all             all             0.0.0.0/0            md5
    

    Make sure the listen_addresses in postgresql.conf (or ALTER SYSTEM SET) allows incoming connections on all available IP interfaces.

    listen_addresses = '*'
    

    After the changes you have to reload the configuration. One way to do this is execute this SELECT as a superuser.

    SELECT pg_reload_conf();
    

提交回复
热议问题