Re: [PATCH] Add function to_oct

Nathan Bossart <nathandbossart@gmail.com>

From: Nathan Bossart <nathandbossart@gmail.com>
To: John Naylor <john.naylor@enterprisedb.com>
Cc: Kirk Wolak <wolakk@gmail.com>, Peter Eisentraut <peter.eisentraut@enterprisedb.com>, Eric Radman <ericshane@eradman.com>, pgsql-hackers@postgresql.org
Date: 2023-08-17T15:26:28Z
Lists: pgsql-hackers

Attachments

On Thu, Aug 17, 2023 at 12:35:54PM +0700, John Naylor wrote:
> That makes it a lexically-scoped global variable, which we don't need
> either. Can we have the internal function allocate on the stack, then
> call cstring_to_text() on that, returning the text result? That does its
> own palloc.
> 
> Or maybe better, save the starting pointer, compute the length at the end,
> and call cstring_to_text_with_len()?  (It seems we wouldn't need
> the nul-terminator then, either.)

Works for me.  I did it that way in v7.

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

Commits

  1. Add to_bin() and to_oct().