Re: postgres session termination

From: John DeSoi <desoi(at)pgedit(dot)com>
To: "Rick Schumeyer" <rschumeyer(at)ieee(dot)org>
Cc: "'PgSql General'" <pgsql-general(at)postgresql(dot)org>
Subject: Re: postgres session termination
Date: 2005-01-31 04:27:11
Message-ID: 605FE0FE-7340-11D9-B045-000A95B03262@pgedit.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Steve Wampler 2005-01-31 04:37:25 pg_dump in 7.2.4 with trigger functions
Previous Message Sven Willenberger 2005-01-31 04:09:47 Re: FreeBSD 5.2.1, postgresql 7.4.5 and shared memory settings