til icon indicating copy to clipboard operation
til copied to clipboard

PostgreSQL authentication methods

Open xluffy opened this issue 1 year ago • 0 comments

image

> select rolname, rolpassword from pg_authid

We don't need to generate hash password for Pgbouncer

# How to create an MD5 password for pgbouncer
# Linux:
#   - echo -n "md5"; echo -n "password123admin" | md5sum | awk '{print $1}'
# Python 3:
#   - print("md5" + hashlib.md5(b"password123" + b"admin").hexdigest()

https://www.crunchydata.com/blog/pgbouncer-scram-authentication-postgresql

Update password hash

psql> SHOW password_encryption;
 password_encryption
---------------------
 scram-sha-256
(1 row)

psql> \password <user>

xluffy avatar Oct 25 '23 06:10 xluffy