sourcemod icon indicating copy to clipboard operation
sourcemod copied to clipboard

[PostgreSQL] Database error SCRAM authentication requires libpq version 10 or above

Open ProjectSky opened this issue 2 years ago • 4 comments

  • System: ubuntu 20.04
  • PostgreSQL version: 14.4

try to connect to the database get this error Database error SCRAM authentication requires libpq version 10 or above pgsql extension not support newer version PostgreSQL?

ProjectSky avatar Jul 17 '22 11:07 ProjectSky

The extension is compiled against libpq 9.6.9, because there wasn't an easy way to build static libraries to link against in newer versions. We'd have to revist the state of that now to see if we can upgrade the libpq version.

In the meantime you need to set your password_encryption back to md5 for the extension to work :(

peace-maker avatar Jul 17 '22 14:07 peace-maker

In the meantime you need to set your password_encryption back to md5 for the extension to work :(

even if set password_encryption to md5 extension it doesn't work(same error)

postgres=# SHOW password_encryption;
 password_encryption
---------------------
 md5
(1 row)

postgres=# SELECT pg_reload_conf();
 pg_reload_conf
----------------
 t
(1 row)

auth_method also changed to md5

try new version libpq.a and recompiled pgsql extension, i got undefined symbol: pg_hmac_create

ProjectSky avatar Jul 17 '22 14:07 ProjectSky

You'll have to do more steps than that to rehash your database user's password - at least that's what you can find when searching for that error message. Did you compile libpq statically yourself? What steps did you take to achieve that?

peace-maker avatar Jul 17 '22 15:07 peace-maker

  • download source code for pgsql 14.4 from https://ftp.postgresql.org
  • compile it with CFLAGS='-fPIC -m32' ./configure --without-readline && make -j8

i guess new version may need to link other lib

update: view password still encrypted with SCRAM-SHA-256 use

ALTER ROLE user PASSWORD '****';

extension works after password reset

ProjectSky avatar Jul 17 '22 15:07 ProjectSky