public inbox for [email protected]
help / color / mirror / Atom feedFrom: Laurenz Albe <[email protected]>
To: Igor Korot <[email protected]>
Cc: pgsql-generallists.postgresql.org <[email protected]>
Subject: Re: libpq simple SELECT
Date: Wed, 17 Dec 2025 22:30:29 +0100
Message-ID: <[email protected]> (raw)
In-Reply-To: <CA+FnnTxvvSOWz0caeB1pewbAgAjRC2QHxvPJ5C+Y7p7usLbMZg@mail.gmail.com>
References: <CA+FnnTzP_9Mh9S7NJL5WFJmbOi2wxw4g=MdoUo-SuXEp3Fyg-g@mail.gmail.com>
<[email protected]>
<CA+FnnTzWJtJwUjWBbm9naV9BUWdzTnQ8dKCtPOqaL0+1UOWcAQ@mail.gmail.com>
<[email protected]>
<CA+FnnTxvvSOWz0caeB1pewbAgAjRC2QHxvPJ5C+Y7p7usLbMZg@mail.gmail.com>
On Wed, 2025-12-17 at 13:07 -0800, Igor Korot wrote:
> This is a comment:
>
> /*
> * Our test case here involves using a cursor, for which we must be inside
> * a transaction block. We could do the whole thing with a single
> * PQexec() of "select * from pg_database", but that's too trivial to make
> * a good example.
> */
>
> When I read it my understanding is:
>
> It is possible to write the code without a cursor..
> However it will be trivial and so the code will use CURSOR.
> But the usage of CURSOR is actually not required - it is used
> in the docs only to make a good example.
>
> However, when I tried to write the code without the CURSOR
> it seems that CURSOR usage is a must and not optional, which
> contradicts the comment above.
>
> I hope now my question is clear. I want to know if using CURSR
> is a must.
Sorry that it took me so long to understand what you mean.
Your PQexec call should return all rows. If you don't get all rows, there
must be some other problem with your code. You didn't show enough of the
code for me to see where the problem is.
Yours,
Laurenz Albe
view thread (4+ messages)
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected]
Subject: Re: libpq simple SELECT
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox