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

From Marc Mamin
Subject Counting the occurences of a substring within a very large text
Date
Msg-id B6F6FD62F2624C4C9916AC0175D56D8828BEA69B@jenmbs01.ad.intershop.net
Whole thread Raw
Responses Re: Counting the occurences of a substring within a very large text  (Chris Mair <chris@1006.org>)
Re: Counting the occurences of a substring within a very large text  (Albe Laurenz <laurenz.albe@wien.gv.at>)
Re: Counting the occurences of a substring within a very large text  (Andy Colson <andy@squeakycode.net>)
Re: Counting the occurences of a substring within a very large text  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Hello,

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.

Any idea for an alternative to this problem  ?

select count(*)-1 from
(  select regexp_split_to_table(full_message,'(\n)', 'g')
   from mytable
   where id =-2146999703
)foo;

ERROR:  invalid memory alloc request size 1447215584

regards,

Marc Mamin


pgsql-general by date:

Previous
From: Andomar
Date:
Subject: Include.d and warnings
Next
From: Chris Mair
Date:
Subject: Re: Counting the occurences of a substring within a very large text