Received: from femail13.sdc1.sfba.home.com (femail13.sdc1.sfba.home.com [24.0.95.140]) by mail.postgresql.org (8.11.3/8.11.1) with ESMTP id f2PKGXw59296 for ; Sun, 25 Mar 2001 15:16:33 -0500 (EST) (envelope-from jconway2@home.com) Received: from jecw2k1 ([24.0.42.111]) by femail13.sdc1.sfba.home.com (InterMail vM.4.01.03.20 201-229-121-120-20010223) with SMTP id <20010325201630.YVBK14080.femail13.sdc1.sfba.home.com@jecw2k1>; Sun, 25 Mar 2001 12:16:30 -0800 Message-ID: <00eb01c0b568$7caf3fa0$0205a8c0@jecw2k1> From: "Joe Conway" To: "Mohamed ebrahim" , References: <20010325064905.22963.qmail@web1004.mail.yahoo.com> Subject: Re: Help Date: Sun, 25 Mar 2001 12:16:33 -0800 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 X-Archive-Number: 200103/497 X-Sequence-Number: 2168 > I am a user postgresql. I want to update a table > automatically when we reach monthend. i.e i want to > update some table on 31 of every month automatically > without any user attention. I want to know how to do > this. If anyone knows how to do this please mail me. i > will be ever thankfull to him Probably the easiest way to do this is to write a script and run it from cron. For example, if your update query is in a file called $HOME/bin/monthend.sql: insert into mymonthendtable(f1, f2, f3) values(123,'03/31/2001',12345.67); your script (call it $HOME/bin/monthend.sh) might look like: #!/bin/sh psql -U postgres mydatabasename < $HOME/bin/monthend.sql then run (see "man 5 crontab" for more on cron) crontab -e and add an entry like # run at 2:15 AM on the 30th of every month 15 2 30 * * $HOME/bin/monthend.sh Hope this helps, Joe