Re: PQntuples returns an int.

Поиск
Список
Период
Сортировка
От Steve Atkins
Тема Re: PQntuples returns an int.
Дата
Msg-id AD4CD5A6-3285-4691-9A0C-9F9E8EFB2007@blighty.com
обсуждение исходный текст
Ответ на PQntuples returns an int.  (Guillaume Yziquel <guillaume.yziquel@citycable.ch>)
Список pgsql-general
On Mar 3, 2010, at 10:05 AM, Guillaume Yziquel wrote:

> Hello.
>
> I've been looking at the PQntuples function, in section 29.3.2. 'Retrieving query result information' of
>
>     http://www.postgresql.org/docs/8.2/interactive/libpq-exec.html
>
> The declaration is:
>
>> int PQntuples(const PGresult *res);
>
> I'm wondering: why the 'int'? why not a 'long int', or an 'unsigned int', or whatever?
>
> I'm asking this because I'm wondering whether you could have more tuples in the result of a query than could be
indexedby the 'int' type. May this happen? 

That's returning the number of tuples you've already retrieved and have in memory on the client.

I'm not sure what the overhead in storage is, but if you have more than two billion tuples in your result set you're
probablygoing to blow out of memory long before you get there (and should be using a cursor instead). 

Cheers,
  Steve


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Larger volumes of chronologically ordered data and the planner
Следующее
От: Michael Gould
Дата:
Сообщение: Scratching my head why results are different between machines.