How to insert daily average of a column into another column of another table(postgresql)
I have a machine that sends data every 3 minutes and i store that in a table called "machine_data" in postgresql. i need to get 10 minutes ,hourly,daily, monthly and yearly average of data column and store that in another table with columns of ( 10minutes_avg,hourly_avg ,daily_avg , ...) for these periodic tasks i wanted to use pgagent in postgresql but i didn't know how to write the code.
note1: i have datetime field(2023-01-01 9:42:10+3:30)
note2: additional note: i use django for getting and storing data , and i used many modules for scheduled tasks but i didn't get good results.