Accounting Start Time in Interim-Update of queries.conf is written differently between MySQL and Postgresql

Ibrahim Al Mahfooz ibrahim.nezar at sevennet.net
Fri Aug 18 09:40:37 UTC 2023


Hello,

I'm working on migrating from MySQL to Postgresql and during the process of
customization of accounting section inside queries.conf file of Postgresql,
I found a discrepancy in the accounting start time of the Interim-Update
section made me wondering if there is any reason why not written in the
same logic as MySQL queries.conf file, here is what I'm referring to:

FR Version: 3.2.3
File paths:
1. Postgresql: /etc/raddb/mods-config/sql/main/postgresql/queries.conf
2. MySQL/etc/raddb/mods-config/sql/main/mysql/queries.conf

The differences are in the accounting start time inside the interim-update
section:
- In mysql it is written as:
FROM_UNIXTIME(${....event_timestamp_epoch} - %{%{Acct-Session-Time}:-0}), \

- While in postgresql it is:
${....event_timestamp}, \

I found that the line in postgresql queries actually causing the start to
be inaccurate since it will reflect current time while it should reflect
the elapsed time (current time - accounting session time)

Having this, I had to change the line to this and it seems to be working:
TO_TIMESTAMP(${....event_timestamp_epoch} - %{%{Acct-Session-Time}:-0}), \

Any reason why it is not written with the same logic of MySQL queries file?
Will the change I made impose any risks or issues down the road?

Thanks.


More information about the Freeradius-Users mailing list