I'd always sort of assumed that the UTF_U2E() / UTF_E2U() macros in
pltcl.c were enabled by default.  I just realized that that isn't so:
they're enabled by a test


UNICODE_CONVERSION is defined nowhere in our sources, and I can find no
indication that the Tcl headers define it either.  A quick test proves
that indeed no encoding conversion happens when running pltcl.

It looks like this has been broken since commit 034895125d648b86, which
is rather distressing because it means pretty much nobody is using pltcl
with any non-ASCII data.  It also means that pltcl is a trivial way to
break encoding validity inside any non-UTF8 database.

If we're moving the minimum Tcl version to be 8.4, as I just proposed we
should do in another thread, I think we should remove the above-quoted #if
and just compile this code unconditionally.

                        regards, tom lane

Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:

Reply via email to