Re: Support allocating memory for large strings
David Rowley <dgrowleyml@gmail.com>
From: David Rowley <dgrowleyml@gmail.com>
To: Jim Mlodgenski <jimmy76@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Nathan Bossart <nathandbossart@gmail.com>, Maxim Zibitsker <max.zibitsker@gmail.com>, pgsql-hackers@postgresql.org
Date: 2026-01-07T21:22:04Z
Lists: pgsql-hackers
On Thu, 8 Jan 2026 at 07:31, Jim Mlodgenski <jimmy76@gmail.com> wrote: > SELECT * FROM wide_row WHERE id = 1; > ERROR: string buffer exceeds maximum allowed length (1073741823 bytes) > DETAIL: Cannot enlarge string buffer containing 1000000051 bytes by > 100000000 more bytes. At least it's significantly better than it used to be before 1029bdec2, but I agree it doesn't give you much context on what you might do to solve the issue. One solution is to move away from using StringInfo for backend protocol stuff. That doesn't seem ideal from a code reusability point of view. Having the caller specify an error function callback means more memory in StringInfoData and is complex because of how many ways there are to initialise a StringInfo. > we should be making it clear that the effective row size limit is 1GB. Maybe "Backend protocol message length" -> "1GB" is worth putting in there. David