Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cf60b61

Browse files
committed
Merge branch 'master' of github.com:zhanghe06/python
2 parents 2d054dc + a9db6db commit cf60b61

1 file changed

Lines changed: 47 additions & 0 deletions

File tree

README.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -692,6 +692,14 @@ col: 字段名
692692
drop index idx_tab_col
693693
```
694694

695+
虽然索引的目的在于提高数据库的性能,有时间时,应避免。使用索引时,应重新考虑下列准则:
696+
697+
- 索引不应该被用于小表上。
698+
- 有频繁的,大批量的更新或插入操作的表。
699+
- 索引不应使用含有大量的NULL值的列。
700+
- 频繁操作的列都将不建议使用索引。
701+
702+
695703
psql 是一个普通的 PostgreSQL 客户端应用。
696704

697705
为了与一个数据库联接,你需要知道你的目标数据库, 服务器的主机名和端口号以及你希望以哪个用户的身份进行联接等信息。
@@ -703,6 +711,45 @@ psql 是一个普通的 PostgreSQL 客户端应用。
703711
所以,上面远程连接可以有很多写法,是很方便,但是建议指明参数,后面调试起来方便。
704712

705713

714+
postgresql 版本升级
715+
716+
https://www.postgresql.org/download/linux/ubuntu/
717+
718+
```
719+
$ sudo vim /etc/apt/sources.list.d/pgdg.list
720+
```
721+
添加以下内容并保存
722+
```
723+
deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main
724+
```
725+
726+
Import the repository signing key, and update the package lists
727+
```
728+
$ wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
729+
$ sudo apt-get update
730+
```
731+
732+
确认当前 postgresql 服务是否关闭,并卸载旧版本,安装新版
733+
```
734+
$ netstat -ant | grep 5432
735+
$ sudo service postgresql stop
736+
```
737+
738+
修改旧版本端口号为5433, 再安装新版本, 新版本端口号才能为5432
739+
740+
否则新版本端口号会默认为5433
741+
742+
```
743+
$ sudo apt-get remove postgresql-9.3
744+
$ sudo apt-get install postgresql-9.5
745+
```
746+
747+
```
748+
$ sudo vim /etc/postgresql/9.5/main/postgresql.conf
749+
$ sudo vim /etc/postgresql/9.5/main/pg_hba.conf
750+
```
751+
752+
706753
## Python MongoDB
707754

708755
mongo数据库安装(包含服务端/客户端)

0 commit comments

Comments
 (0)