Solved

stored procedures in postgre || how to script and where

Posted on 2012-03-23
2
1,060 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 500 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

Do you have a plan for Continuity?

It's inevitable. People leave organizations creating a gap in your service. That's where Percona comes in.

See how Pepper.com relies on Percona to:
-Manage their database
-Guarantee data safety and protection
-Provide database expertise that is available for any situation

Question has a verified solution.

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

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
I have a large data set and a SSIS package. How can I load this file in multi threading?
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

688 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