Re: count(*) in binary mode returns 0 - Mailing list pgsql-general

From Daniel Verite
Subject Re: count(*) in binary mode returns 0
Date
Msg-id 70f6e7ed-2e85-4c7d-b2fe-a8ad3285b1d5@manitou-mail.org
Whole thread Raw
In response to count(*) in binary mode returns 0  ("imagenesis@gmail.com" <imagenesis@gmail.com>)
List 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 by date:

Previous
From: "Charles Clavadetscher"
Date:
Subject: Re: Extensions and privileges in public schema
Next
From: basti
Date:
Subject: Postgres Traffic accounting