Re: Speeding up loops in pl/pgsql function - Mailing list pgsql-performance

From Reuven M. Lerner
Subject Re: Speeding up loops in pl/pgsql function
Date
Msg-id 4DDD4E57.7070800@lerner.co.il
Whole thread Raw
In response to Speeding up loops in pl/pgsql function  ("Reuven M. Lerner" <reuven@lerner.co.il>)
Responses Re: Speeding up loops in pl/pgsql function  (Alex Hunsaker <badalex@gmail.com>)
Re: Speeding up loops in pl/pgsql function  (Steve Crawford <scrawford@pinpointresearch.com>)
List 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


pgsql-performance by date:

Previous
From: "Pierre C"
Date:
Subject: Re: FW: KVP table vs. hstore - hstore performance (Was: Postgres NoSQL emulation)
Next
From: Alex Hunsaker
Date:
Subject: Re: Speeding up loops in pl/pgsql function