Alvaro Herrera <alvherre@commandprompt.com> writes:
> This was fixed on 1.84 of formatting.c for 8.0 (but not backpatched for
> no apparent reason), which also changed some other stuff in that file.
> The complete patch is attached.
I dunno why I didn't back-patch that; feel free to do so. Better do the
whole thing, because anything that chokes on str_numth's abuse of
sprintf is not going to like those other cases either.
regards, tom lane