Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1agwdk-00051K-MT for pgsql-hackers@arkaria.postgresql.org; Fri, 18 Mar 2016 15:48:40 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1agwdk-0000hh-5u for pgsql-hackers@arkaria.postgresql.org; Fri, 18 Mar 2016 15:48:40 +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.84_2) (envelope-from ) id 1agwdj-0000fx-29 for pgsql-hackers@postgresql.org; Fri, 18 Mar 2016 15:48:39 +0000 Received: from smtp-auth.no-ip.com ([8.23.224.61] helo=out.smtp-auth.no-ip.com) by magus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1agwdf-0005fW-9J for pgsql-hackers@postgresql.org; Fri, 18 Mar 2016 15:48:38 +0000 X-No-IP: alvh.no-ip.org@noip-smtp X-Report-Spam-To: abuse@no-ip.com Received: from alvin.alvh.no-ip.org (unknown [200.83.202.40]) (Authenticated sender: alvh.no-ip.org@noip-smtp) by smtp-auth.no-ip.com (Postfix) with ESMTPA id 956A5400EED; Fri, 18 Mar 2016 08:48:32 -0700 (PDT) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id 6CEDC593; Fri, 18 Mar 2016 12:48:30 -0300 (CLT) Date: Fri, 18 Mar 2016 12:48:30 -0300 From: Alvaro Herrera To: Daniel Verite Cc: Tom Lane , Robert Haas , Jim Nasby , Ronan Dunklau , pgsql-hackers Subject: Re: pg_dump / copy bugs with "big lines" ? Message-ID: <20160318154830.GA94538@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <28a1f376-e006-4ecf-93f5-133737652c5c@mm> User-Agent: Mutt/1.5.23 (2014-03-12) X-Pg-Spam-Score: -1.1 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Daniel Verite wrote: > To go past that problem, I've tried tweaking the StringInfoData > used for COPY FROM, like the original patch does in CopyOneRowTo. > > It turns out that it fails a bit later when trying to make a tuple > from the big line, in heap_form_tuple(): > > tuple = (HeapTuple) palloc0(HEAPTUPLESIZE + len); > > which fails because (HEAPTUPLESIZE + len) is again considered > an invalid size, the size being 1468006476 in my test. Um, it seems reasonable to make this one be a huge-zero-alloc: MemoryContextAllocExtended(CurrentMemoryContext, HEAPTUPLESIZE + len, MCXT_ALLOC_HUGE | MCXT_ALLOC_ZERO) -- Álvaro Herrera http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers