?
Solved

stored procedures in postgre || how to script and where

Posted on 2012-03-23
2
Medium Priority
?
1,082 Views
Last Modified: 2012-04-11
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
Comment
Question by:hibbsusan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 22

Accepted Solution

by:
earth man2 earned 2000 total points
ID: 37762245
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
 
LVL 22

Expert Comment

by:earth man2
ID: 37762262
0

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question