Received: from arcamax.com (arcamax.com [206.246.240.138]) by hub.org (8.9.1/8.9.1) with ESMTP id LAA09319 for ; Tue, 1 Dec 1998 11:47:29 -0500 (EST) (envelope-from bryan@arcamax.com) Received: from bryan.arcamax.com (bryan [206.246.240.163]) by arcamax.com (8.8.7/8.8.7) with SMTP id LAA05441 for ; Tue, 1 Dec 1998 11:47:25 -0500 Message-ID: <001801be1d4a$46395360$a3f0f6ce@bryan.arcamax.com> From: "Bryan White" To: Subject: Can a PGresult outlive a PGconn Date: Tue, 1 Dec 1998 11:47:25 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.72.3110.5 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 I am doing some coding using libpq under Postgres 6.4. I want to be able to cache the results of some queries. These are mostly selects on small tables used to fill out combo boxes. The tables don't change very often but get referenced a lot. My question is: is it better to execute the query and keep the PGresult around or extract the data from the PQresult into another structure? A key point is that the PGconn will often be PQfinish'ed before the data is used. Does a PGresult remain valid after the PGconn that it is associated with is closed? Does a PGresult keep any resources allocated in the backend? Bryan White ArcaMax Inc. Yorktown VA www.arcamax.com