 sudo -u postgres psql -c "ALTER SYSTEM SET password_encryption = 'scram-sha-256';"
ALTER SYSTEM
[root@ids deployment]# systemctl restart postgresql
[root@ids deployment]# sudo -u postgres psql << EOF
DROP USER IF EXISTS ids_user;
CREATE USER ids_user WITH PASSWORD 'TestPassword123';
GRANT ALL PRIVILEGES ON DATABASE ids_database TO ids_user;
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO ids_user;
GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public TO ids_user;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL ON TABLES TO ids_user;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL ON SEQUENCES TO ids_user;
EOF
ERROR:  role "ids_user" cannot be dropped because some objects depend on it
DETAIL:  privileges for database ids_database
ERROR:  role "ids_user" already exists
GRANT
GRANT
GRANT
ALTER DEFAULT PRIVILEGES
ALTER DEFAULT PRIVILEGES
[root@ids deployment]# export PGPASSWORD="TestPassword123"
[root@ids deployment]# psql -h localhost -U ids_user -d ids_database -c "SELECT 1;"
psql: error: FATAL:  password authentication failed for user "ids_user"
[root@ids deployment]# tail -30 /var/lib/pgsql/data/log/postgresql-*.log | grep -i "ids_user"
2025-11-17 17:21:00.789 CET [59154] FATAL:  password authentication failed for user "ids_user"
2025-11-17 17:21:00.789 CET [59154] DETAIL:  User "ids_user" does not have a valid SCRAM secret.
2025-11-17 17:22:28.055 CET [59160] FATAL:  password authentication failed for user "ids_user"
2025-11-17 17:22:28.055 CET [59160] DETAIL:  User "ids_user" does not have a valid SCRAM secret.
2025-11-17 17:23:42.513 CET [59171] FATAL:  password authentication failed for user "ids_user"
2025-11-17 17:23:42.513 CET [59171] DETAIL:  User "ids_user" does not have a valid SCRAM secret.
2025-11-17 17:26:40.293 CET [59224] ERROR:  role "ids_user" cannot be dropped because some objects depend on it
2025-11-17 17:26:40.293 CET [59224] STATEMENT:  DROP USER IF EXISTS ids_user;
2025-11-17 17:26:40.293 CET [59224] ERROR:  role "ids_user" already exists
2025-11-17 17:26:40.293 CET [59224] STATEMENT:  CREATE USER ids_user WITH PASSWORD 'TestPassword123';
2025-11-17 17:27:06.520 CET [59226] FATAL:  password authentication failed for user "ids_user"
2025-11-17 17:27:06.520 CET [59226] DETAIL:  User "ids_user" does not have a valid SCRAM secret.