Encounter installation problems on postgres 12 i install postgres-12,but report this error,i have execute sudo systemctl restart postgresql-12 ,and follow this install postgres12 on centos 7, and when i step into Step 5: Enable remote access,and execute sudo systemctl restart postgresql-12 it report error
[root@localhost ~]# systemctl status postgresql-12
● postgresql-12.service - PostgreSQL 12 database server
   Loaded: loaded (/usr/lib/systemd/system/postgresql-12.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Sun 2020-10-25 12:29:05 CST; 11min ago
     Docs: https://www.postgresql.org/docs/12/static/
  Process: 7462 ExecStart=/usr/pgsql-12/bin/postmaster -D ${PGDATA} (code=exited, status=1/FAILURE)
  Process: 7456 ExecStartPre=/usr/pgsql-12/bin/postgresql-12-check-db-dir ${PGDATA} (code=exited, status=0/SUCCESS)
 Main PID: 7462 (code=exited, status=1/FAILURE)

Oct 25 12:29:05 localhost.localdomain systemd[1]: Starting PostgreSQL 12 database server...
Oct 25 12:29:05 localhost.localdomain systemd[1]: postgresql-12.service: main process exited, code=exited, status...LURE
Oct 25 12:29:05 localhost.localdomain systemd[1]: Failed to start PostgreSQL 12 database server.
Oct 25 12:29:05 localhost.localdomain systemd[1]: Unit postgresql-12.service entered failed state.
Oct 25 12:29:05 localhost.localdomain systemd[1]: postgresql-12.service failed.
Hint: Some lines were ellipsized, use -l to show in full.

[root@localhost ~]# journalctl -xe
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit postgresql-12.service has begun starting up.
Oct 25 12:56:02 localhost.localdomain postmaster[7586]: 2020-10-25 12:56:02.994 CST [7586] LOG:  starting PostgreSQL 12.4 on x86_64-pc-linux-gnu, compile
Oct 25 12:56:02 localhost.localdomain postmaster[7586]: 2020-10-25 12:56:02.995 CST [7586] LOG:  could not bind IPv4 address &quot;172.18.56.1&quot;: Cannot assign
Oct 25 12:56:02 localhost.localdomain postmaster[7586]: 2020-10-25 12:56:02.995 CST [7586] HINT:  Is another postmaster already running on port 5432? If 
Oct 25 12:56:03 localhost.localdomain postmaster[7586]: 2020-10-25 12:56:02.995 CST [7586] WARNING:  could not create listen socket for &quot;172.18.56.1&quot;
Oct 25 12:56:03 localhost.localdomain postmaster[7586]: 2020-10-25 12:56:02.995 CST [7586] FATAL:  could not create any TCP/IP sockets
Oct 25 12:56:03 localhost.localdomain postmaster[7586]: 2020-10-25 12:56:02.995 CST [7586] LOG:  database system is shut down
Oct 25 12:56:02 localhost.localdomain systemd[1]: postgresql-12.service: main process exited, code=exited, status=1/FAILURE
Oct 25 12:56:03 localhost.localdomain systemd[1]: Failed to start PostgreSQL 12 database server.
-- Subject: Unit postgresql-12.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit postgresql-12.service has failed.
-- 
-- The result is failed.
Oct 25 12:56:03 localhost.localdomain systemd[1]: Unit postgresql-12.service entered failed state.
Oct 25 12:56:03 localhost.localdomain systemd[1]: postgresql-12.service failed.
Oct 25 12:56:03 localhost.localdomain sudo[7572]: pam_unix(sudo:session): session closed for user root
Oct 25 12:56:03 localhost.localdomain polkitd[3564]: Unregistered Authentication Agent for unix-process:7574:595409 (system bus name :1.50, object path /
lines 2127-2149/2149 (END)
Your log lines are truncated (use --no-pager with journalctl when you want the full output) but the full error message that is the most relevant is probably:

2020-10-25 12:56:02.995 CST [7586] LOG: could not bind IPv4 address &quot;172.18.56.1&quot;: Cannot assign [truncated here] requested
address

You did not mention what you set listen_addresses to, but a plausible explanation for this error is that it's set to 172.18.56.1, and this address is not assigned to a network interface of the host, so it's a mistake to use it in   listen_addresses.
Use ifconfig or ip a list to see the network addresses on the host.