rlm_sql_postgresql: 42804: DATATYPE MISMATCH

Igor Sousa igorvolt at gmail.com
Fri Sep 29 16:03:51 CEST 2017

Hi everyone,

I configured my freeradius (3.0.15) to do authenticating and authorization,
it has been working well. When I've tried to configure it to accounting
using postgresql database, freeradius doesn't register accounting in
database because occurs the fatal error below:

*(17) sql: rlm_sql_postgresql: ERROR:  column "acctstarttime" is of type
timestamp with time zone but expression is of type integer*
*(17) sql: rlm_sql_postgresql: LINE 1: ...1ac', '<user-name>', '',
'<nas-ip>', '', '', (1506692296...*
*(17) sql: rlm_sql_postgresql:
*(17) sql: rlm_sql_postgresql: HINT:  **You will need to rewrite or cast
the expression**.*
*(17) sql: SQL query returned: need alt query*
*(17) sql: No additional queries configured*
*rlm_sql (sql): Released connection (2)*

I understand that occurs because rlm_sql_postgresql is waiting for a
timestamp, but received a integer. I see that debug gives me a hint "*You
will need to rewrite or cast the expression" *. This modifications should
do in mods-config/sql/main/postgresql/queries.conf? How do I do it? I'm a
newbie about accounting configuration.

PS: Freeradius connects to database correctely.

*Connected to database 'radius' on 'localhost' server version 90413,
protocol version 3, backend PID 22463 *

Thanks for your attention,
Igor Sousa

More information about the Freeradius-Users mailing list