On Jan 30, 2005, at 9:24 PM, Rick Schumeyer wrote:
I’m accessing this via a php web page. I’m thinking that maybe
the best way to do this, other than re-running the query each time,
is to put the results into a temporary table. I think this will work
if I never call “disconnect” from the php script. My question is,
when does my Postgres session end? Is there a timeout?
Of course, if this is a really bad way to do this, I’m willing to
learn a better way!
I think there are much better ways to do this. If the result set is large, the user could be waiting a very long time. Two possibilities are (1) use a cursor or (2) use limit and offset in your select statement grab only the rows you need to display.
I think phpPgAdmin (http://phppgadmin.sourceforge.net/) uses option 2. You could download the source and see how they implement the table browser.
John DeSoi, Ph.D. http://pgedit.com/ Power Tools for PostgreSQL
---------------------------(end of broadcast)--------------------------- TIP 9: the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match