Re: debug a mess

From: "Jeroen T(dot) Vermeulen" <jtv(at)xs4all(dot)nl>
To: Wei Weng <wweng(at)kencast(dot)com>
Cc: Matthew Vanecek <mevanecek(at)yahoo(dot)com>, pgsql-interfaces(at)postgresql(dot)org
Subject: Re: debug a mess
Date: 2003-02-25 21:24:26
Message-ID: 20030225212426.GM7884@xs4all.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

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

In response to

Browse pgsql-interfaces by date

  From Date Subject
Next Message Tom Lane 2003-02-25 21:27:28 Re: debug a mess
Previous Message Wei Weng 2003-02-25 20:58:20 Re: debug a mess