From: Peter J. Holzer <hjp-pgsql@hjp.at>
To: pgsql-general@lists.postgresql.org
Subject: Re: Out of memory error with PG10.3, 10.4 but not 9.3.19
Date: Fri, 18 May 2018 12:25:16 +0200
Message-ID: <20180518102516.3gv64eoek7o7qpau@hjp.at> (raw)
In-Reply-To: <2120893212.2682655.1526396569241@mail.yahoo.com>
References: <2120893212.2682655.1526396569241.ref@mail.yahoo.com>
<2120893212.2682655.1526396569241@mail.yahoo.com>
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/;
Attachments:
signature.asc (application/pgp-signature, 832B) download
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: hjp-pgsql@hjp.at
Subject: Re: Out of memory error with PG10.3, 10.4 but not 9.3.19
In-Reply-To: <20180518102516.3gv64eoek7o7qpau@hjp.at>
References: <2120893212.2682655.1526396569241.ref@mail.yahoo.com> <2120893212.2682655.1526396569241@mail.yahoo.com> <20180518102516.3gv64eoek7o7qpau@hjp.at>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox