Hi, Merlin. You wrote:
select string_agg(v, '') from (select
ascii(regexp_split_to_table('abc', $$\s*$$))::text as v) q;
Wow. I've been programming with pl/pgsql for a good number of years,
but only now do I see the amazing usefulness of regexp_split_to_table
and string_agg, neither of
On Wed, May 25, 2011 at 9:20 PM, Merlin Moncure mmonc...@gmail.com wrote:
On Wed, May 25, 2011 at 8:03 PM, Steve Crawford
scrawf...@pinpointresearch.com wrote:
On 05/25/2011 11:45 AM, Reuven M. Lerner wrote:
Hi, Alex. You wrote:
Have you tried something like:
SELECT
On Thu, May 26, 2011 at 8:11 AM, Merlin Moncure mmonc...@gmail.com wrote:
On Wed, May 25, 2011 at 9:20 PM, Merlin Moncure mmonc...@gmail.com wrote:
On Wed, May 25, 2011 at 8:03 PM, Steve Crawford
scrawf...@pinpointresearch.com wrote:
On 05/25/2011 11:45 AM, Reuven M. Lerner wrote:
Hi, Alex.
Wow.
Color me impressed and grateful. I've been working on a different
project today, but I'll test these tonight.
I'll never underestimate the regexp functionality in PostgreSQL again!
Reuven
--
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to
On 05/26/2011 05:36 AM, Merlin Moncure wrote:
...
got it:
select decode(regexp_replace('141142143', '([0-9][0-9][0-9])',
$q$\\\1$q$ , 'g'), 'escape');
decode
abc
(1 row)
merlin
Nice. A word of warning, in 9.0 this returns a hex string:
select decode(regexp_replace('141142143',
Hi, everyone. I'm working on a project that's using PostgreSQL 8.3,
that requires me to translate strings of octal digits into strings of
characters -- so '141142143' should become 'abc', although the database
column containing this data (both before and after) is a bytea.
While the
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
On Wed, May 25, 2011 at 12:45, Reuven M. Lerner reu...@lerner.co.il wrote:
Hi, Alex. You wrote:
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
Hello
(1) Are there any good guidelines for what operations in pl/pgsql are
optimized for which data structures? For example, it turns out that a great
deal of time is being spent in the substring() function, which surprised me.
I thought that by switching to an array, it might be faster,
On Wed, May 25, 2011 at 10:59, Reuven M. Lerner reu...@lerner.co.il wrote:
Hi, everyone. I'm working on a project that's using PostgreSQL 8.3, that
requires me to translate strings of octal digits into strings of characters
-- so '141142143' should become 'abc', although the database column
On Wed, May 25, 2011 at 11:59 AM, Reuven M. Lerner reu...@lerner.co.il wrote:
Hi, everyone. I'm working on a project that's using PostgreSQL 8.3, that
requires me to translate strings of octal digits into strings of characters
-- so '141142143' should become 'abc', although the database column
Hi, everyone. Merlin wrote:
let's see the source. I bet we can get this figured out.
Here you go... it looked nicer before I started to make optimizations;
I've gotten it to run about 2x as fast as the previous version, but now
I'm sorta stuck, looking for further optimizations, including
On 05/25/2011 11:45 AM, Reuven M. Lerner wrote:
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
On Wed, May 25, 2011 at 8:03 PM, Steve Crawford
scrawf...@pinpointresearch.com wrote:
On 05/25/2011 11:45 AM, Reuven M. Lerner wrote:
Hi, Alex. You wrote:
Have you tried something like:
SELECT encode(regexp_replace('141142143', '(\d{3})', '\\\1',
'g')::bytea, 'escape');
Hmm, forgot
Dkloskxe
Steve Crawford scrawf...@pinpointresearch.com wrote:
On 05/25/2011 11:45 AM, Reuven M. Lerner wrote:
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
15 matches
Mail list logo