From georgew1@mts.net Fri Sep 26 18:03:53 2003 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 549C3D1B4E9 for ; Fri, 26 Sep 2003 18:03:53 +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 83603-08 for ; Fri, 26 Sep 2003 15:03:23 -0300 (ADT) Received: from smtp2.mts.net (smtp2.mts.net [205.200.16.113]) by svr1.postgresql.org (Postfix) with ESMTP id 292F9D1B519 for ; Fri, 26 Sep 2003 15:03:22 -0300 (ADT) Received: from cleartag (wnpgmb01bbz-ac04-p12-94.mts.net [142.161.12.94]) by smtp2.mts.net (8.12.8-20030918/8.11.3) with SMTP id h8QI2nni022091 for ; Fri, 26 Sep 2003 13:03:13 -0500 (CDT) Message-ID: <001f01c38458$7865c5b0$560fa18e@cleartag> From: "George Weaver" To: Subject: Capturing pgsql ERRORS/NOTICES to file Date: Fri, 26 Sep 2003 13:00:00 -0500 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_001C_01C3842E.1825D340" 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-Spam-Status: No, hits=0.1 tagged_above=0.0 required=5.0 tests=HTML_50_60 X-Spam-Level: X-Archive-Number: 200309/335 X-Sequence-Number: 15313 This is a multi-part message in MIME format. ------=_NextPart_000_001C_01C3842E.1825D340 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I am in the process of creating a batch file that will update some function= s 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?=20=20 The -o option doesn't capture this information. Thanks, George ------=_NextPart_000_001C_01C3842E.1825D340 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
I am in the process of creating a bat= ch file=20 that will update some functions in a database for a remote user similar=20 to:
 
psql -o output dbname <=20 functionupdate.sql
 
Is there any way to save any ERROR and=20 NOTICE messages to a file? 
 
The -o option doesn't capture this=20 information.
 
Thanks,
George
------=_NextPart_000_001C_01C3842E.1825D340-- From josh@agliodbs.com Fri Sep 26 18:34:28 2003 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 From georgew1@mts.net Fri Sep 26 19:16:26 2003 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) > From wweng@kencast.com Fri Sep 26 19:21:48 2003 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 > From georgew1@mts.net Fri Sep 26 19:51:12 2003 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 7B35ED1B510 for ; Fri, 26 Sep 2003 19:51:12 +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 07822-05 for ; Fri, 26 Sep 2003 16:51:02 -0300 (ADT) Received: from smtp2.mts.net (smtp2.mts.net [205.200.16.113]) by svr1.postgresql.org (Postfix) with ESMTP id 3B7D4D1B503 for ; Fri, 26 Sep 2003 16:51:00 -0300 (ADT) Received: from cleartag (wnpgmb01bbz-ac04-p12-50.mts.net [142.161.12.50]) by smtp2.mts.net (8.12.8-20030918/8.11.3) with SMTP id h8QJoqni008494; Fri, 26 Sep 2003 14:50:55 -0500 (CDT) Message-ID: <006b01c38467$84d9ccb0$560fa18e@cleartag> From: "George Weaver" To: "Wei Weng" Cc: References: <001f01c38458$7865c5b0$560fa18e@cleartag> <200309261133.57357.josh@agliodbs.com> <005d01c38462$a734e970$560fa18e@cleartag> Subject: Re: Capturing pgsql ERRORS/NOTICES to file Date: Fri, 26 Sep 2003 14:46:15 -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/340 X-Sequence-Number: 15318 Hi Wei, I hadn't tried that, and it did the trick! Thank you! George ----- Original Message ----- From: "Wei Weng" To: "George Weaver" Cc: Sent: Friday, September 26, 2003 2:16 PM Subject: Re: [SQL] Capturing pgsql ERRORS/NOTICES to file > 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.or g) > > > > > > > > > ---------------------------(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 > > >