「PostgreSQL」- 入门

  CREATED BY JENKINSBOT

常用操作

查看所有数据库:\list
创建数据库:CREATE DATABASE databasename;
选择数据库:\connect databasename

查看表:\dt
创建表:CREATE TABLE tablename (id INTEGER PRIMARY KEY, name VARCHAR);

查看用户:\du
创建用户:CREATE USER username;
修改用户密码:\passwd username
授权用户:GRANT ALL PRIVILEGES ON DATABASE databasename TO username;

参考文献

DIY: A PostgreSQL database server setup anyone can handle
PostgreSQL命令语法大全
How to List Databases and Tables in PostgreSQL Using psql