Thread: Timer modules within PostgreSQL
I seek your opinion in implementing a timer event manger within PostgreSQL, as a backend progress. I understand that PgAgent can do scheduling, but I look for second time resolution.
a) User registers timer events by inserting records in a system table. Timer can be absolute (such as 2013-Aug-31 08:30:00) or relative (next 30 minute from the time the event is activated or enabled)
b) Task(s) to be performed are stored in the system table in term of stored procedure.
c) If second time resolution is needed, the stored procedure could just send signals to notified a long-running process.
My questions:
a) The easiest way to write a backend process.
b) The memory model of Python stored procedures. If user creates a long-running python process, what is the impact to the postmaster or process that calls the python stored procedure on behalf of the user?
Any recommendation?
Also, I want a faster response within PostgreSQL database.
The timer manager suppose:a) User registers timer events by inserting records in a system table. Timer can be absolute (such as 2013-Aug-31 08:30:00) or relative (next 30 minute from the time the event is activated or enabled)
b) Task(s) to be performed are stored in the system table in term of stored procedure.
c) If second time resolution is needed, the stored procedure could just send signals to notified a long-running process.
My questions:
a) The easiest way to write a backend process.
b) The memory model of Python stored procedures. If user creates a long-running python process, what is the impact to the postmaster or process that calls the python stored procedure on behalf of the user?
Any recommendation?