Michael Meskes <meskes(at)postgresql(dot)org> writes:
> You're partially right. Standard says "This string may be allocated in
> static storage." So, yes, with your patch we are on the safe side. I just
> committed the changes.
This patch wasn't right: setlocale(LC_NUMERIC, "C") returns a string
corresponding to the *new* locale setting, not the old one. Therefore,
while the patched code failed to dump core, it also failed to restore
the previous locale setting as intended. I have committed an updated
version.
regards, tom lane