Re: Interfaces that support cursors

From: Doug McNaught <doug(at)mcnaught(dot)org>
To: Network Administrator <netadmin(at)vcsn(dot)com>
Cc: postgres general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Interfaces that support cursors
Date: 2003-10-10 18:04:58
Message-ID: m3r81l9df9.fsf@varsoon.wireboard.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Network Administrator <netadmin(at)vcsn(dot)com> writes:

> Ok, I did see the autocommit flag setting in DBD:Pg when I starting
> reading up on the DBI/DBD interfacing methods so I guess I could
> recode for that. However, how do you "maintain" the current
> transaction open if your script is writing pages to the web. Even
> in mod_perl I think that there is a commit after the script ends,
> no?

Oh, right--I didn't get that bit of your problem.

I think the conventional wisdom on this is that keeping transactions
open across web page deliveries is a Bad Idea. If you're just doing
the standard "show N records per page" thing, you can use LIMIT and
OFFSET on your SELECT call. This is going to be slower thn using a
transaction (because you're re-executing the query for every page) but
is fairly simple.

If you really want to have a DB transaction that covers multiple page
views, you need some kind of persistent application server rather than
CGI scripts, so you can keep open connections and application state
around.

-Doug

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Nick Barr 2003-10-10 18:08:59 Re: go for a script! / ex: PostgreSQL vs. MySQL
Previous Message Alvaro Herrera 2003-10-10 18:01:32 Re: Table partitioning for maximum speed?