使用Mac上的PostgreSQL
安装
$ brew install postgresql
服务器启动
$ postgres -D /usr/local/var/postgres
启动客户端
$ psql
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
检查客户端版本
$ psql --version
psql (PostgreSQL) 11.3
从客户端连接到服务器(Docker)。
$ psql -h localhost -U postgres
psql (11.3, server 10.7 (Debian 10.7-1.pgdg90+1))
Type "help" for help.
postgres=#