Thread: Stored Procedures

Stored Procedures

From
"Tomá¹ Kubi¹"
Date:
Hello,
 I have some stored procedures written in Pl/PgSQL. I want to run them in
specified time. I need something as Crontab. How can I do that?

Thanks

Tomas



Re: Stored Procedures

From
"Shridhar Daithankar"
Date:
On 7 Oct 2002 at 9:46, TomXX KubiX wrote:
>  I have some stored procedures written in Pl/PgSQL. I want to run them in
> specified time. I need something as Crontab. How can I do that?

Put following in crontab as command to execute

echo "select mystoredprocedure()" | psql dbname

Same can be done via shell redirection but I use this as well..

Tweak it for additional options..

 HTH

Bye
 Shridhar

--
Consent decree:    A document in which a hapless company consents never to commit
in the future whatever heinous violations of Federal law it    never admitted to
in the first place.


Re: Stored Procedures

From
Richard Huxton
Date:
On Monday 07 Oct 2002 8:46 am, Tomá¹ Kubi¹ wrote:
> Hello,
>  I have some stored procedures written in Pl/PgSQL. I want to run them in
> specified time. I need something as Crontab. How can I do that?

A cron-job calling "psql -c <command here>" is the usual way. The developers
take the point of view that there's no point in re-inventing cron.

- Richard Huxton

Re: Stored Procedures

From
Bruce Momjian
Date:
Tom?? Kubi? wrote:
> Hello,
>  I have some stored procedures written in Pl/PgSQL. I want to run them in
> specified time. I need something as Crontab. How can I do that?

Then use cron.  We don't provide that functionality ourselves in the
database.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073