1. 查看数字库和表

切换用户postgres
su postgres
执行psql进入后台(就像执行mysql进入后台一样)

2. 更新postgres密码

\password

3. 创建数据库用户及密码

create user 用户名称 with password '123456';

4. 创建数据库及所有者

create database 数据库名称 owner 用户名称;

5. 删除数据库用户

drop user 用户名称

6. 查看数据库列表

\l

7. 查看数据库列表的详细信息

\l+

8. 查看当前数据库用户信息

\du

9. 查看当前数据库中的所有数据表

\dt

10. 查看单张数据表的结构

\d 表名

11. 修改数据表的某一列名称

alter table cdr rename column account_code to accoutcode;

12. 持续更新...

相关文章:

  • 2021-11-22
  • 2021-11-18
  • 2022-01-24
  • 2021-06-25
  • 2021-09-17
  • 2022-12-23
  • 2021-11-24
  • 2022-01-29
猜你喜欢
  • 2021-11-07
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-01
相关资源
相似解决方案