Re: Counting the occurences of a substring within a very large text

From: Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>
To: "Marc Mamin *EXTERN*" <M(dot)Mamin(at)intershop(dot)de>, Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Counting the occurences of a substring within a very large text
Date: 2015-06-24 18:27:36
Message-ID: A737B7A37273E048B164557ADEF4A58B50F68580@ntex2010a.host.magwien.gv.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2015-06-24 21:52:32 Re: INSERT a real number in a column based on other columns OLD INSERTs
Previous Message Sheena, Prabhjot 2015-06-24 18:09:02 pgbouncer issue