1

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?

3 Answers 3

1

This is what pgAgent does.

Sign up to request clarification or add additional context in comments.

Comments

1

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.

Comments

0

No, this is not possible. Triggers are only fired through SQL statements (INSERT, UPDATE, DELETE)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.