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

Поиск
Список
Период
Сортировка
От Joel Burton
Тема Re: wat is the max number of rows that can be returned
Дата
Msg-id 20021204152832.GA15164@temp.joelburton.com
обсуждение исходный текст
Ответ на wat is the max number of rows that can be returned  (HK <harikrishnan@midascomm.com>)
Ответы Re: wat is the max number of rows that can be returned  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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@joelburton.com  |  joelburton.com  |  aim: wjoelburton
Independent Knowledge Management Consultant

В списке pgsql-novice по дате отправления:

Предыдущее
От: HK
Дата:
Сообщение: wat is the max number of rows that can be returned
Следующее
От: Tom Lane
Дата:
Сообщение: Re: wat is the max number of rows that can be returned