Re: Counting the occurences of a substring within a very large text - Mailing list pgsql-general

From Albe Laurenz
Subject Re: Counting the occurences of a substring within a very large text
Date
Msg-id A737B7A37273E048B164557ADEF4A58B50F68580@ntex2010a.host.magwien.gv.at
Whole thread Raw
In response to Re: Counting the occurences of a substring within a very large text  (Marc Mamin <M.Mamin@intershop.de>)
List pgsql-general
Marc Mamin wrote:
>>> I'd like to count the number  linebreaks within a string, but I get a
>>> memory allocation error when using regexp_matches or regexp_split_to_table.

>> Does any of these two work:
[...]

> no, they both yeld the same error.
>
> a new string functions for this would be nice, as it could certainly be implemented in a more efficient way...

This is a rather special case.
But it should be easy to write your own C function that does this efficiently.

Yours,
Laurenz Albe

pgsql-general by date:

Previous
From: "Sheena, Prabhjot"
Date:
Subject: pgbouncer issue
Next
From: Piotr Gackiewicz
Date:
Subject: Re: pg_dump 8.4.9 failing after upgrade to openssl-1.0.1e-30.el6_6.11.x86_64 on redhat linux