Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-interfaces by date

Next:From: Tom LaneDate: 2003-02-25 21:27:28
Subject: Re: debug a mess
Previous:From: Wei WengDate: 2003-02-25 20:58:20
Subject: Re: debug a mess

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group