I wrote:
> SQL has the following escape syntax for it:
>
> U&'special character: \xxxx' [ UESCAPE '\' ]
Here is an in-progress patch for this. It still needs updates in the
psql scanner and possibly other scanners. But the server-side
functionality works.