Tell me more ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I would like to call a stored procedure on a regular basis. On Oracle, I would create a job for this. I have found that Postgresql can mimic this well by using an external tool (cron etc) and PgAgent.

Do you know of an "internal" alternative which wouldn't involve the external tool ?

  • I want to avoid security concerns with the password stored on the command line of the pgAgent.
  • I want to avoid any additional system configuration for hiding the password (~/.pgpass).

Postgresql 8.3
Linux RedHat 64bit

share|improve this question
Can you add why you can't use pgAgent or crontab? specifically what features are missing.. – Rohan 2 days ago
@Rohan I have updated my question – Alex 2 days ago
Post seems to have been copied and pasted to stackoverflow.com/q/16958625/398670 – Craig Ringer 2 days ago

1 Answer

up vote 1 down vote accepted

Even if you were running the soon-to-be-released PostgreSQL 9.3 or the current PostgreSQL 9.2 not an ancient release like 8.3, there's still no built-in task scheduler.

Something like PgAgent or external cron jobs is required, there is no convenient workaround.

The background workers feature introduced in 9.3 should hopefully permit a tool like PgAgent to be moved into the PostgreSQL core in a later release, but it hasn't been done yet. Even on 9.3 you still have to run cron or pgagent.

Please take a look at the version policy, too; you're running an obsolete and unsupported release.

share|improve this answer
Please take a look at the version policy, upgrading Postgresql is not an option. – Alex 2 days ago
1  
@Alex You're going to have to upgrade at some point, and it's only going to get harder. What 8.3 point release, by the way? How many significant bug fixes are you missing? Or are you at least on 8.3.23? That said, as I explained the feature you want doesn't exist even in the coming 9.3 release, though some of the groundwork to permit its addition has been added. – Craig Ringer 2 days ago
I'll have a talk with my boss :) – Alex 2 days ago
@Alex Good idea :-) . At minimum update to 8.3.23 urgently, then start working on upgrade plans to a newer release. It won't solve this question, but it's a very good idea to save future pain. The number of customers I support who're having problems they would never have had if they just stayed current is amazing. We don't release new versions just for kicks ;-) . Read the release notes for each .0 version for guidance on things you might need to deal with, and read the manual on upgrading. Your only likely pain points are standard_conforming_strings and bytea_output. – Craig Ringer 2 days ago

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.