You may have to recompile (open)SER to get the postgres.so module.
make include_modules=”postgres”
A minimal postgresql setup:
$ createdb ser
$ psql -U postgres ser
ser=# CREATE TABLE subscriber (
username varchar(32),
domain varchar(32),
password varchar(16),
PRIMARY KEY (username, domain)
);
ser=# create user ser with password ‘mypass’;
ser=# grant all on table subscriber to ser;
$ psql -U postgres ser
ser=# CREATE TABLE subscriber (
username varchar(32),
domain varchar(32),
password varchar(16),
PRIMARY KEY (username, domain)
);
ser=# create user ser with password ‘mypass’;
ser=# grant all on table subscriber to ser;
and to add users manually
ser=# insert into subscriber values (‘user’, ‘domain_or_realm’, ‘pass’);
make sure these are in ser.cfg
loadmodule “/usr/lib/ser/modules/postgres.so”
loadmodule “/usr/lib/ser/modules/usrloc.so”
loadmodule “/usr/lib/ser/modules/auth.so”
loadmodule “/usr/lib/ser/modules/auth_db.so”
modparam(“usrloc”, “db_mode”, 0) # not using postgresql for usrloc database, in memory only
modparam(“auth_db”, “calculate_ha1”, 1)
modparam(“auth_db”, “password_column”, “password”)
modparam(“auth_db”,”db_url”, “sql://ser:mypass@localhost:5432/ser”)
loadmodule “/usr/lib/ser/modules/usrloc.so”
loadmodule “/usr/lib/ser/modules/auth.so”
loadmodule “/usr/lib/ser/modules/auth_db.so”
modparam(“usrloc”, “db_mode”, 0) # not using postgresql for usrloc database, in memory only
modparam(“auth_db”, “calculate_ha1”, 1)
modparam(“auth_db”, “password_column”, “password”)
modparam(“auth_db”,”db_url”, “sql://ser:mypass@localhost:5432/ser”)
Please note that later versions (=> 0.9.x) of SER require a change to the db_url:
modparam(“auth_db”,”db_url”, “postgres://ser:mypass@localhost:5432/ser”)