From: Reuven M. Lerner <reuven@lerner.co.il>
To: Merlin Moncure <mmoncure@gmail.com>
Cc: Steve Crawford <scrawford@pinpointresearch.com>
Cc: Alex Hunsaker <badalex@gmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Speeding up loops in pl/pgsql function
Date: Wed, 01 Jun 2011 12:19:30 +0300
Message-ID: <4DE60422.3090800@lerner.co.il> (raw)
In-Reply-To: <BANLkTikoGpWS=S2EFruyWCkGxFoRk7Ms_A@mail.gmail.com>
References: <4DDD358E.20307@lerner.co.il>
<BANLkTinuiR=Txtn_dUeSbvvgcWZj9c2+iw@mail.gmail.com>
<4DDD4E57.7070800@lerner.co.il>
<4DDD98B6.6080208@pinpointresearch.com>
<BANLkTin8u2fM+RjE4Ao78v2W83V2Z9iHUA@mail.gmail.com>
<BANLkTimU=O-vreTUTmC6TV+cA+TyqYqUnQ@mail.gmail.com>
<BANLkTikoGpWS=S2EFruyWCkGxFoRk7Ms_A@mail.gmail.com>
Hi, everyone.
First of all, thanks for all of your help several days ago. The
improvements to our program were rather dramatic (in a positive sense).
Based on the help that everyone gave, I'm working on something similar,
trying to use regexp_replace to transform a string into the result of
invoking a function on each character. For example, I'd like to do the
following:
regexp_replace('abc', '(.)', ascii(E'\\1')::text, 'g');
Unfortunately, the above invokes ascii() on the literal string E'\\1',
rather than on the value of the backreference, which isn't nearly as
useful. I'd like to get '979899' back as a string. And of course, once
I can get back the value of ascii(), I figure that it should work for
any function that I define.
Thanks again for any suggestions everyone might have.
(And if this should go to pgsql-general, then I'll understand. If it
helps, my alternative to regexp_replace is a super-slow function, akin
to the one that I showed here last week.)
Reuven
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: reuven@lerner.co.il, mmoncure@gmail.com, scrawford@pinpointresearch.com, badalex@gmail.com
Subject: Re: Speeding up loops in pl/pgsql function
In-Reply-To: <4DE60422.3090800@lerner.co.il>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox