Re: debug a mess - Mailing list pgsql-interfaces

From Jeroen T. Vermeulen
Subject Re: debug a mess
Date
Msg-id 20030225212426.GM7884@xs4all.nl
Whole thread Raw
In response to Re: debug a mess  (Wei Weng <wweng@kencast.com>)
List 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



pgsql-interfaces by date:

Previous
From: Wei Weng
Date:
Subject: Re: debug a mess
Next
From: Tom Lane
Date:
Subject: Re: debug a mess