Accounting Start Time in Interim-Update of queries.conf is written differently between MySQL and Postgresql
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.
On Aug 18, 2023, at 5:40 AM, Ibrahim Al Mahfooz <ibrahim.nezar@sevennet.net> wrote:
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}, \
It's that way in mssql and Oracle, too. Those need fixing.
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}), \
I'll push a fix.
Any reason why it is not written with the same logic of MySQL queries file?
It was missed I guess.
Will the change I made impose any risks or issues down the road?
No. Alan DeKok.
participants (2)
-
Alan DeKok -
Ibrahim Al Mahfooz