需要安装的插件的名字:pgcrypto
官网地址:https://www.postgresql.org/docs/9.4/static/pgcrypto.html
stackoverflow:
https://stackoverflow.com/questions/8000740/how-do-i-install-pgcrypto-in-postgresql-9-1-on-windows/46046367#46046367
https://stackoverflow.com/questions/2647158/how-can-i-hash-passwords-in-postgresql
具体步骤:
1.add the extensions: create extension pgcrypto
2.check the extensions: select * from pg_available_extensions
3.use the extensions: select '{SHA}'||encode(digest('test', 'sha1'), 'base64');