在第一次启动服务后,或者,后面重新启动,执行命令:pg_ctl restart
C:\Users\Administrator>pg_ctl restart
等待2019-11-17 15:53:34.949 HKT [39312] LOG: received fast shutdown request
服务器进程关闭 ....2019-11-17 15:53:35.061 HKT [39312] LOG: aborting any active transactions
2019-11-17 15:53:35.095 HKT [39312] LOG: background worker "logical replication launcher" (PID 39432) exited with exit code 1
2019-11-17 15:53:35.100 HKT [39536] LOG: shutting down
2019-11-17 15:53:35.291 HKT [39312] LOG: database system is shut down
完成
服务器进程已经关闭
等待服务器进程启动 ....2019-11-17 15:53:35.671 HKT [17888] LOG: starting PostgreSQL 12.0, compiled by Visual C++ build 1914, 64-bit
2019-11-17 15:53:35.685 HKT [17888] LOG: listening on IPv6 address "::1", port 5432
2019-11-17 15:53:35.686 HKT [17888] LOG: listening on IPv4 address "127.0.0.1", port 5432
2019-11-17 15:53:35.878 HKT [39672] LOG: database system was shut down at 2019-11-17 15:53:35 HKT
2019-11-17 15:53:36.179 HKT [17888] LOG: database system is ready to accept connections
完成
服务器进程已经启动
然后执行命令:psql -U postgres (进入超级用户)
C:\Users\Administrator>psql -U postgres
psql (12.0)
输入 "help" 来获取帮助信息.
postgres=# quit
执行命令:quit