X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 714C0D1B508 for ; Fri, 26 Sep 2003 18:34:28 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 94673-03 for ; Fri, 26 Sep 2003 15:34:19 -0300 (ADT) Received: from davinci.ethosmedia.com (unknown [209.128.84.228]) by svr1.postgresql.org (Postfix) with ESMTP id A8AF3D1B518 for ; Fri, 26 Sep 2003 15:34:17 -0300 (ADT) Received: from [63.195.55.98] (HELO spooky) by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) with ESMTP id 3684298; Fri, 26 Sep 2003 11:34:50 -0700 Content-Type: text/plain; charset="iso-8859-1" From: Josh Berkus Organization: Aglio Database Solutions To: "George Weaver" , Subject: Re: Capturing pgsql ERRORS/NOTICES to file Date: Fri, 26 Sep 2003 11:33:57 -0700 User-Agent: KMail/1.4.3 References: <001f01c38458$7865c5b0$560fa18e@cleartag> In-Reply-To: <001f01c38458$7865c5b0$560fa18e@cleartag> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <200309261133.57357.josh@agliodbs.com> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/336 X-Sequence-Number: 15314 George, > I am in the process of creating a batch file that will update some > functions in a database for a remote user similar to: > > psql -o output dbname < functionupdate.sql > > Is there any way to save any ERROR and NOTICE messages to a file? > > The -o option doesn't capture this information. You have to use command shell redirects. For example, I commonly do in bash psql -o output dbname < functionupdate.sql >out.dump ... which sends all the command responses to a file, allowing me to read only the errors on the screen. See a guide to your shell for more creative redirection. -- Josh Berkus Aglio Database Solutions San Francisco