Stored Procedures

Started by Tom� Kubi�over 23 years ago4 messagesgeneral
Jump to latest
#1Tom� Kubi�
kubis@vosji.cz

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

#2Shridhar Daithankar
shridhar_daithankar@persistent.co.in
In reply to: Tom� Kubi� (#1)
Re: Stored Procedures

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.

#3Richard Huxton
dev@archonet.com
In reply to: Tom� Kubi� (#1)
Re: Stored Procedures

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

#4Bruce Momjian
bruce@momjian.us
In reply to: Tom� Kubi� (#1)
Re: Stored Procedures

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