Re: postgres session termination

From: Ragnar Hafstað <gnari(at)simnet(dot)is>
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 09:47:00
Message-ID: 1107164820.27081.19.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sun, 2005-01-30 at 21:24 -0500, Rick Schumeyer wrote:
> I think this is a common task, but I’m not sure how to do it.
> I want to run a query that can return many records, display them
> 10 at a time, and be able to go forward/backward in the list. I’m
> not concerned about the list changing after the initial query.
>
> 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?

in normal php context, the generation of each web page should
be considered a separate database session.

there is no garantee that the 'next page' request from the user gets
the same database connection, even if you use connection pooling.

you can use LIMIT and OFFSET to do what you want.

if your rows are ordered by a unique key, and you only
have to browse forward, you can do:
SELECT * from table where key > ?
where the '?' is last value retrieved.

gnari

In response to

Browse pgsql-general by date

  From Date Subject
Next Message sid tow 2005-01-31 10:20:03 Problem with Autogenerated sequence
Previous Message Magnus Hagander 2005-01-31 09:13:53 Re: 8.0.0 RC5-2 Processes/Interfaces Under Windows