John Naylor <john.naylor@2ndquadrant.com> writes:
> [ v11 patch ]
I pushed this with some small cosmetic adjustments.
One non-cosmetic adjustment I experimented with was to change
str_udeescape() to overwrite the source string in-place, since
we know that's modifiable storage and de-escaping can't make
the string longer. I reasoned that saving a palloc() might help
reduce the extra cost of UESCAPE processing. It didn't seem to
move the needle much though, so I didn't commit it that way.
A positive reason to keep the API as it stands is that if we
do something about the idea of allowing Unicode strings in
non-UTF8 backend encodings, that'd likely break the assumption
about how the string can't get longer.
I'm about to go off and look at the non-UTF8 idea, btw.
regards, tom lane