From: | Aarni Ruuhimäki <aarni(at)kymi(dot)com> |
---|---|
To: | pgsql-novice(at)postgresql(dot)org |
Subject: | Re: Scheduled function ? |
Date: | 2006-05-04 16:10:00 |
Message-ID: | 200605041910.00936.aarni@kymi.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-novice |
On Thursday 04 May 2006 18:24, Daniel T. Staal wrote:
> On Thu, May 4, 2006 10:59 am, Aarni Ruuhimäki said:
> > Yes, I thought so. What would the syntax of such a script ?
> >
> > Something like:
> >
> > #!/bin/bash
> > #
> >
> > /usr/local/pgsql/bin/psql db_name
> >
> > run a function ?
> >
> > #eof
>
> Depending on what I wanted to do, and how complex the function is, I'd
> probably use:
>
> #!/bin/sh
> /usr/local/pgsql/bin/psql -c "SQL_Function_Call" db_name username
> #EOF
>
> You could also write the SQL to a file and have cron call
> `/usr/local/pgsql/bin/psql -f SQL_file db_name username`.
>
> (If there is output you might want to put that someplace as well.)
>
> Daniel T. Staal
>
This works nicely with my test function and is sooo simple.
The actual function is written by someone else and is quite a monster so I
won't go into even trying to translate it into php with my limited php
skills. The app is a simple stock report / view tool and the function roams
around the db nightly.
Thank you guys again !
BR,
Aarni
From | Date | Subject | |
---|---|---|---|
Next Message | Brian Hurt | 2006-05-04 17:06:10 | Efficiency of indexes on CHAR(n) and VARCHAR(n) |
Previous Message | Daniel T. Staal | 2006-05-04 15:24:41 | Re: Scheduled function ? |