Re: Doc: Fixed the result of the bit_count example

From: Daniel Gustafsson <daniel(at)yesql(dot)se>
To: "wangzk(dot)fnstxz(at)fujitsu(dot)com" <wangzk(dot)fnstxz(at)fujitsu(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Doc: Fixed the result of the bit_count example
Date: 2021-07-29 09:35:54
Message-ID: 04205623-A800-42E9-A52C-EB0DE2F963CE@yesql.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On 29 Jul 2021, at 11:23, wangzk(dot)fnstxz(at)fujitsu(dot)com wrote:
>
> Hello:
>
> There is a small problem with the documentation for the previously added SQL function “bit_count”.
>
> In the doc, (https://www.postgresql.org/docs/14/functions-binarystring.html)
> “bit_count('\x1234567890'::bytea)” result is "31" , but the actual result is "15".
>
> Similar problems have been fixed in test file (commit: ebedd0c78fc51c293abe56e99a18c67af14da0c9), but the doc has not been modified.

Good catch, with the default value of standard_conforming_strings the result is
indeed 15 and should be updated to reflect that. I'll apply this shortly
backpatched to 14 where bit_count was introduced.

--
Daniel Gustafsson https://vmware.com/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2021-07-29 10:18:54 Re: Out-of-memory error reports in libpq
Previous Message wangzk.fnstxz@fujitsu.com 2021-07-29 09:23:46 Doc: Fixed the result of the bit_count example