Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 98DBF9FBAFD for ; Wed, 17 Oct 2007 06:44:49 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 38509-07 for ; Wed, 17 Oct 2007 06:44:45 -0300 (ADT) X-Greylist: delayed 00:39:17.666396 by SQLgrey-1.7.5 Received: from smtp2.siatel.com (smtp2.siatel.com [83.206.116.133]) by postgresql.org (Postfix) with ESMTP id 59E779FB981 for ; Wed, 17 Oct 2007 06:44:45 -0300 (ADT) From: Alexis Beuraud To: "'pgsql-admin@postgresql.org'" Subject: running a SQL command at startup time Date: Wed, 17 Oct 2007 11:05:22 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Virus: Pass. X-SA-Exim-Connect-IP: 83.206.116.140 Message-Id: <20071017094445.59E779FB981@postgresql.org> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200710/151 X-Sequence-Number: 27065 Hello all Is there a way to execute a SQL script whenever the Postgres server starts up? I would like to run the SQL command "analyze" at startup time. (I might use more complicated scripts in the future). I have not found any related entry in postgresql.conf. I have been looking for the keywords init, startup in the FAQ and the mailing lists but I have not found the answer. Please provide an answer which would work both on Windows and Linux. Regards, Alexis