Srikanth M <srikanth_m@students.iiit.net> writes:
> Could anyone tell me where excatly the result of a query is stored
> after the query is passed to pg_exec_query_string function and before it
> is printed.
It isn't "stored" anywhere --- tuples are passed to the frontend as they
are generated.
regards, tom lane