Re: pg_dump / copy bugs with "big lines" ? - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: pg_dump / copy bugs with "big lines" ?
Date
Msg-id 20160318154830.GA94538@alvherre.pgsql
Whole thread Raw
In response to Re: pg_dump / copy bugs with "big lines" ?  ("Daniel Verite" <daniel@manitou-mail.org>)
Responses Re: pg_dump / copy bugs with "big lines" ?
List pgsql-hackers
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



pgsql-hackers by date:

Previous
From: Emre Hasegeli
Date:
Subject: Re: [PATCH] we have added support for box type in SP-GiST index
Next
From: Teodor Sigaev
Date:
Subject: Re: POC, WIP: OR-clause support for indexes