创建用户

CREATE USER tom WITH PASSWORD 'myPassword';

创建数据库

CREATE DATABASE jerry;

为用户指派数据库管理权限

GRANT ALL ON DATABASE jerry to tom;

Docker 访问

~ $ sudo docker run -it --rm --link postgres:postgres arm32v7/postgres psql -h postgres -U postgres
Password for user postgres: 
psql (10.3 (Debian 10.3-1.pgdg90+1))
Type "help" for help.

postgres=#