需要安装的插件的名字:pgcrypto
stackoverflow:
具体步骤:
1.add the extensions:
create extension pgcrypto
2.check the extensions:
select * from pg_available_extensions
![](https://i-blog.csdnimg.cn/blog_migrate/0fcd895882ac843bbeaa075fda7d14f0.png)
3.use the extensions:
select '{SHA}'||encode(digest('test', 'sha1'), 'base64');
![](https://i-blog.csdnimg.cn/blog_migrate/5bb0497c4c84830477c0c7a142844150.png)