On 03/01/2023 22:24, Conrad Classen wrote:
However, the table name I have defined in the sql mod file for the radusergroup table is not being used by queries, and it still continues to look for the original table name. I suspect that the table names are hard coded and the FreeRadius server is using that.
None of the SQL queries used by FreeRADIUS are hard coded - they are all in the config for you to amend as suits your case. The only thing set is the order in which columns must be returned. If you have started from the stock raddb, then the queries for PostgreSQL are in mods-config/sql/main/postgresql/queries.conf The group membership query there uses ${usergroup_table} to reference the table to be queried for group membership - typically that is set in mods-enabled/sql: usergroup_table = "radusergroup"
The following from the radiusd -X debug output shows that the table name I have set is not being used.
rlm_sql_postgresql: Status: PGRES_FATAL_ERROR rlm_sql_postgresql: 42P01: UNDEFINED TABLE (5) sql: rlm_sql_postgresql: ERROR: relation "radusergroup" does not exist (5) sql: rlm_sql_postgresql: LINE 1: SELECT GroupName FROM radusergroup WHERE Us... (5) sql: rlm_sql_postgresql: ^ (5) sql: rlm_sql_postgresql: QUERY: SELECT GroupName FROM radusergroup WHERE UserName = NEW.UserName (5) sql: rlm_sql_postgresql: CONTEXT: PL/pgSQL function upd_radgroups() line 7 at SQL statement (5) sql: SQL query returned: need alt query
You either have usergroup_table still set to radusergroup, or you have amended the queries.conf file to specifically refer to radusergroup rather than the expansion ${usergroup_table} Nick -- Nick Porter