添加用户
create user <用户名> with password ‘<密码>‘;
创建数据库并指定所属用户
create database django_test owner <用户名>;
切换数据库
postgres=# \c kydb
切换用户
postgres=# \c - kysystem
查询所有数据库
postgres=# \l
查询所有表
postgres=# select * from pg_tables;
查询表结构
postgres=# \d <表名称>;
原文:https://www.cnblogs.com/rn-05181226-rw/p/12418348.html