我想做的是创建一个类似这样的用户:
CREATE USER "martin" WITH PASSWORD '$kH3l2bj8iT$KKrTAKDF4OoE7w.oy(...)BPwcTBN/V42hqE.';
有什么办法吗?
感谢您的帮助。
您可以提供已使用md5哈希的密码,如文档( CREATE ROLE)中所述:ENCRYPTED UNENCRYPTED These key words control whether the password is
stored encrypted in the system catalogs. (If neither is specifIEd,the
default behavior is determined by the configuration parameter
password_encryption.) If the presented password string is already in
MD5-encrypted format,then it is stored encrypted as-is,regardless of
whether ENCRYPTED or UNENCRYPTED is specifIEd (since the system cannot
decrypt the specifIEd encrypted password string). This allows
reloading of encrypted passwords during dump/restore.
这里缺少的信息是MD5加密的字符串应该是用户名连接的密码,加上开头的md5。
例如,使用密码foobar创建u0,知道md5(‘foobaru0’)是ac4bbe016b808c3c0b816981f240dcae:
CREATE USER u0 PASSWORD 'md5ac4bbe016b808c3c0b816981f240dcae';
然后u0将能够通过键入foobar作为密码登录。
我不认为目前有一种方法使用SHA-256而不是md5的Postgresql密码。
总结以上是内存溢出为你收集整理的在PostgreSQL中创建具有加密密码的用户全部内容,希望文章能够帮你解决在PostgreSQL中创建具有加密密码的用户所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)