Re: [PATCH] Add function to_oct
Dean Rasheed <dean.a.rasheed@gmail.com>
From: Dean Rasheed <dean.a.rasheed@gmail.com>
To: Nathan Bossart <nathandbossart@gmail.com>
Cc: John Naylor <john.naylor@enterprisedb.com>, Kirk Wolak <wolakk@gmail.com>, Peter Eisentraut <peter.eisentraut@enterprisedb.com>,
Eric Radman <ericshane@eradman.com>, pgsql-hackers@postgresql.org
Date: 2023-08-21T08:31:37Z
Lists: pgsql-hackers
On Sun, 20 Aug 2023 at 16:25, Nathan Bossart <nathandbossart@gmail.com> wrote: > > On Sat, Aug 19, 2023 at 08:35:46AM +0100, Dean Rasheed wrote: > > > The way that negative inputs are handled really should be documented, > > or at least it should include a couple of examples. > > I used your suggestion and noted that the output is the two's complement > representation [0]. > Hmm, I think just including the doc text update, without the examples of positive and negative inputs, might not be sufficient to make the meaning clear to everyone. Something else that bothers me slightly is the function naming -- "hexadecimal" gets abbreviated to "hex", "octal" gets abbreviated to "oct", but "binary" is left as-is. I think it ought to be "to_bin()" on consistency grounds, even though I understand the words "to bin" could be interpreted differently. (Looking elsewhere for precedents, Python has bin(), oct() and hex() functions.) Also, I think the convention is to always list functions alphabetically, so to_oct() should really come after to_hex(). Regards, Dean
Commits
-
Add to_bin() and to_oct().
- 260a1f18dae8 17.0 landed