Re: FETCH from scroll cursor does not return count in libpq PQcmdStatus

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Knut P(dot) Lehre" <knutpl(at)broadpark(dot)no>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: FETCH from scroll cursor does not return count in libpq PQcmdStatus
Date: 2007-02-18 18:59:45
Message-ID: 8783.1171825185@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Knut P. Lehre" <knutpl(at)broadpark(dot)no> writes:
> After a PQExec with a fetch from a scroll cursor, I only get "FETCH" from PQcmdStatus, and not "FETCH count" as described in the 8.2.1 docs. However, PQntuples returns the number of fetched rows. If I replace the FETCH by a MOVE, PQcmdStatus returns "MOVE count".

Hmm ... some experimentation shows that 7.2 and 7.3 return a count in
the FETCH command tag, but no earlier or later version does. It's clear
though that libpq expects FETCH to have a count, see PQcmdTuples().
So I'd have to say this is something we broke in 7.4 and nobody noticed
until now. The culprit seems to be pquery.c, which is assuming that
PORTAL_UTIL_SELECT queries always return the default command tag.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Gregory Stark 2007-02-18 19:21:30 Re: Plan invalidation design
Previous Message Hannu Krosing 2007-02-18 18:14:00 Re: RFC: Temporal Extensions for PostgreSQL