Re: [PATCH] Add function to_oct

Peter Eisentraut <peter@eisentraut.org>

From: Peter Eisentraut <peter@eisentraut.org>
To: Nathan Bossart <nathandbossart@gmail.com>
Cc: Dean Rasheed <dean.a.rasheed@gmail.com>, John Naylor <john.naylor@enterprisedb.com>, Kirk Wolak <wolakk@gmail.com>, Eric Radman <ericshane@eradman.com>, pgsql-hackers@postgresql.org
Date: 2023-08-22T14:57:02Z
Lists: pgsql-hackers
On 22.08.23 16:26, Nathan Bossart wrote:
>> I don't understand the reason for this handling of negative values.  I would
>> expect that, say, to_hex(-1234) would return '-' || to_hex(1234).
> For this patch set, I was trying to retain the current behavior, which is
> to return the two's complement representation.  I'm open to changing this
> if there's agreement on what the output should be.

Ah, if there is existing behavior then we should probably keep it.



Commits

  1. Add to_bin() and to_oct().