Re: pg_dump / copy bugs with "big lines" ?

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Daniel Verite <daniel(at)manitou-mail(dot)org>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)com>, Ronan Dunklau <ronan(dot)dunklau(at)dalibo(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_dump / copy bugs with "big lines" ?
Date: 2016-03-18 15:48:30
Message-ID: 20160318154830.GA94538@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Teodor Sigaev 2016-03-18 16:38:05 Re: POC, WIP: OR-clause support for indexes
Previous Message Emre Hasegeli 2016-03-18 15:47:36 Re: [PATCH] we have added support for box type in SP-GiST index