Re: [PATCH] pg_convert improvement
Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
From: "Drouvot, Bertrand" <bertranddrouvot.pg@gmail.com>
To: Yurii Rashkovskii <yrashk@gmail.com>
Cc: pgsql-hackers@lists.postgresql.org
Date: 2023-11-27T07:11:06Z
Lists: pgsql-hackers
Attachments
- v3-0001-Don-t-copy-bytea-text-in-convert_from-to-unless-c.patch (text/plain) patch v3-0001
Hi, On 11/24/23 3:32 PM, Yurii Rashkovskii wrote: > Hi Bertrand, > > On Fri, Nov 24, 2023 at 6:26 AM Drouvot, Bertrand <bertranddrouvot.pg@gmail.com <mailto:bertranddrouvot.pg@gmail.com>> wrote: > > > The patch is pretty straightforward, I just have one remark: > > + /* if no actual conversion happened, return the original string */ > + /* (we are checking pointers to strings instead of encodings because > + `pg_do_encoding_conversion` above covers more cases than just > + encoding equality) */ > > I think this could be done in one single comment and follow the preferred style > for multi-line comment, see [1]. > > > Thank you for your feedback. I've attached a revised patch. Did some minor changes in the attached: - Started the multi-line comment with an upper case and finished it with a "." and re-worded a bit. - Ran pgindent What do you think about the attached? Also, might be good to create a CF entry [1] so that the patch proposal does not get lost and gets visibility. [1]: https://commitfest.postgresql.org/46/ Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com
Commits
-
Teach convert() and friends to avoid copying when possible.
- b14b1eb4da4c 17.0 landed