使用pgcli实现PostgreSQL命令自动补全功能

安装和配置python-3.9.0可以参考下述文章

使用mycli实现MySQL命令自动补全功能(Python-3.9.0)

下面我们直接来安装pgcli

1
pip install pgcli

安装号后使用pgcli登陆的时候会发现有个报错

这里我们参考提示移动下这个文件的位置就好了

1
mv /root/.pgclirc /root/.config/pgcli/

然后登陆到postgres用户来登陆我们的postgresql

1
2
3
4
#登陆postgres用户
su - postgres
#登陆postgresql数据库
pgcli