On Nov 9, 2007 2:38 PM, Erik Jones <erik@myemma.com> wrote:
>
> >
> > I imagine in a few years, hardly anyone using postgresql will remember
> > the ancient art of having either apostrophes in a row inside your
> > plpgsql functions...
>
> Speaking of that devil, I started working with Postgres mere months
> after that particular evil went away but we still have a good bit of
> plpgsql with it in production. I've been meaning to convert it and
> clean it up for a while now. Would you, or anybody, happen to know
> of any scripts out there that I could grab to make a quick job, no
> brains required of it?
Man, I can't think of any. I'd assume you'd need to look for the
longest occurance of ' marks, and replace it with one field, say $1$
or something, then the next smaller set, with $2$ or something and so
on. I imagine one could write a script to do it. Luckily, we only
had one or two levels of ' marks in any of our stored procs, so it was
only a few minutes each time I edited one to switch it over.