Re: problem with PQsendQuery/PQgetResult and COPY FROM statement - Mailing list pgsql-hackers

From Tom Lane
Subject Re: problem with PQsendQuery/PQgetResult and COPY FROM statement
Date
Msg-id 10370.1148249736@sss.pgh.pa.us
Whole thread Raw
In response to problem with PQsendQuery/PQgetResult and COPY FROM statement  (max.poletto@gmail.com)
List pgsql-hackers
max.poletto@gmail.com writes:
> I attempt to execute a "COPY test FROM STDIN" using PQsendQuery.
> Subsequently, after the appropriate poll()/PQconsumeInput/PQisBusy
> calls, PQgetResult returns tens of millions of (invalid?) non-null
> PGresults.

You should fix your code to pay some attention to what those results
are.  I'm betting they are error results.

> This behavior seems incorrect, and sometimes causes my
> application to exhaust memory and crash.

Well, that's because you're not PQclear'ing a result when done with it.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Josh Berkus
Date:
Subject: Re: Porting MSSQL to PGSQL (Was: [OT] MySQL is bad, but THIS bad?)
Next
From: Tom Lane
Date:
Subject: Re: FW: iDefense Q2 2006 Vulnerability Challenge