On 5/19/05, Dawid Kuroczko <qnex42@gmail.com> wrote:
> On 5/19/05, Jan Sunavec <jan.sunavec@gmail.com> wrote:
> > I am using libpg.so. I tryed find solution for this problem in internet
> > but, I don't find nothing yet. I have idea get rowcount throught some
> > function write in C. Or is there any plan add this feature into PostgreSQL?
> Theoretically you could declare a cursor, count the rows (from plpgsql
> preferably, to avoid sending all the data to the client), rewind the
> cursor (MOVE) and return it. The problem is that I think it is not possible
> for PL/pgsql to return both integer (row count) and a cursor (for the
> query rewound) at the same time...
I stand corrected. GET DIAGNOSTICS, PQntuples(), etc. are the way
to do it.
Regards,
Dawid