Re: wat is the max number of rows that can be returned

From: Joel Burton <joel(at)joelburton(dot)com>
To: HK <harikrishnan(at)midascomm(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: wat is the max number of rows that can be returned
Date: 2002-12-04 15:28:32
Message-ID: 20021204152832.GA15164@temp.joelburton.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Wed, Dec 04, 2002 at 04:37:07PM +0530, HK wrote:
> hi all,
> i am using postgreSQL7.1.3 with libPQ C API.
>
> suppose i create a table tbl (col int8 primary key) and populate the table
> to the full.
> Now if i retreive the result with
>
> int a;
> ..
> result = pqexec(conn, "select * from tbl");
> a = PQntuples (result);
> ..
>
> what will be the value of a.
>
> The value must surely wrap around, i presume (PQntuples returns int).
> Is this limitation because of C API??
>
> When there is provision to insert that many rows, is there any ways to
> obtain the correct number of rows. (thru' C API). Or is it possible in
> any other API.

Ummm... you're going to populate the table "to the full" with int 8
primary key. That's 9 quintillion (trillion to you non-US types) rows,
18 qb if you use negative side of range as well. That's a lot of
hamburgers.

And you're wondering what will happen if you write a query that returns
more than 2 billion rows (2000 million)? I'm still wondering when this
query would ever return, period.

I'm not sure exactly how you could get around that (wiser minds on the
-GENERAL list might know), but really, should someone posting on
pgsql-novice really try to manage a database of this size? ;) Is your
question entirely academic?

--

Joel BURTON | joel(at)joelburton(dot)com | joelburton.com | aim: wjoelburton
Independent Knowledge Management Consultant

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2002-12-04 16:55:46 Re: wat is the max number of rows that can be returned
Previous Message HK 2002-12-04 11:07:07 wat is the max number of rows that can be returned