Re: [PATCH] Add function to_oct

From: Nathan Bossart <nathandbossart(at)gmail(dot)com>
To: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
Cc: John Naylor <john(dot)naylor(at)enterprisedb(dot)com>, Kirk Wolak <wolakk(at)gmail(dot)com>, Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, Eric Radman <ericshane(at)eradman(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCH] Add function to_oct
Date: 2023-08-21 19:15:28
Message-ID: 20230821191528.GA443047@nathanxps13
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Aug 21, 2023 at 09:31:37AM +0100, Dean Rasheed wrote:
> 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.

I added some examples for negative inputs.

> 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.)

I renamed it to to_bin().

> Also, I think the convention is to always list functions
> alphabetically, so to_oct() should really come after to_hex().

I reordered the functions in the docs.

--
Nathan Bossart
Amazon Web Services: https://aws.amazon.com

Attachment Content-Type Size
v9-0001-add-to_bin-and-to_oct.patch text/x-diff 10.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Markur Sens 2023-08-21 19:31:47 C function to return double precision[][]
Previous Message Robert Haas 2023-08-21 19:14:48 Re: CREATE FUNCTION ... SEARCH { DEFAULT | SYSTEM | SESSION }