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 D3B42D1B4FF for ; Fri, 26 Sep 2003 19:16:26 +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 01050-04 for ; Fri, 26 Sep 2003 16:16:17 -0300 (ADT) Received: from smtp2.mts.net (smtp2.mts.net [205.200.16.113]) by svr1.postgresql.org (Postfix) with ESMTP id 9B07ED1B4E1 for ; Fri, 26 Sep 2003 16:16:15 -0300 (ADT) Received: from cleartag (wnpgmb01ba1-ac05-p14-147.mts.net [142.161.14.147]) by smtp2.mts.net (8.12.8-20030918/8.11.3) with SMTP id h8QJG0nk022783; Fri, 26 Sep 2003 14:16:05 -0500 (CDT) Message-ID: <005d01c38462$a734e970$560fa18e@cleartag> From: "George Weaver" To: "Josh Berkus" , References: <001f01c38458$7865c5b0$560fa18e@cleartag> <200309261133.57357.josh@agliodbs.com> Subject: Re: Capturing pgsql ERRORS/NOTICES to file Date: Fri, 26 Sep 2003 14:15:19 -0500 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 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/338 X-Sequence-Number: 15316 Hi Josh, Thanks for the reply. What I am trying to achieve is to have errors go to a file, rather than show up on the screen. Is this possible? George ----- Original Message ----- From: "Josh Berkus" To: "George Weaver" ; Sent: Friday, September 26, 2003 1:33 PM Subject: Re: [SQL] Capturing pgsql ERRORS/NOTICES to file > 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 > > ---------------------------(end of broadcast)--------------------------- > TIP 2: you can get off all lists at once with the unregister command > (send "unregister YourEmailAddressHere" to majordomo@postgresql.org) >