Skip site navigation (1) Skip section navigation (2)

Can a PGresult outlive a PGconn

From: "Bryan White" <bryan(at)arcamax(dot)com>
To: <pgsql-interfaces(at)postgreSQL(dot)org>
Subject: Can a PGresult outlive a PGconn
Date: 1998-12-01 16:47:25
Message-ID: 001801be1d4a$46395360$a3f0f6ce@bryan.arcamax.com (view raw or flat)
Thread:
Lists: pgsql-interfaces
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


pgsql-interfaces by date

Next:From: Dallas HockleyDate: 1998-12-01 23:31:06
Subject: (no subject)
Previous:From: Dave PageDate: 1998-12-01 08:24:48
Subject: RE: [INTERFACES] PostOBDC

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group