Re: DBD::Pg/perl question, kind of...

From: Neal Clark <nclark(at)securescience(dot)net>
To: Michael Fuhr <mike(at)fuhr(dot)org>
Cc: Douglas McNaught <doug(at)mcnaught(dot)org>, Albe Laurenz <all(at)adv(dot)magwien(dot)gv(dot)at>, PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: DBD::Pg/perl question, kind of...
Date: 2007-03-12 19:33:10
Message-ID: 85ABE2E5-AF4E-4990-A145-4113871B98CA@securescience.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Thanks for all the replies everyone. Not really knowing what a cursor
is, I suppose I have some work to do. I can do the SELECT/LIMIT/
OFFSET approach but that seems like kind of a headache, esp. when its
hard to predict what # of rows will max out memory... I'd have to
keep that number pretty small, effectively making the same exact
query over and over, which sounds pretty slow.

I'm not really using pgsql yet, so a lot of this is beyond me, I'm
just thinking ahead as I start to migrate from mysql...

Thanks again,
Neal

On Mar 12, 2007, at 7:09 AM, Michael Fuhr wrote:

> On Mon, Mar 12, 2007 at 08:38:52AM -0400, Douglas McNaught wrote:
>> You are restricted to staying in a transaction while the cursor is
>> open, so if you want to work outside of transactions LIMIT/OFFSET
>> is your only way.
>
> http://www.postgresql.org/docs/8.2/interactive/sql-declare.html
>
> "If WITH HOLD is specified and the transaction that created the
> cursor successfully commits, the cursor can continue to be accessed
> by subsequent transactions in the same session. (But if the creating
> transaction is aborted, the cursor is removed.) A cursor created
> with WITH HOLD is closed when an explicit CLOSE command is issued
> on it, or the session ends. In the current implementation, the rows
> represented by a held cursor are copied into a temporary file or
> memory area so that they remain available for subsequent
> transactions."
>
> --
> Michael Fuhr
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
> http://archives.postgresql.org/
>

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (Darwin)

iD8DBQFF9ar2OUuHw4wCzDMRAtE6AKCKt226m/qql6lFGw4VkU7tRQC2ogCfebGs
B47wxieD8TBK5GgAQbwDUxk=
=+rwM
-----END PGP SIGNATURE-----

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Erik Jones 2007-03-12 19:46:13 Re: Tracking disk writes? (again)
Previous Message Alvaro Herrera 2007-03-12 19:28:25 Re: Tracking disk writes? (again)