X-Original-To: pgsql-interfaces@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 638B04758F1 for ; Tue, 25 Feb 2003 16:37:07 -0500 (EST) Received: from postgresql.org ([64.49.215.8]) by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with SMTP id 93394-01 for ; Tue, 25 Feb 2003 16:36:56 -0500 (EST) Received: from mxzilla2.xs4all.nl (mxzilla2.xs4all.nl [194.109.6.50]) by postgresql.org (Postfix) with ESMTP id 7C7BE475A97 for ; Tue, 25 Feb 2003 16:24:27 -0500 (EST) Received: from xs1.xs4all.nl (xs1.xs4all.nl [194.109.3.11]) by mxzilla2.xs4all.nl (8.12.3/8.12.3) with ESMTP id h1PLOQQk074342; Tue, 25 Feb 2003 22:24:26 +0100 (CET) Received: (from jtv@localhost) by xs1.xs4all.nl (8.11.6/8.11.6) id h1PLOQZ24507; Tue, 25 Feb 2003 22:24:26 +0100 (CET) (envelope-from jtv) Date: Tue, 25 Feb 2003 22:24:26 +0100 From: "Jeroen T. Vermeulen" To: Wei Weng Cc: Matthew Vanecek , pgsql-interfaces@postgresql.org Subject: Re: debug a mess Message-ID: <20030225212426.GM7884@xs4all.nl> Mail-Followup-To: Wei Weng , Matthew Vanecek , pgsql-interfaces@postgresql.org References: <20030225155820.B24120@example.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030225155820.B24120@example.com> User-Agent: Mutt/1.4i X-Virus-Scanned: by amavisd-new X-Archive-Number: 200302/108 X-Sequence-Number: 3729 On Tue, Feb 25, 2003 at 03:58:20PM -0500, Wei Weng wrote: > > switch( PQresultStatus(res) ) > { > case ... goto _end; > case ... goto _end; > ... > default ... goto _end; > } Why do you call that label "_end"? AFAIK names starting with underscores are reserved for use by the compiler, the standard library, etc. Never start your identifiers and such with underscores. A name like _end in particular could mean something special to the compiler or linker and screw things up that way. Why not call it bailout or something? > This is pretty much the skeleton of the code, as you can see, I treat res > pretty carefully, PQclear it whenever necessary. And what are the queries you issue? Do you "begin" a transaction? Are there any errors before the one you're looking at? Jeroen