postgreSQL命令大全(更新中)

1.PostgreSQL索引的建立https://blog.csdn.net/jubaoquan/article/details/78850899

 

2.PostgreSQL9中索引的原理和效率查询https://yq.aliyun.com/articles/111793?utm_content=m_24486

 

3.删除索引

DROP INDEX index;  

index是要删除的索引名

注意 : 无法删除DBMS为主键约束和唯一约束自动创建的索引

 

4.PostgreSQL命令行向表中插入多组数据

SPJ=# insert into S(sno,sname,status,city) values('S1','精益',20,'天津'),
SPJ-# ('S2','盛锡',10,'北京'),
SPJ-# ('S3','东方红',30,'北京'),
SPJ-# ('S4','丰泰盛',20,'天津'),
SPJ-# ('S5','为民',30,'上海');
INSERT 0 5
SPJ=# select *
SPJ-# from s;
 sno | sname  | status | city
-----+--------+--------+------
 S1  | 精益   |     20 | 天津
 S2  | 盛锡   |     10 | 北京
 S3  | 东方红 |     30 | 北京
 S4  | 丰泰盛 |     20 | 天津
 S5  | 为民   |     30 | 上海
(5 行记录)

 

5.psql: 致命错误: 用户 "ASUS" Password 认证失败

如果发生这样的错误,意味着你的命令行少写了一个 -U

psql -h localhost -U postgres -d "student" < "d:\student.sql"

 

6.数据库表有NOT NULL,DEFAULT,CHECK,UNIQUE,PRIMARY KEY,FOREIGN KEY六种约束。https://www.cnblogs.com/alianbog/p/5371252.html

 

7.给Postgresql已经存在的表中的列删除或者添加默认值https://blog.csdn.net/dynadotwebb/article/details/42870231

 

8.PostgreSQL 添加各种约束语法https://blog.csdn.net/luojinbai/article/details/44876969

 

9.PostgreSQL 10.1 手册http://www.postgres.cn/docs/10/index.html

posted @ 2019-10-23 16:37  kangobs  阅读(914)  评论(0编辑  收藏  举报