Re: [HACKERS] I want to change libpq and libpgtcl for better handling of large query results - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: [HACKERS] I want to change libpq and libpgtcl for better handling of large query results
Date
Msg-id 346fe2055dadc8a32c1292f4e81246ae
Whole thread Raw
List pgsql-hackers
> Getting a query result from Tcl/Tk (pg_select function) uses PQexec.
> But PQexec IS GETTING ALL THE RECORDS IN MEMORY and after that user can
> handle query results.
> But what if table has thousand records ? Probably I would need more than
> 512 Mb of RAM in order to get a report finished.

This issue has come up before.  The accepted solution is to open a
cursor, and fetch whatever records you need.  The backend still
generates the full result, but the front end requests the records it
wants.

Does that not work in your case?


- --
Bruce Momjian
maillist@candle.pha.pa.us

------------------------------

pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Error messages/logging (Was: Re: [HACKERS] Re: [COMMITTERS] 'pgsql/src/backend/parser gram.y parse_oper.c')
Next
From: Bruce Momjian
Date:
Subject: Re: consttraints.source