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 780F0D1B4FF for ; Fri, 26 Sep 2003 19:21:48 +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 98806-08 for ; Fri, 26 Sep 2003 16:21:18 -0300 (ADT) Received: from mta3.snet.net (mta3.snet.net [204.60.203.69]) by svr1.postgresql.org (Postfix) with ESMTP id 62E46D1B503 for ; Fri, 26 Sep 2003 16:21:16 -0300 (ADT) Received: from [192.168.1.203] (167.95.252.64.snet.net [64.252.95.167]) by mta3.snet.net (8.12.3/8.12.3/SNET-smtp-1.2/D-1.1.1.1/O-1.1.1.1) with ESMTP id h8QJL8IJ025414; Fri, 26 Sep 2003 15:21:08 -0400 (EDT) Date: Fri, 26 Sep 2003 15:16:16 -0400 (EDT) From: Wei Weng X-X-Sender: wweng@localhost.localdomain To: George Weaver Cc: pgsql-sql@postgresql.org Subject: Re: Capturing pgsql ERRORS/NOTICES to file In-Reply-To: <005d01c38462$a734e970$560fa18e@cleartag> Message-ID: References: <001f01c38458$7865c5b0$560fa18e@cleartag> <200309261133.57357.josh@agliodbs.com> <005d01c38462$a734e970$560fa18e@cleartag> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/339 X-Sequence-Number: 15317 George: Have you tried psql {whatever operations} 2> error_output ? (for Bash) Thanks Wei On Fri, 26 Sep 2003, George Weaver wrote: > 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) > > > > > ---------------------------(end of broadcast)--------------------------- > TIP 9: the planner will ignore your desire to choose an index scan if your > joining column's datatypes do not match >