"Command Prompt, Inc." <pgsql-general@commandprompt.com> writes:
> I have a client that was using a PL/pgSQL function called html_linebreaks
> to translate newlines into (X)HTML <br/> tags, and he ran into a serious
> memory issue today which actually brought down his Linux server.
FWIW, I've now tried this in 7.2, and it doesn't seem to leak memory;
but it is unreasonably slow ... which is not too surprising considering
the number of cycles you are expending per byte. plpgsql is not a good
text-processing language. This function would be a one-liner in either
plperl or pltcl, and tremendously more efficient too.
regards, tom lane