需要安装的插件的名字:pgcrypto
stackoverflow:
具体步骤:
1.add the extensions: create extension pgcrypto
2.check the extensions: select * from pg_available_extensions
![](https://images2017.cnblogs.com/blog/980658/201709/980658-20170906090516882-967543630.png)
3.use the extensions: select '{SHA}'||encode(digest('test', 'sha1'), 'base64');
![](https://images2017.cnblogs.com/blog/980658/201709/980658-20170906090436741-1815108749.png)