Re: count(*) in binary mode returns 0

Поиск
Список
Период
Сортировка
От Daniel Verite
Тема Re: count(*) in binary mode returns 0
Дата
Msg-id 70f6e7ed-2e85-4c7d-b2fe-a8ad3285b1d5@manitou-mail.org
обсуждение исходный текст
Ответ на count(*) in binary mode returns 0  ("imagenesis@gmail.com" <imagenesis@gmail.com>)
Список pgsql-general
    imagenesis@gmail.com wrote:

> nfields: 1
> from_psql 00000000000000000000000000000000 bytes_to_read:4 read:4
> host_order 00000000000000000000000000000000 bytes_to_read:4 read:4
> conv_int ir:0

Note that count(*) produces a bigint (8 bytes), not an int (4 bytes).

=> select pg_typeof(count(1));
 pg_typeof
-----------
 bigint
(1 row)

Can you check if your code does work when the query is simply
SELECT 1::bigint ?


Best regards,
--
Daniel Vérité
PostgreSQL-powered mailer: http://www.manitou-mail.org
Twitter: @DanielVerite


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

Предыдущее
От: "Charles Clavadetscher"
Дата:
Сообщение: Re: Extensions and privileges in public schema
Следующее
От: basti
Дата:
Сообщение: Postgres Traffic accounting