RE: [HACKERS] libpq questuion

From: "Hiroshi Inoue" <Inoue(at)tpf(dot)co(dot)jp>
To: "Jan Wieck" <jwieck(at)debis(dot)com>
Cc: <pgsql-hackers(at)hub(dot)org>, <dms(at)wplus(dot)net>
Subject: RE: [HACKERS] libpq questuion
Date: 1999-02-09 08:03:55
Message-ID: 000101be5402$bd0769c0$2801007e@cadzone.tpf.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello all,

> -----Original Message-----
> From: owner-pgsql-hackers(at)postgreSQL(dot)org
> [mailto:owner-pgsql-hackers(at)postgreSQL(dot)org]On Behalf Of Jan Wieck
> Sent: Monday, February 08, 1999 11:47 PM
> To: dms(at)wplus(dot)net
> Cc: pgsql-hackers(at)hub(dot)org
> Subject: Re: [HACKERS] libpq questuion
>
>
> Dmitry Samersoff wrote:
>
> >
> > While update table whithin fetch forward loop
> > cause infinite fetching of updated touple?
> >
> > (code fragment below cause infinite
> > displayng record with oid 20864)
> >
> >
> >
> ------------------------------------------------------------------
> ----------
> > PQexec(_conn, "BEGIN");
> > PQexec(_conn, "DECLARE curr1 CURSOR FOR select oid, name from
> domains;");
> >
> > while(1)
> > {
> > _res = PQexec(_conn, "FETCH FORWARD 1 IN curr1");
> > if( PQresultStatus(_res) != PGRES_TUPLES_OK ) break;
> >
> > PQexec(_conn, "update domains set type = 3 where oid = 20864" );
> > printf("oid: %s name: %s\n",
> PQgetvalue(_res,0,0),PQgetvalue(_res,0,1));
> > }
> >
> ------------------------------------------------------------------
> ---------
>
> Which Postgres version?
>
> I guess it is a side effect from the visibility of tuples
> (records) in conjunction with portals (cursors).
>
> The reason must be that the the UPDATE inside the loop add's
> new tuples to the table at it's end. It also issues a
> CommandCounterIncrement(), so the new tuples get visible to
> the already running scan for the portal.
>

Current cursors are strangely sensitive in some cases.
So 4 months ago,I requested INSENSITIVE cursors..
I'm very happy if you will implement INSENSITIVE cursors.

And all cursors will be INSENSITIVE even if there are no
INSENSITIVE keywords ?

Thanks.

Hiroshi Inoue
Inoue(at)tpf(dot)co(dot)jp

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Oleg Broytmann 1999-02-09 08:13:29 Re: [HACKERS] VACUUM ANALYZE problem on linux
Previous Message Vadim Mikheev 1999-02-09 06:57:46 Re: [HACKERS] TIME QUALIFICATION