Received: from localhost (unknown [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id BCCF69FBCF3 for ; Wed, 17 Oct 2007 11:06:12 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 99784-06 for ; Wed, 17 Oct 2007 11:05:52 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from outbound-mail-54.bluehost.com (outbound-mail-54.bluehost.com [69.89.20.34]) by postgresql.org (Postfix) with SMTP id ED8BC9FBC27 for ; Wed, 17 Oct 2007 11:06:08 -0300 (ADT) Received: (qmail 17256 invoked by uid 0); 17 Oct 2007 14:06:06 -0000 Received: from unknown (HELO box54.bluehost.com) (69.89.20.54) by mailproxy3.bluehost.com with SMTP; 17 Oct 2007 14:06:06 -0000 Received: from vdsl-151-118-146-75.dnvr.qwest.net ([151.118.146.75] helo=fileserve) by box54.bluehost.com with esmtp (Exim 4.68) (envelope-from ) id 1Ii9XB-000359-Od for pgsql-admin@postgresql.org; Wed, 17 Oct 2007 08:06:05 -0600 From: Kevin Kempter To: pgsql-admin@postgresql.org Subject: Re: running a SQL command at startup time Date: Wed, 17 Oct 2007 08:04:09 -0600 User-Agent: KMail/1.9.7 References: <20071017094445.59E779FB981@postgresql.org> In-Reply-To: <20071017094445.59E779FB981@postgresql.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200710170804.09748.kevin@kevinkempterllc.com> X-Identified-User: {840:box54.bluehost.com:kevinkem:kevinkempterllc.com} {sentby:bopbeforesmtp 151.118.146.75 authed with kevinkempterllc.com} X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200710/154 X-Sequence-Number: 27068 On Wednesday 17 October 2007 03:05:22 Alexis Beuraud wrote: > 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 > > ---------------------------(end of broadcast)--------------------------- > TIP 6: explain analyze is your friend for a UNIX/Linux box you could tweak the postgresql service script (i.e. /etc/init.d/postgresql) adding the analyze to the start (and restart if desired) processes /Kevin -------------------------------------------------------------------------- Your mouse has moved. Windows must restart to affect the change(s) Reboot now [Y/y] ? ---------------------------------------------------------------------------