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

Re: debug a mess

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
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:27:28
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-interfaces
Wei Weng <wweng(at)kencast(dot)com> writes:
> The entire code from PQconnect until PQfinish goes like this:

That sure looks harmless.  I wonder if there is something failing in the
PQconnect() step (like the queries that libpq sends on its own)?

I'd suggest enabling query logging --- see postgresql.conf, or just do
	export PGOPTIONS="--log_statement=1"
before starting your program.  (Check Admin Guide first, as this
parameter got renamed recently.)  Then look in the postmaster log to get
a better idea of what's really going on.

BTW, I'm pretty sure that PQclear, and most other libpq functions,
behave sanely when handed a null pointer.  So the test in
>     if (res)
>         PQclear(res);
is unnecessary.

			regards, tom lane

In response to


pgsql-interfaces by date

Next:From: D'Arcy J.M. CainDate: 2003-02-26 13:53:18
Subject: Re: Python interface and Money?
Previous:From: Jeroen T. VermeulenDate: 2003-02-25 21:24:26
Subject: Re: debug a mess

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