Doc: Fixed the result of the bit_count example

Started by wangzk.fnstxz@fujitsu.comover 4 years ago3 messageshackers
Jump to latest
#1wangzk.fnstxz@fujitsu.com
wangzk.fnstxz@fujitsu.com

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.
Regards,
Wang

Attachments:

0001-modify-doc-about-bit_count.patchapplication/octet-stream; name=0001-modify-doc-about-bit_count.patchDownload+1-2
#2Daniel Gustafsson
daniel@yesql.se
In reply to: wangzk.fnstxz@fujitsu.com (#1)
Re: Doc: Fixed the result of the bit_count example

On 29 Jul 2021, at 11:23, wangzk.fnstxz@fujitsu.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/

#3Daniel Gustafsson
daniel@yesql.se
In reply to: Daniel Gustafsson (#2)
Re: Doc: Fixed the result of the bit_count example

On 29 Jul 2021, at 11:35, Daniel Gustafsson <daniel@yesql.se> wrote:

I'll apply this shortly backpatched to 14 where bit_count was introduced.

And done, thanks!

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