Re: Out of memory error with PG10.3, 10.4 but not 9.3.19 - Mailing list pgsql-general

From Peter J. Holzer
Subject Re: Out of memory error with PG10.3, 10.4 but not 9.3.19
Date
Msg-id 20180518102516.3gv64eoek7o7qpau@hjp.at
Whole thread Raw
In response to Out of memory error with PG10.3, 10.4 but not 9.3.19  (ChatPristi <cchristo_0899@yahoo.fr>)
List pgsql-general
On 2018-05-15 15:02:48 +0000, ChatPristi wrote:
> I have a SELECT command (in partitionned tables) that failed with:
> psql:/tmp/query.txt:1: ERROR:  out of memory
> DETAIL:  Cannot enlarge string buffer containing 1073741818 bytes by 32 more
> bytes.

1073741818 is a bit less than 1GB and 1073741818+32 is a bit more. So
you are obviously hitting a 1GB limit here.

Given that 1GB is the maximum length of a character type value in
PostgreSQL and the error message mentions a "string buffer", I suspect
that your query tries to construct a very long string. Try to rewrite
the query so that it creates several shorter strings instead.

        hp




--
   _  | Peter J. Holzer    | we build much bigger, better disasters now
|_|_) |                    | because we have much more sophisticated
| |   | hjp@hjp.at         | management tools.
__/   | http://www.hjp.at/ | -- Ross Anderson <https://www.edge.org/>

Attachment

pgsql-general by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: Importing data from CSV into a table with array and composite types
Next
From: Vick Khera
Date:
Subject: Re: When use triggers?