Support allocating memory for large strings - Mailing list pgsql-hackers

From Maxim Zibitsker
Subject Support allocating memory for large strings
Date
Msg-id 5B146D62-35AE-4822-9B98-37E386AFB942@gmail.com
Whole thread Raw
Responses Re: Support allocating memory for large strings
Re: Support allocating memory for large strings
List pgsql-hackers
PostgreSQL's MaxAllocSize limit prevents storing individual variable-length character strings exceeding ~1GB, causing
"invalidmemory alloc request size" errors during INSERT operations on tables with large text columns. Example
reproductionincluded in artifacts.md. 

This limitation also affects pg_dump when exporting a PostgreSQL database with such data. The attached patches
demonstratesa proof of concept using palloc_extended with MCXT_ALLOC_HUGE in the write path. For the read path, there
area couple of possible approaches: extending existing functions to handle huge allocations, or implementing a chunked
storagemechanism that avoids single large allocations. 

Thoughts?

Maxim



Attachment

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: IO in wrong state on riscv64
Next
From: Tom Lane
Date:
Subject: Re: Support allocating memory for large strings