X-Original-To: pgsql-interfaces@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 66808475BEC for ; Tue, 25 Feb 2003 16:43:03 -0500 (EST) Received: from postgresql.org ([64.49.215.8]) by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with SMTP id 94118-01 for ; Tue, 25 Feb 2003 16:42:35 -0500 (EST) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id C6983475DBC for ; Tue, 25 Feb 2003 16:27:58 -0500 (EST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.6/8.12.6) with ESMTP id h1PLRS5u013033; Tue, 25 Feb 2003 16:27:28 -0500 (EST) To: Wei Weng Cc: Matthew Vanecek , pgsql-interfaces@postgresql.org Subject: Re: debug a mess In-reply-to: <20030225155820.B24120@example.com> References: <20030225155820.B24120@example.com> Comments: In-reply-to Wei Weng message dated "Tue, 25 Feb 2003 15:58:20 -0500" Date: Tue, 25 Feb 2003 16:27:28 -0500 Message-ID: <13032.1046208448@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new X-Archive-Number: 200302/109 X-Sequence-Number: 3730 Wei Weng 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