• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1104
  • Last Modified:

stored procedures in postgre || how to script and where

I understand that phpPgAdmin cannot call stored procedures on a schedule. I assume I can create a stored procedure in the same way as mySQL since, near as I can tell, the databases have pretty much identical functionality.

But how could I call a procedure every one minute or so. Is the windows task scheduler the best bet? Or should I write it in php and make it a cronjob?

Will SQLserver interfere with php (and vice versa) if they are both attempting to interact with the database at the same time? (connection loss/slowdown)

Thanks!
0
hibbsusan
Asked:
hibbsusan
  • 2
1 Solution
 
earth man2Commented:
the command line program psql.exe ( psql on Linux ) allows you to call a stored procedure from a script or os one-liner.

Windows has command

at

which allows you to schedule jobs to run at particular times.

Your last point depends on how you define "interfere".  Connection loss should never happen unless something beyond your control occurs or you are trying to do too much with too little !

PostgreSQL is designed as a multi user database.  However when two agents are modifying the database concurrently, what that database looks like to a third party is difficult to define at any point in time.  Many large sites will create master slave DB configurations using log shipping.  You can suspend log shipping if you absolutely must have a static dataset at a point in time and query the slave database that is no longer being kept in sync....

See  -- such a simple question, such a complicated answer.  See documentation for WAL, "log shipping", Slony, pgpool, Bucardo for more details.
0
 
earth man2Commented:
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now