Re: Automatic SQL command execution

From: "Sean Davis" <sdavis2(at)mail(dot)nih(dot)gov>
To: "Yos Sunitiyoso" <yos(dot)sunitiyoso(at)gmail(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Automatic SQL command execution
Date: 2008-06-27 12:02:33
Message-ID: 264855a00806270502m30594754yea5ca0d277560e6@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Fri, Jun 27, 2008 at 5:08 AM, Yos Sunitiyoso
<yos(dot)sunitiyoso(at)gmail(dot)com> wrote:
> Dear all,
>
> I am new to PostgreSQL and have just started using it for a few weeks.
> I have a (probably very simple) question regarding an execution of a
> SQL command which is automatically repeated every period of time. For
> example, I want to copy a txt file into a table (e.g. with command
> COPY traffic FROM 'C:/TEMP/flow.txt' ) every 5 minutes. The
> 'flow.txt' file is produced by an external system and updated (by
> overwriting it) every 5 minutes. Can anyone let me know how to do it
> or where to put the command in PostgreSQL to automate the execution of
> the copy command according to time?
> Many thanks in advance.

Postgresql doesn't have tools to do that directly. If you are on
Linux or Unix, you can use cron; Windows probably has something
similar to automate tasks.

Sean

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Bruce Momjian 2008-06-30 19:52:08 Re: [NOVICE] encoding problems
Previous Message Yos Sunitiyoso 2008-06-27 09:08:11 Automatic SQL command execution