需要安裝的插件的名字: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');

?