Re: postgres session termination - Mailing list pgsql-general

From John DeSoi
Subject Re: postgres session termination
Date
Msg-id 605FE0FE-7340-11D9-B045-000A95B03262@pgedit.com
Whole thread Raw
In response to postgres session termination  ("Rick Schumeyer" <rschumeyer@ieee.org>)
Responses Re: postgres session termination
List pgsql-general
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


pgsql-general by date:

Previous
From: Richard Huxton
Date:
Subject: Re: postgres session termination
Next
From: Steve Wampler
Date:
Subject: pg_dump in 7.2.4 with trigger functions