Re: Problem: libpq, network traffic, memory usage - Mailing list pgsql-general

From Volkan YAZICI
Subject Re: Problem: libpq, network traffic, memory usage
Date
Msg-id 20051207174452.GB532@alamut
Whole thread Raw
In response to Re: Problem: libpq, network traffic, memory usage  (Alexander Scholz <alexander.scholz1@freenet.de>)
List pgsql-general
On Dec 07 06:36, Alexander Scholz wrote:
> sorry for probably asking such a stupid question, but we are using a
> PQexec(). Where should I specify that cursor declaration?

Just like as you're querying with pgAdmin:

PQexec(conn, "BEGIN");
PQexec(conn, "DECLARE \"test\" CURSOR FOR SELECT * FROM \"TEST\"");
for (...)
{
    PQexec(conn, "FETCH FORWARD 100 from \"test\"");
    /* Use just retrieved result. */

    /* Don't forget to clear used PGresult. */
}
PQexec(conn, "...");

--
"We are the middle children of history, raised by television to believe
that someday we'll be millionaires and movie stars and rock stars, but
we won't. And we're just learning this fact," Tyler said. "So don't
fuck with us."

pgsql-general by date:

Previous
From: Alexander Scholz
Date:
Subject: Re: Problem: libpq, network traffic, memory usage
Next
From: Karsten Hilbert
Date:
Subject: Re: [pgsql-de-allgemein] Query SELECT * sehr langsam