Re: [PATCH] Add function to_oct - Mailing list pgsql-hackers

From Dean Rasheed
Subject Re: [PATCH] Add function to_oct
Date
Msg-id CAEZATCXzaF5sVx+m=C6uYT45NChYhgiqp80Jqi4CBLK15b0z5Q@mail.gmail.com
Whole thread Raw
In response to Re: [PATCH] Add function to_oct  (Nathan Bossart <nathandbossart@gmail.com>)
Responses Re: [PATCH] Add function to_oct
List 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



pgsql-hackers by date:

Previous
From: Daniel Gustafsson
Date:
Subject: Re: pg_upgrade - typo in verbose log
Next
From: "Andrey M. Borodin"
Date:
Subject: Re: UUID v7