Login to the console of the Synology NAS, and make a copy of the PostgreSQL configuration, just to be sure:
sudo cp /etc/postgresql/pg_hba.conf /etc/postgresql/pg_hba.conf.orig
sudo cp /etc/postgresql/postgresql.conf /etc/postgresql/postgresql.conf.orig
Then open the following file:
sudo vim /etc/postgresql/postgresql.conf