Re: Speeding up loops in pl/pgsql function

From: "Reuven M(dot) Lerner" <reuven(at)lerner(dot)co(dot)il>
To: Alex Hunsaker <badalex(at)gmail(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Speeding up loops in pl/pgsql function
Date: 2011-05-25 18:45:43
Message-ID: 4DDD4E57.7070800@lerner.co.il
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Hi, Alex. You wrote:
> Have you tried something like:
> SELECT encode(regexp_replace('141142143', '(\d{3})', '\\\1',
> 'g')::bytea, 'escape');
Hmm, forgot about regexp_replace. It might do the trick, but without a
full-blown eval that I can run on the replacement side, it'll be a bit
more challenging. But that's a good direction to consider, for sure.

> I think select E'\XXX' is what you are looking for (per the fine
> manual: http://www.postgresql.org/docs/current/static/datatype-binary.html)
I didn't think that I could (easily) build a string like that from
digits in a variable or a column, but I'll poke around and see if it can
work.

Thanks,

Reuven

--
Reuven M. Lerner -- Web development, consulting, and training
Mobile: +972-54-496-8405 * US phone: 847-230-9795
Skype/AIM: reuvenlerner

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Alex Hunsaker 2011-05-25 18:48:43 Re: Speeding up loops in pl/pgsql function
Previous Message Alex Hunsaker 2011-05-25 18:35:08 Re: Speeding up loops in pl/pgsql function