Reputation: 11899
Is it possible to define a temporal (i.e. time/date based trigger) in PostgreSQL?
Consider I store a table with some data, that also contains a field for timestamp
.
This timestamp field is the date/time that I want a certain function to be triggered?
Is it possible to associate a trigger with this table, that can execute the desired trigger at the given time?
Upvotes: 1
Views: 930
Reputation: 656391
Or use cron-jobs on a UNIX / LINUX systems. Something like
psql -p5432 mydb -c 'SELECT myfunction()'
as system user postgres
which is set up to log in without password.
Upvotes: 1
Reputation:
No, this is not possible. Triggers are only fired through SQL statements (INSERT, UPDATE, DELETE)
Upvotes: 0