Joe Conway <mail(at)joeconway(dot)com> writes:
> ! *prefix_const = string_to_bytea_const(match, match_pos);
> ! *rest_const = string_to_bytea_const(rest, pattlen - match_pos);
I think that should be pattlen - pos not pattlen - match_pos, no?
Otherwise it looks reasonable ...
regards, tom lane