Using libpq with pg 8.2.1 on WinXP Pro SP2.
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".
The discussion we had on irc #postgresql suggested that this might be a bug, or have we missed some points regarding the use of scroll cursors?

Search Discussions

  • Tom Lane at Feb 18, 2007 at 6:59 pm

    "Knut P. Lehre" <knutpl@broadpark.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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppgsql-hackers @
categoriespostgresql
postedFeb 18, '07 at 5:21p
activeFeb 18, '07 at 6:59p
posts2
users2
websitepostgresql.org...
irc#postgresql

2 users in discussion

Knut P. Lehre: 1 post Tom Lane: 1 post

People

Translate

site design / logo © 2022 Grokbase