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.
Чтобы сделать работу с сайтом удобнее, мы используем cookie и аналитический сервис «Яндекс.Метрика». Продолжая пользоваться сайтом, вы соглашаетесь с их использованием.