Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fJcZj-0004y0-3e for pgsql-general@arkaria.postgresql.org; Fri, 18 May 2018 10:25:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fJcZh-0007CA-FM for pgsql-general@arkaria.postgresql.org; Fri, 18 May 2018 10:25:25 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fJcZh-0007Bz-7g for pgsql-general@lists.postgresql.org; Fri, 18 May 2018 10:25:25 +0000 Received: from mail.hjp.at ([212.17.106.138] helo=rorschach.hjp.at) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fJcZZ-0003Vt-Os for pgsql-general@lists.postgresql.org; Fri, 18 May 2018 10:25:24 +0000 Received: by rorschach.hjp.at (Postfix, from userid 1000) id 2BEFF1A3E; Fri, 18 May 2018 12:25:16 +0200 (CEST) Date: Fri, 18 May 2018 12:25:16 +0200 From: "Peter J. Holzer" To: pgsql-general@lists.postgresql.org Subject: Re: Out of memory error with PG10.3, 10.4 but not 9.3.19 Message-ID: <20180518102516.3gv64eoek7o7qpau@hjp.at> References: <2120893212.2682655.1526396569241.ref@mail.yahoo.com> <2120893212.2682655.1526396569241@mail.yahoo.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="a5frhfsvxscfj5tj" Content-Disposition: inline In-Reply-To: <2120893212.2682655.1526396569241@mail.yahoo.com> User-Agent: NeoMutt/20170113 (1.7.2) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --a5frhfsvxscfj5tj Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 m= ore > 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 --=20 _ | 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 --a5frhfsvxscfj5tj Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEETtJbRjyPwVTYGJ5k8g5IURL+KF0FAlr+qgcACgkQ8g5IURL+ KF2Z6xAAjJ3lZZP42jopwV/M2H9GXfPiurY3jpRyuQUupcdfN1wLbRAEbfZQbBpZ oOuvRiZdJ1goSSztcCW4FKFiVGyBNenpxQB2qZ58DAtGxsMbFFCupatknBVlyAX3 mgWtOWMmzJ5bed9BN2/fmyvCVg3S5SOrf+fVcbau0b4a2poh6Y9JFS/ZGkgGiU64 isLNFSFQksEwnSdrf6YMZmZa+J0lLhW4z3jEijlUT+KfeXypOkCyBBkALw0RaMio SrNBMJjB9tHFUQF+QjBaV+bmWe+V1ChSA5DDv3gh/8yX5HJKdje4AXfRGaX5uy+/ zsfP35DCJpxZzMey75eBVTx3sIBdDXZIQGmGtZs9INAew9BFzvN2mKs7OTNrRfNz NcSu3d4CTc6F1Sg0YDp1q5Xd/QxEIBnFDHHDGumtgW663Lw692SNAqSXtTaPZJ9m i/AW5bRKwzV8eTf/WZyCH9W86BHEh6+pTg2k005Myn/+MqADa3OPtJxjyN+K6GTx hgTda4+rds5l42kTOCk+eiWIIxxXqDuVB32B9K+81edodsZyZ5EVuIG5WTW8VfJE RBUGeZKxukgf+J4cnl6Ab5UIIIDLYLShgowbtvp2Nxhm+8p5ECRRSKUBls4+HN2f y2dA6Y0M+p4576XgRcZFn9WOaTtjMPOCcyOhhLyiBL/HAG+C8Zw= =rOph -----END PGP SIGNATURE----- --a5frhfsvxscfj5tj--