Re: Newbie question

Lists: pgsql-general
From: Hugo <htakada(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Newbie question
Date: 2005-05-18 15:23:58
Message-ID: f3d9ba9905051808233c3da802@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

hi,

is it possible to schedule the execution of an sql stored procedure in
postgress on linux?

thanks

Hugo


From: Vlad <marchenko(at)gmail(dot)com>
To: Hugo <htakada(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Newbie question
Date: 2005-05-18 15:37:04
Message-ID: cd70c68105051808379dc24c4@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

IMHO cron would be the best for that...

> is it possible to schedule the execution of an sql stored procedure in
> postgress on linux?

--
Vlad


From: Csaba Nagy <nagy(at)ecircle-ag(dot)com>
To: Hugo <htakada(at)gmail(dot)com>
Cc: Postgres general mailing list <pgsql-general(at)postgresql(dot)org>
Subject: Re: Newbie question
Date: 2005-05-18 15:43:16
Message-ID: 1116430996.2924.5.camel@coppola.muc.ecircle.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Dear Hugo,

It is possible using cron and psql. Just "man cron" on unix if you're
not already familiar with that. The command line you should use is
something like:

psql [connection options] -f sql_commands_file.sql

Also "man psql" for the options you can use...
Starting the procedure should be done by something like:

SELECT procedure_name();

in the sql commands file given to psql.
Alternatively you can do:

echo "SELECT procedure_name();" | psql [connection options]

but I don't know how well that works with cron... I'm not actually using
it...

HTH,
Csaba.

On Wed, 2005-05-18 at 17:23, Hugo wrote:
> hi,
>
> is it possible to schedule the execution of an sql stored procedure in
> postgress on linux?
>
> thanks
>
> Hugo
>
> ---------------------------(end of broadcast)---------------------------
> TIP 8: explain analyze is your friend


From: Bricklen Anderson <BAnderson(at)PresiNET(dot)com>
To: Hugo <htakada(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Newbie question
Date: 2005-05-18 15:46:15
Message-ID: 428B6347.5050903@PresiNET.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Hugo wrote:
> hi,
>
> is it possible to schedule the execution of an sql stored procedure in
> postgress on linux?
>
> thanks
>
> Hugo

cron job:
eg. Sat 2:30am

30 2 * * Sat psql -d dbname -c "select your_func()"

--
_______________________________

This e-mail may be privileged and/or confidential, and the sender does
not waive any related rights and obligations. Any distribution, use or
copying of this e-mail or the information it contains by other than an
intended recipient is unauthorized. If you received this e-mail in
error, please advise me (by return e-mail or otherwise) immediately.
_______________________________


From: Hugo <htakada(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Newbie question
Date: 2005-05-18 15:51:29
Message-ID: f3d9ba9905051808515393796e@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

thanks all for your help, I'll try your suggestions

regards

Hugo

2005/5/18, Kaloyan Iliev Iliev <news1(at)faith(dot)digsys(dot)bg>:
> Hi Hugo,
>
> Yes, it is possible. Just write an outer perl script(in example), which
> to call this stored procedure. Then put in the cron to call whis perl
> script. As Far As I Know there isn't other way.
>
> Kaloyan Iliev
>
> Hugo wrote:
>
> >hi,
> >
> >is it possible to schedule the execution of an sql stored procedure in
> >postgress on linux?
> >
> >thanks
> >
> >Hugo
> >
> >---------------------------(end of broadcast)---------------------------
> >TIP 8: explain analyze is your friend
> >
> >
> >
> >
>


From: Kaloyan Iliev Iliev <news1(at)faith(dot)digsys(dot)bg>
To: Hugo <htakada(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Newbie question
Date: 2005-05-18 15:57:57
Message-ID: 428B6605.5090802@faith.digsys.bg
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Hi Hugo,

Yes, it is possible. Just write an outer perl script(in example), which
to call this stored procedure. Then put in the cron to call whis perl
script. As Far As I Know there isn't other way.

Kaloyan Iliev

Hugo wrote:

>hi,
>
>is it possible to schedule the execution of an sql stored procedure in
>postgress on linux?
>
>thanks
>
>Hugo
>
>---------------------------(end of broadcast)---------------------------
>TIP 8: explain analyze is your friend
>
>
>
>


From: Geoffrey <esoteric(at)3times25(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Newbie question
Date: 2005-05-19 01:20:19
Message-ID: 428BE9D3.1000504@3times25.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Kaloyan Iliev Iliev wrote:
> Hi Hugo,
>
> Yes, it is possible. Just write an outer perl script(in example), which
> to call this stored procedure. Then put in the cron to call whis perl
> script. As Far As I Know there isn't other way.

Depending on whether you want to schedule a procedure on a regular basis
or not. You could us 'at' to schedule a one time procedure execution.

--
Until later, Geoffrey