pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephan Szabo <sszabo@megazone.bigpanda.com>
To: Anagha Joshi <ajoshi@nulinkinc.com>
Cc: pgsql-hackers-owner@postgresql.org
Cc: pgsql-admin@postgresql.org
Cc: pgsql-sql@postgresql.org
Subject: Re: URGENT : free result (libpq++ API)
Date: Wed, 20 Aug 2003 23:11:10 -0700 (PDT)
Message-ID: <20030820230649.P33044-100000@megazone.bigpanda.com> (raw)
In-Reply-To: <FF851C7EEB75954F9BCFB5CA117AB1EC09289E@delta.nulinkinc.com>


On Thu, 21 Aug 2003, Anagha Joshi wrote:

> Hi all,
> I'm using PG - 7.2.4 on Solaries.
> I'm using "libpq++" library as client implementation is coded in "C++".
>
> I'm doing the following :
> 1.	Making the connection to database by creating new object of
> "PgDatabase" i.e.
> data = new PgDatabase( " CONNECTION INFO ");
>
> 2.	Then I execure the query with:
> int return = data->Exec( " THIS IS A SQL QUERY");
>
> My question is ,
> How should I clear(free) the result of the query? Need  I close the
> connection after each query to do that?

It looks to me that PgConnection::Exec clears an existing query result
when it's called.

// PgConnection::exec  -- send a query to the backend
ExecStatusType PgConnection::Exec(const char* query)
{
	// Clear the result stucture if needed
	if (pgResult)
		PQclear(pgResult);

	// Execute the given query
	pgResult = PQexec(pgConn, query);

	// Return the status
	if (pgResult)
		return PQresultStatus(pgResult);
	else
		return PGRES_FATAL_ERROR;
}





view thread (2+ messages)

Message-ID: <20030820230649.P33044-100000@megazone.bigpanda.com>
Permalink:  ../20030820230649.P33044-100000@megazone.bigpanda.com/
Also on:    postgresql.org/message-id/20030820230649.P33044-100000@megazone.bigpanda.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: sszabo@megazone.bigpanda.com, ajoshi@nulinkinc.com, pgsql-hackers-owner@postgresql.org, pgsql-admin@postgresql.org
  Subject: Re: URGENT : free result (libpq++ API)
  In-Reply-To: <20030820230649.P33044-100000@megazone.bigpanda.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox