Without using plpgsql, I\'m trying to urlencode a given text within a pgsql SELECT statement.
The problem with this approach:
select regexp_replace(\
select regexp_replace(encode('héllo there','hex'),'(..)',E'%\\1','g');
This doesn't leave the alphanumeric characters human-readable, though.