Re: Count and Results together

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Jan Sunavec <jan(dot)sunavec(at)gmail(dot)com>
Cc: Sean Davis <sdavis2(at)mail(dot)nih(dot)gov>, pgsql-general(at)postgresql(dot)org
Subject: Re: Count and Results together
Date: 2005-05-19 15:21:25
Message-ID: 20050519152118.GC7748@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, May 19, 2005 at 08:58:13AM +0200, Jan Sunavec 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?

You're missing the point. When you do a query in PostgreSQL you know
how many rows were returned. The interface tells you. For example in
Perl it's $sth->rows for DBI or $res->ntuples for Pg, in pl/PgSQL it's
GET DIAGNOSTICS, in C it's PQntuples().

The rowcount is metadata and is passed seperately from the data. The
interface you're using should tell you how many rows there are...

Perhaps you should tell us what language/interface you are using so we
can give a complete answer.

Have a nice day,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Alban Hertroys 2005-05-19 15:22:14 Re: unique index with bool
Previous Message Richard Huxton 2005-05-19 15:20:27 Re: Postgresql 7.4.7 docs(PDF)