| From: | Nathan Bossart <nathandbossart(at)gmail(dot)com> | 
|---|---|
| To: | John Naylor <john(dot)naylor(at)enterprisedb(dot)com> | 
| Cc: | 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-17 15:26:28 | 
| Message-ID: | 20230817152628.GA3148583@nathanxps13 | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-hackers | 
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
| Attachment | Content-Type | Size | 
|---|---|---|
| v7-0001-add-to_binary-and-to_oct.patch | text/x-diff | 8.3 KB | 
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Stephen Frost | 2023-08-17 16:01:26 | Re: Logging of matching pg_hba.conf entry during auth skips trust auth, potential security issue | 
| Previous Message | Bruce Momjian | 2023-08-17 14:59:10 | Re: PG 16 draft release notes ready |